测试数据
SQL语句
select*from Table_1
where money in(select money from Table_1
group by money
having COUNT(money)>1)
order by money
结果
不知道你具体想要什么结果参考下吧
思路:给员工表emp起两个别名a,b 查询条件a的工资=b的工资
select a.*,b.*
from emp a,emp b
where a.sal=b.sal;
select * form 表 where 工资 in (select 工资 from 表 group by 工资 having count(1) > 1) order 工资
或者
select * from 工资表 as t1 where exists(select 1 from 工资表 where 工资=t1.工资 and 员工 !=t1.员工)
用group by 分组显示
自身表连接查询可以实现