Hi Guys,
I have one query that its is giving top 10 ranks but there is duplicate rank.
SELECT id
, l_count
, DENSE_RANK() OVER (ORDER BY l_count DESC) l_num_count
, name
, n.cn
, pa_number
, 'ACTIVE'
FROM ( SELECT l_id
, o_id
, p_number
, COUNT(ps_num) l_count
FROM queue
WHERE create_date > SYSDATE - 30
AND UPPER(req_type) IN
('MANU', 'AUTO')
AND ps_stat_code =100
GROUP BY l_id, o_id, p_number) c
, prod p
, fac f
, cn n
WHERE c.pa_number = p.p_number
AND f.l_id = c.o_id
AND n.l_id = c.l_id;
this query is giving duplicate ranks, if l_num_count is having duplicate, we need to consider create_date. I mean based on the latest date is first.
Can some one help me on this to get proper resulted ranks.
Rrgrds,
KLR