求MYSQL中某字段内的重复数据
发布网友
发布时间:2022-04-27 00:07
我来回答
共2个回答
热心网友
时间:2022-04-11 01:42
这样就能找出d_name重复的
select d_name
from tbl_vod
group by d_name having count(1) > 1
如果要所有记录
select *
from tbl_vod where d_name in (select d_name
from tbl_vod
group by d_name having count(1) > 1)追问#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select max(d_id) from tbl_vod group by d_name )' at line 4
热心网友
时间:2022-04-11 03:00
select d_name,count(d_name) from tbl_vod group by d_name having count(d_name)>1