MongoDB查重:查询proid_1
表的perio_id
的重复
db.getCollection('proid_1').aggregate([
{ $group: { _id : '$perio_id', count: { $sum : 1 } } },
{ $match: { count: { $gt : 1} } }
])
MySQL查重:查询periodical_list_new
表的perio_id
的重复
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);
网友评论