SQL ORDER by `no` with NULLs at the end
SELECT * FROM table ORDER BY ISNULL(field), field ASC;
You can use a CASE
statement to tweak ordering:
SELECT *
FROM table
ORDER BY case when no is null then 2 else 1 end, no
This orders on "nullableness" first, and no
second.
Could you try this?
ORDER BY ISNULL(no),no;
SELECT * FROM table ORDER BY COALESCE(no,999999) ASC
Just replace the 999999 with something larger if your numbers are naturally bigger than that.