1. 程式人生 > >查詢數據庫中某一列有沒有重復數據項

查詢數據庫中某一列有沒有重復數據項

pos div stock 查詢 blog sele having count 復數

查詢數據庫中某一列有沒有重復數據項:

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 )

查詢數據庫中某一列有沒有重復數據項