...

View Full Version : Resolved Case null



BubikolRamios
03-17-2013, 11:14 PM
since as it looks like I cant use NULL comparison insside case statement, how can I order this


b
null
a
null
...


into



a
b
null
null
...


?

BubikolRamios
03-17-2013, 11:18 PM
found solution here: http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html



If you want to have NULL values presented last when doing an ORDER BY, try this:

SELECT * FROM my_table ORDER BY ISNULL(field), field [ ASC | DESC ]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum