You are here: Re: sorting table « MsSQL Server « IT news, forums, messages
Re: sorting table

Posted by Oonz on 05/15/07 17:21

Hi Plamen,
It was really great.Thanks for your immediate reply.

Regards,
Arunkumar.Dharuman





On May 15, 5:54 pm, "Plamen Ratchev" <Pla...@SQLStudio.com> wrote:
> Please don't multipost, rather crosspost. Replied in
> microsoft.public.sqlserver.server:
>
> SELECT F.ID,
> F.LASTNAME
> FROM Foobar AS F
> LEFT OUTER JOIN
> (
> SELECT ID,
> MIN(LASTNAME) AS GRP
> FROM Foobar
> WHERE ID > 0
> GROUP BY ID
> ) AS G
> ON F.ID = G.ID
> ORDER BY COALESCE(G.GRP, F.LASTNAME),
> F.ID,
> F.LASTNAME
>
> HTH,
>
> Plamen Ratchevhttp://www.SQLStudio.com

 

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

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