Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
null 値と null 以外の値の両方を持つフィールドを含むリストを、null 以外の値で並べ替える方法。
試す
ORDER BY CASE WHEN <COL> IS null THEN 1 else 0 END
これにより、最初に NOT NULL COL 値を持つ行が順序付けられ、その後に NULL COL 値を持つ BY 行が続きます。