SQL script is common language for web/database developers.
Sometime, a little bit tricky when you want to accomplish a request sound simple but yet challenging.
To sort a list of records with ‘Last Name’ ascending, but to make sure NULL value of ‘Last Name’ must at the end.
SELECT ID , LastName , FirstName , Email , Phone , Office FROM Table ORDER BY CASE WHEN LastName = '' THEN 1 ELSE 0 END, LastName
Incoming search terms:
- mssql order by null at the end (2)
- asp null at the end of request (1)
- sql order put nulls at end (1)
- sql order by desc null at the end (1)
- SQL Group By nulls at the end (1)
- order by null at the end (1)
- order by ascending sql (1)
- mysql order by null to the end (1)
- mysql order by null at end (1)
- mssql order by null (1)