语法: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);