Thread Details

 Sub queries


Post by Frazer Lewis
Director at Rephrase
Joined 9/23/2019
Posted 10/18/2019 8:04 AM

 

When running a query which includes a sub-query, I'm not seeing the results from the sub-query although the rest of the query is returning data

So, for example, the following query is only displaying a single column of IDs

 

Is there any way to get sub-queries to return data?

  

SELECT

ID,
(SELECT ID FROM Contacts)

FROM 

Account

LIMIT 10

 

Thanks,

Frazer

Post by Administrator
Visual Software Systems
Joined 1/01/2016
Posted 10/18/2019 11:16 AM

Hi Frazer,

I ran the query in one of our orgs and can see the sub-query results. Data from a sub-query is returned in a grid subordinate to the row that owns it when the Render Style is set to Hierarchical (the default). You should see a chevron next to each row number that lets you expand the view to see the sub-query results for that row. Alternatively, you can change the Render Style to Flat, which will reformat the result into a traditional relational result set. 

Post by Frazer Lewis
Director at Rephrase
Joined 9/23/2019
Posted 11/08/2019 11:11 AM

Thanks for clarifying the two ways to render the subquery results

 

Log in to reply to this post.