Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stuck With Analytic Function
<pankaj_wolfhunter_at_yahoo.co.in> a écrit dans le message de news: 1161152101.294926.7750_at_m7g2000cwm.googlegroups.com...
Michel Cadot wrote:
> <pankaj_wolfhunter_at_yahoo.co.in> a écrit dans le message de news: 1161075086.591935.160320_at_m73g2000cwd.googlegroups.com...
> > Use a DECODE/CASE in your ORDER BY clause to make RR/RK appear in first. > Use RANK() function instead of ROW_NUMBER() if you want a... rank. > It is useless to use a subquery. > > Regards > Michel Cadot
Thanks Michael.
Actually in my case ROW_NUMBER will work fine cause I just want to
assign sr.no's to group of records.
I'll be more glad if u can help me in preparing my DECODE function
here.
I am unable to construct the same.
I mean how can I make records with RR/RK to appear first in order and
then apply the ROW_NUMBER
analytic function on that?
"order by case when exec_name in ('RR','RK') then chr(0) else exec_name end" then RR and RK will always appears first.
What if you have RR and RK at the same time, or duplicate exec_name? This is why I think rank or dense_rank _may_ be better, depending on what rank value you want in these cases.
Regards
Michel Cadot
Received on Wed Oct 18 2006 - 10:50:49 CDT
![]() |
![]() |