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
ranirani 

Question on SOQL Relationship Query

Hi,

 

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.

 

Regrads,

Rani

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

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.