You can query using extended properties. In SWQL, instead of writing a join query, extended properties can be used. Refer to "C:\Program Files (x86)\SolarWinds\Orion SDK\Documentation\Orion SDK.pdf" for details about extended properties.
Provided below a sample query to query Orion.Nodes's properties and CPs.
select NodeID, Caption, IP_Address, Nodes.CustomProperties.City
Here to query custom properties of nodes, we can add Nodes.CustomProperties.City (EntityName.ExtendedPropertyLinkName.PropertyName)
You can also open SWQL Studio to see the list of extended property links that are created to each entity (Those with link icon)