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

Home -> Community -> Usenet -> c.d.o.misc -> Re: GROUP BY....but not on all columns

Re: GROUP BY....but not on all columns

From: dean <deanbrown3d_at_yahoo.com>
Date: Sun, 17 Jun 2007 02:15:52 -0000
Message-ID: <1182046552.497487.90990@n60g2000hse.googlegroups.com>


On Jun 16, 3:27 pm, "pankaj_wolfhun..._at_yahoo.co.in" <pankaj_wolfhun..._at_yahoo.co.in> wrote:
> Greetings,
> I need to apply a group by in my query but not necessarily on all
> columns in select list.
>
> For eg:
>
> select col1, col2, col3, col4, col5
> from table_name
> group by col1, col2, col3, col4
>
> Now the requirement is to include all 5 columns but group by only
> first 4
>
> How can I achieve this? Any help would be appreciated.
>
> TIA
You will need some kind of aggregate function. You could use min(col5) here instead of just col5. Received on Sat Jun 16 2007 - 21:15:52 CDT

Original text of this message

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