code_junkie

nhibernate - sort null at end

Nov 11th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. select x from MyClass x order by case when x.MyProperty is null then 1 else 0 end, x.MyProperty
  2.  
  3. SELECT * FROM myTable
  4. WHERE ...
  5. ORDER BY CASE WHEN myDate IS NULL THEN 1 ELSE 0 END, myDate;
Add Comment
Please, Sign In to add comment