$ ./guess_the_languageSQL & Databases
SQL & Databases · medium · #42

Where does the NULL appear in the output?

-- PostgreSQL; score: 3, NULL, 1
SELECT score FROM t
ORDER BY score;
  1. First
  2. Last
  3. It is left out
  4. In the middle
PostgreSQL sorts NULL as larger than any value, so ascending order puts it last (use NULLS FIRST to change).
Play SQL & Databases ▸