• /
  • Log in
  • Free account

Simulate SQL JOIN functions in Insights


As of April 12, 2021, we are upgrading Insights to an improved web and mobile experience! All of your Insights URLs will be redirected automatically to the corresponding dashboards in New Relic One. For more details about this migration and how you can easily plan for this transition, see our Explorers Hub post.

When you use Insights to make queries, NRQL does not have an equivalent SQL-like JOIN function for subqueries. Recommendation: Make the transition from Insights to New Relic One so that you can take advantage of nested queries.

Simulate SQL JOIN in Insights

If you are using Insights to gain more in-depth data, you can add custom attributes to some data types. With Insights, you can simulate a JOIN by using custom attributes in a query's WHERE or FACET clause.

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:

Create issueEdit page
Copyright © 2021 New Relic Inc.