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: rownum & group by question

Re: rownum & group by question

From: TheSpongebob <gastcom_at_sympatico.ca>
Date: 22 Mar 2006 08:26:08 -0800
Message-ID: <1143044768.491957.40240@z34g2000cwc.googlegroups.com>


select rownum,

        a.*

from

          (
          select
                   clt_id,
                   tx_ye_dt,
                   sum(jrsd_nia_amt) amt
          from     comp.mj_inc_al
          group by rownum,clt_id, tx_ye_dt, jrsd_cd
          having   clt_id = 15
          and      jrsd_cd = 9155
          order by tx_ye_dt desc
          ) a

where     rownum < 3


returns :

1	15	31/12/2004	4636
2	15	31/12/2003	5437
3	15	31/12/2002	14264


I can't do it ! Help !

I want to pivot, returning one row with first 2 years of data ...

1 15 31/12/2004 4636 5437 Received on Wed Mar 22 2006 - 10:26:08 CST

Original text of this message

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