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
si risi ri 

how query child records for a parent record where excluding a particular child ID

Hi all,
Can we  query all the child records for a parent record where excluding a particular child ID?
Rounak SharmaRounak Sharma
hello si ri,
Please try as below
Select Id, Name from Parent__c where Id In (Select ParentId__c from Child__c) AND NOT =:childId
Swathi soma 2Swathi soma 2
Hi,
Please find the below query for a single parent record:
Select id,Name ,(select id,name from child__c where id != :ChildIdToExclude) from parent__c where id =:parentid