Having:
SELECT DISTINCT TOP 100 * FROM mytable ORDER BY date ASC
How can I make the nulls in date go last?
Thanks a lot.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some databases support a syntax for NULLs last in an
order byand some do not. So, I use:Or, if I don’t want to type so much:
You can also put the distinct in a subquery:
Assuming that
dateis in the column list, however, the first version should work.