|
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]
|