查询数据库中某一列有没有重复数据项:
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 )
本文提供了一种查询数据库中特定列是否存在重复数据的方法。通过构造特定的SQL语句,可以找出那些出现次数超过一次的数据项。
查询数据库中某一列有没有重复数据项:
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 )
转载于:https://www.cnblogs.com/bingege/p/8445142.html
2067

被折叠的 条评论
为什么被折叠?
