MongoDB查重:查詢proid_1
表的perio_id
的重復(fù)
db.getCollection('proid_1').aggregate([
{ $group: { _id : '$perio_id', count: { $sum : 1 } } },
{ $match: { count: { $gt : 1} } }
])
MySQL查重:查詢periodical_list_new
表的perio_id
的重復(fù)
select * from periodical_list_new where perio_id in (select perio_id from periodical_list_new group by perio_id having count(perio_id)>1);