How to sort null values at last in SOQL?

Generally in SOQL, null values are sorted first. In order to sort null values at last make use of NULLS LAST keyword.

Sample:

SELECT Name, Id FROM Account ORDER BY Name DESC NULLS LAST

No comments:

Post a Comment