码迷,mamicode.com
首页 > 数据库 > 详细

查询数据库中某一列有没有重复数据项

时间:2018-02-12 20:15:26      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:重复数   where   group by   复数   sele   重复   div   pos   gpo   

查询数据库中某一列有没有重复数据项:

select * from cd_stock where stock_bh in (select stock_bh from cd_stock group by stock_bh having count(stock_bh) >1 )

select * from cd_stock_item where id in (select id from cd_stock_item group by id having count(id) >1 )

查询数据库中某一列有没有重复数据项

标签:重复数   where   group by   复数   sele   重复   div   pos   gpo   

原文地址:https://www.cnblogs.com/bingege/p/8445142.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!