查重复的数据
select a,b,c,d,e,f
from a
group by a,b,c,d,e,f
having count(*)>1
正解~!~
在oracle 中剔重查数据sql
select a, b, c, d, e, f from (select a, b, c, d, e, f, row_number() over(partition by a,b,c,d,e,f order by rowid) rn
from a) t where rn = 1;
select max(a),max(b)等字段 from A
group by a,b,c,d
max 是聚合函数··
如果值是数字 建议换个聚合函数就行··
select a,b,c,d,e,f
from a
group by a,b,c,d,e,f
having count(*)>1
正解~!~
使用 degree字段分组查询,再 top 3
select top 3 degree,count(degree) as 人数
from student
group by degree
order by degree
select a,b,c,d,e,f
from a
group by a,b,c,d,e,f
having count(*)>1