• UNION ALL simply concats the results, UNION removes the duplicates, the best way to do it is to sort the result, so NULLs come first.

    Try this:

    SELECT 3 UNION SELECT '2' UNION SELECT NULL