查询一张表中有重复字段的记录

语法:select * from 表名 where (字段名) in  (select  字段名 from 表名 group by 字段名 having count(*) > 1);

如一下goods表:

执行sql语句:select * from  goods where inventory in (select inventory from goods group by inventory having count(*) > 1);

 

posted @ 2016-06-24 20:37  D蓝叶  阅读(417)  评论(0编辑  收藏  举报