mysql查询一个表中name相同的记录
4 回答
人到中年有点甜
TA贡献1895条经验 获得超7个赞
select name,id,age from table_name where name in (select name from table_name group by name having count(*)>1) order by name;
select name from table_name group by name having count(*)>1用于列出所有 出现2次或2次以上的名字
慕尼黑的夜晚无繁华
TA贡献1864条经验 获得超6个赞
select * from 表 where n_id in
(select s_name from 表
group by s_name,n_money,s_zhipiao,s_date,s_lixi
having count(s_name)>1)
添加回答
举报
0/150
提交
取消