Databases · Junior · Question 75 of 75
Where do NULLs appear with ORDER BY last_login ASC in PostgreSQL?
- 1They are removed from the result
- 2At the beginning
- ✓Correct answer: At the end, because PostgreSQL treats NULL as larger than any value
Explanation
With DESC they come first. You can set it explicitly with NULLS FIRST or NULLS LAST. Other databases, like MySQL, sort NULLs differently.