sql根据某一个字段重复只取第一条数据
sql根据某一个字段重复只取第一条数据
日期:2019-09-03 10:04:45 人气:1
代码如下:
select * from tbl_DPImg where ID in (select min(ID) from tbl_DPImg group by DPID)处理后结果为:
查找表中多余的重复记录,重复记录是根据单个字段(teamId)来判断
select * from team where teamId in (select teamId from team group by teamId having count(teamId) > 1) 删除表中多余的重复记录,重复记录是根