I have one parent "quote__c" and child object "Quote_line_item__c" .I want get the parent id with query some thing like this
select id,(select name from quote_line_item__c where name='123' and name='456') from quote__c
Do you have a rollup summary field that holds count of line items? If you do - this might be one way to do it:
SELECT Id FROM Quote__c WHERE Id IN (SELECT Quote__c FROM Quote_Line_Item__c WHERE Name = '123') AND Id IN (SELECT Quote__c FROM Quote_Line_Item__c WHERE Name = '456') AND Lines_count__c = 2
I am a beginner. Can someone explain how to write a SOQL query to get child custom object when parent information is given and vice versa? //student__c - child object, college__c-parent object, Related through Master detail