Questions tagged [semi-join]

Use this tag when discussing a subquery that appears in the WHERE clause of a SOQL query

Filter by
Sorted by
Tagged with
0 votes
0 answers
51 views

Salesforce Batch – Limitations (semi-joins, governor limits)

I need to write a Batch class to delete records from Child to Parents objects: Child__c --> Parent__c --> Parent_Of_Parent__c Every object has approximately 5 million records to delete, so I ...
Alessia's user avatar
0 votes
1 answer
101 views

SOQL query not working with GROUP BY in semi-join

Why is this SOQL query not working? I'm trying to retrieve duplicate accounts, by I need the Id for each specific account that's why I didn't just use the subselect query which would give me a grouped ...
Hebano Duffrayer's user avatar
2 votes
1 answer
175 views

What are the objects/entities that are NOT allowed in an inner join SOQL query?

I've tried to do an inner join SOQL query using Events/Tasks: SELECT Id FROM Attachment WHERE ParentId IN (SELECT Id FROM Event) LIMIT 1000 But I failed with the error: "Entity 'Event' is not ...
Oriol Bonany's user avatar
1 vote
1 answer
1k views

SOQL: Count of Contacts associated with Accounts that have Opportunities

I need a count of Contacts that are associated with Accounts that have ever had an Opportunity. Here's the query as I think it should be SELECT count() FROM Contact WHERE AccountID in (SELECT id ...
Amber Neill Boaz's user avatar
1 vote
1 answer
111 views

SELECT opportunities AND contacts AND tasks

o See all opportunities (where field isclosed = false), contacts and tasks (where field isclosed = false) related to the account. I Have This Select Select Id, (Select Id, WhoId FROM Tasks ...
Helpme's user avatar
  • 11
7 votes
2 answers
4k views

Entity 'Task' is not supported for semi join inner selects

I want add a default task to an opportunity when this one is close won and the opportunity hasn't any task. I get the error compiling the below code: Entity 'Task' is not supported for semi join ...
Van Busse's user avatar
3 votes
2 answers
4k views

Maximum 2 semi join sub-selects are allowed

While I'm querying on account object based on several conditions from different object I'm getting the below error: Maximum 2 semi join sub-selects are allowed . The following the query which I'm ...
Lokesh's user avatar
  • 165