日期:2014-05-17 浏览次数:20810 次
with t1 as
(
select 44198 id,1391 city_id,131 y_id,'loong' nam,9 icon from dual
union all
select 44198 id,1391 city_id,131 y_id,'loong' nam,14 icon from dual
union all
select 44444 id,1111 city_id,222 y_id,'loong' nam,4 icon from dual
union all
select 44444 id,1111 city_id,222 y_id,'loong' nam,1 icon from dual
)
select id,city_id,y_id,nam,icon
from
(
select t1.*,row_number() over(partition by id order by rownum) rn
from t1
)
where rn = 1
id city_id y_id nam icon
--------------------------------------------------
1 44198 1391 131 loong 9
2 44444 1111 222 loong 4