日期:2014-05-16 浏览次数:20529 次
SNO SCORE NAME CATEGORY 1 23 语文 文科 1 34 政治 文科 1 3 物理 理科 1 4 数学 理科 1 33 化学 理科 2 3 体育 实践课
select *
from (select sno,
count(name) over(partition by sno) nameNum,
count(distinct category) over(partition by sno)categoryNum,
row_number() over(partition by sno order by score) rn
from ZZZ_TEST t)
where rn = 1
SNO NAMENUM CATEGORYNUM RN 1 5 2 1 2 1 1 1