Development questions
Write a SOQL query to retrieve the top 5 Accounts based on AnnualRevenue excluding null values (NULLS LAST).
Order descending with NULLS LAST (or filter nulls) and limit to 5.
soql
SELECT Id, Name, AnnualRevenue FROM Account
WHERE AnnualRevenue != null
ORDER BY AnnualRevenue DESC NULLS LAST
LIMIT 5
soqlscenarioorder-by
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?