Notes
In Salesforce, SOQL (Salesforce Object Query Language) allows developers to query records from Salesforce objects in a structured and efficient way. The following example demonstrates how to query Opportunity
records created in a specific calendar year (in this case, 2020) and retrieve their CreatedDate
and Amount
fields.
List<Opportunity> opp = [SELECT CreatedDate, Amount
FROM Opportunity
WHERE CALENDAR_YEAR(CreatedDate) = 2020];