Infographic - SOQL Overview
Infographic - SOQL Overview
COMMON KEYWORDS
SELECT AND
Select records from your Salesforce Org Filter conditions that all must be true
OR
FROM Filter conditions that only one must be true
Identify the Salesforce object from which
LIMIT
we are retrieving records
Specify the maximum number of records returned
ORDER BY
WHERE
Specify the order of the records being returned
Filter records that meet specific conditions
Retrieve only Cases where the status is Closed Retrieve a single opportunity and store it in a
variable
SELECT Id FROM Case WHERE Status = 'Closed' Opportunity opp = [SELECT Id, Name,
Amount FROM Opportunity LIMIT 1];
Relationship Queries
Retrieve a single field value and store it in a
Child to Parent variable
Retrieve all contacts with account name
String clientEmail = [SELECT Id, Email FROM
SELECT Id, Name, Account.Name FROM Contact Contact LIMIT 1].Email;
www.salesforcementor.com