Well - could just give you the query - or...teach you how to go figure it out.
First thing - go download the SolarWinds Orion SDK. It has SWQL Studio with it.
Make a connection to your core server (easiest way) -- NOT the SQL server! Once you have a working SQL query, then paste it in there, and you can do table look ups to determine the names you need on the tables. It is helpful if you alias your table names in the "from" line, so it is easier to deal with.
So -
N.Caption
from Orion.Nodes N