日期:2014-05-17 浏览次数:20899 次
select t1.data_rank, wm_concat(t1.id) id
from (select id,
t.money,
case
when t.money >= 100 and t.money < 200 then
'100—200的数据'
when t.money >= 200 and t.money < 400 then
'200—400的数据'
when t.money >= 400 and t.money < 1000 then
'400—1000的数据'
else
'其他数据'
end data_rank
from test t) t1
group by t1.data_rank;
select t2.data_rank, LTRIM(MAX(SYS_CONNECT_BY_PATH(T2.id, ',')), ',')
from (select t1.id,
t1.data_rank,
row_number() over(partition by t1.data_rank order by t1.id) rn
from (select id,
&nbs