Simulate SQL JOIN functions in Insights

NRQL does not have an equivalent SQL-like JOIN function. Also, there is no equivalent for nested queries or subqueries.

You can simulate a JOIN by using custom attributes in a query's WHERE or FACET clause.

Simulate SQL JOIN with custom attributes

To gain more in-depth data, you can add custom attributes to some data types.

For example, you want to know which browser types are experiencing the highest web duration for a specific product purchase. You could add a custom attribute named Product to your application's purchase transaction method. Then you could run this NRQL query:

SELECT max(duration), average(duration), max(backendDuration), average(backendDuration) 
FROM PageView 
WHERE Product = 'Hat' 
FACET userAgentName 
SINCE 7 days ago

For more help

If you need more help, check out these support and learning resources: