Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get values of more than two columns in a group by ?
Xueyang,
Thanks for the pointer. This syntax works on Oracle but not SqlServer. My task included writing cross platform SQL. The other solution of putting the GROUP BY in the FROM clause is portable.
Regards,
Sam
"xueyang" <xueyangy_at_singnet.com.sg> wrote in message news:<ahqr1k$5u3$1_at_reader01.singnet.com.sg>...
> How about
>
> SELECT column1,column2... FROM arrival table
> WHERE (last_name,arrive_date) in
> (SELECT last_name , MAX(arrive_date)
> FROM arrival table
> GROUP BY last_name )
>
> I think this will help.
>
> Regards,
Received on Fri Jul 26 2002 - 23:34:29 CDT