I use java and hibernate 3.2.5.ga .
I have a table with a date column. I want to create a hql query that will sort the result by date ascending but will put the nulls last.
Normally I the sort by date asc returns nulls first and the "NULL LAST" keyword does not work.
How can I achieve that ?
Use query like this:
SELECT YourDateColumn
FROM YourTable
WHERE YourCondition
ORDER BY
CASE WHEN YourDateColumn IS NULL THEN 1 ELSE 0 END,
YourDateColumn