Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQl Query Group By function
| I want the Customer Key with max clicks
Sorry did not understand:
select * from (
select c.cust_key, max(c.bllble_clk_cnt) bllble_clk_cnt,
max(bllble_clk_rev_amt) bllble_clk_rev_amt
from pfp_acct_dly_fct c where
time_key=TO_NUMBER(TO_CHAR(TRUNC(SYSDATE-1), 'YYYYMMDD'))
group by c.cust_key
order by 2 desc, 3 desc
)
where rownum = 1
/
Regards
Michel Cadot
Received on Thu Mar 08 2007 - 13:01:37 CST
![]() |
![]() |