function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
csreddy7799csreddy7799 

Subquery using parent values

Hi, 

 

Am trying to fetch records where child name same as parent name. For ex:

 

Select Name , ( select Name from Child__r where Name =: Parent__c.Name ) from parent__C ; This query is not working

 

How can i write  query like this?

souvik9086souvik9086

You can't check like this with field values after operator in the same query. For this you have to write another query based on the value of this query,

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

AV18AV18

Select Name , ( select Name from Child__r  As C ) from parent__C As P Where C.Name Is In :P.Name