Skip to main content
deleted 1 character in body
Source Link
Raul
  • 18.9k
  • 5
  • 42
  • 70

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE 
Id IN (SELECT LookupName__c FROM ChildObjectName__c WHERE checkbox__c = true)

Related documentation for reference: Basic SOQL Relationship Queries. Similar query with Account and Contact object:

SELECT Name, (SELECT Name FROM Contacts) 
    FROM Account WHERE 
    Id IN (SELECT AccountId FROM Contact)

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE 
Id IN (SELECT LookupName__c FROM ChildObjectName__c WHERE checkbox__c = true)

Related documentation for reference: Basic SOQL Relationship Queries. Similar query with Account and Contact object:

SELECT Name, (SELECT Name FROM Contacts) 
    FROM Account WHERE 
    Id IN (SELECT AccountId FROM Contact)

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE 
Id IN (SELECT LookupName__c FROM ChildObjectName__c WHERE checkbox__c = true)

Related documentation for reference: Basic SOQL Relationship Queries. Similar query with Account and Contact object:

SELECT Name, (SELECT Name FROM Contacts) 
    FROM Account WHERE 
    Id IN (SELECT AccountId FROM Contact)
added 30 characters in body
Source Link
Raul
  • 18.9k
  • 5
  • 42
  • 70

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE  
Id IN (SELECT LookupName__c FROM ChildObjectName__c WHERE checkbox__c = true)`
 

Related documentation for reference: Basic SOQL Relationship Queries. Similar query with Account and Contact object:

SELECT Name, (SELECT Name FROM Contacts) 
    FROM Account WHERE 
    Id IN (SELECT AccountId FROM Contact)

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE Id IN (SELECT LookupName__c FROM ChildObjectName__c)`

Related documentation for reference: Basic SOQL Relationship Queries

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE  
Id IN (SELECT LookupName__c FROM ChildObjectName__c WHERE checkbox__c = true)
 

Related documentation for reference: Basic SOQL Relationship Queries. Similar query with Account and Contact object:

SELECT Name, (SELECT Name FROM Contacts) 
    FROM Account WHERE 
    Id IN (SELECT AccountId FROM Contact)
Source Link
Raul
  • 18.9k
  • 5
  • 42
  • 70

Assuming the child object name as ChildObjectName__c and lookup API name on child isLookupName__c, your query with where clause would look as:

SELECT  Id,
    (SELECT Checkbox__c FROM ChildRelationshipName__r)
FROM Parent__c WHERE Id IN (SELECT LookupName__c FROM ChildObjectName__c)`

Related documentation for reference: Basic SOQL Relationship Queries