Salesforce Fact #590 | SOQL semi-join & anti-join
What are semi-join and anti-join in SOQL?
A semi-join is a subquery on another object in an IN clause to restrict the records returned.
example: SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity WHERE IsClosed=true)
An anti-join is a subquery on another object in an NOT IN clause to restrict the records returned.
example: SELECT Id, Name FROM Account WHERE Id NOT IN (SELECT AccountId FROM Opportunity WHERE IsClosed=true)
Comments
Post a Comment