Soql Queries
Soql Queries
Child to parent :-
1.SELECT Name,Account.Type,Account.Id from
Contact WHERE Account.Id!= null
Interview Queries :-
---------------------
This query will give you accounts that DO NOT have any contacts and Opportunities.
-----------------------------------------------------------------------
1.Select Id, Name from Account where ID NOT IN (Select AccountId from Contact) AND
ID NOT IN (Select AccountId from Opportunity)
On the flip, you can query all Accounts that do have at least 1 contact like this
-----------------------------------------------------------------------------------
2.Select Id, Name From Account Where Id IN (Select AccountId From Contact)