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

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

From: <igse_at_bluewin.ch>
Date: Wed, 19 May 2004 11:37:39 +0200
Message-ID: <1084959456.876833@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 - 04:37:39 CDT

Original text of this message

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