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: how do I select in a group by if i want to handle stringsfunctions (first or last occurence)

Re: how do I select in a group by if i want to handle stringsfunctions (first or last occurence)

From: x <x_at_x.hr>
Date: Wed, 19 May 2004 12:16:13 +0200
Message-ID: <c8fc37$bp5$1@ls219.htnet.hr>


min(f3)?
max(f3)?

First occurence doesn't mean anything, since the data in table is not stored in any paticullar order.

<igse_at_bluewin.ch> wrote in message news:1084959456.876833_at_ftpgate...
> lets say I have table t with fields t.f1 varchar (10)
> t.f2 number
> t.f3
> varchar(10)
> t.f4
> varchar(10)
> t.f5 number
>
>
> I want to make a select like:
>
> select f1, avg(f2) ,f3 ,f4,max(f5) from t group by f1 ;
>
> This will not work because I would need to group this thing with f3 and f4
> too.
>
> But I want to just have the first occurence or last occurence of f3 resp.
f4
> and
> do not want to group having more than one entry in my results.
> What functions can I use to control f3 and f4 ?
> igse_at_bluewin.ch
>
>
Received on Wed May 19 2004 - 05:16:13 CDT

Original text of this message

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