Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dani2
Starting Member
32 Posts |
Posted - 2008-09-22 : 03:55:34
|
| Hi I do select from a table ordered by a column which contains null value.How can I get the sorting ascending but the lines with null values at the end?thank you |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-22 : 03:58:11
|
| tryorder by case when col is null then 1 else 0 end, colMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-22 : 04:03:06
|
quote: Originally posted by dani2 Hi I do select from a table ordered by a column which contains null value.How can I get the sorting ascending but the lines with null values at the end?thank you
order by coalesce(column,'zzzzzzz') if column is of character type.order by coalesce(column,2147483647) if integer |
 |
|
|
|
|
|