+ Start a Discussion

Question on SOQL Relationship Query



I need help in building a SOQL query to retrieve data by joining a parent and child table.


Following is my requirement, i need data from parent table where either the parent record is modified from last one day or its corresponding child record is modified from last one day.


For example, i have account table and client table which is child to account, i've written the following query:


select id , name from account where lastmodifieddate > yesterday or id in (select account__c from client__c where lastmodifieddate > yesterday)


The above query throws an error saying that "OR" condition is not accepted in semi join queries.


Can anyone let me know how should i retrieve data in the above scenario?


Help is very mush appreciated.




I think you need to use the "||" operator for a logical OR rather than the word "OR".
Is your query in an Apex class or Apex Trigger?

My query is in a .Net application from where i am using sales force API and retrieving data. (i am using partner wsdl)


As suggested even tried "||" rather than "OR", still throwing error.