You are here: Re: ASC Result Set with Nulls at the bottom « MsSQL Server « IT news, forums, messages
Re: ASC Result Set with Nulls at the bottom

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация