Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get values of more than two columns in a group by ?

Re: How to get values of more than two columns in a group by ?

From: Sam Talebbeik <sam777t_at_yahoo.com>
Date: 26 Jul 2002 21:34:29 -0700
Message-ID: <9ec3a1ef.0207262034.481ced1d@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US