Posted by Hugo Kornelis on 01/25/06 23:15
On 25 Jan 2006 12:22:36 -0800, ActiveX wrote:
>I have a results set that is sorted on LineNum. Not all items have a
>LineNum (some are null). I want my result set to return all items in
>ASC LineNum order and then list all items with NULL LineNum at the end
>of the results. Any Suggestions?
Hi ActiveX,
ORDER BY CASE WHEN LineNum IS NULL THEN 1 ELSE 0 END, LineNum
--
Hugo Kornelis, SQL Server MVP
[Back to original message]
|