在对数据进行排序中,只对符合条件的数据进行排序,但不符合条件的数据也要在显示出来
代码
select a.*,
DECODE(tj,
'1',
(RANK()
OVER(PARTITION BY a.sx ORDER BY DECODE(tj, '1', jd, '00') DESC)),
'')
from (select a.*,a.num+1 as jd from a) a
where sx='a'
order by jd desc