Write a SOQL query to find the 2nd Highest Amount among all Opportunities (ORDER BY Amount DESC NULLS LAST LIMIT 1 OFFSET 1).
Answer
Sort descending, skip the first row, and take one.
soql
SELECT Id, Name, Amount FROM Opportunity
WHERE Amount != null
ORDER BY Amount DESC NULLS LAST
LIMIT 1 OFFSET 1
This returns the record with the 2nd highest Amount (ties return the next row, not the next distinct value; for distinct values group by Amount).
soqlscenariooffset