Home  >  Article  >  Database  >  MySQL多字段重复记录淘选

MySQL多字段重复记录淘选

WBOY
WBOYOriginal
2016-06-07 16:25:591113browse

MySQL多字段重复记录筛选 MySQL多字段重复记录筛选: select * from T_CELLID TC where (TC.MCC,TC.MNC,TC.LAC,TC.CELL,TC.LNG,TC.LAT) in (select MCC,MNC,LAC,CELL,LNG,LAT from T_CELLID group by MCC,MNC,LAC,CELL,LNG,LAT having count(*) 1) and TC.id

MySQL多字段重复记录筛选
MySQL多字段重复记录筛选:
select * from T_CELLID TC
where (TC.MCC,TC.MNC,TC.LAC,TC.CELL,TC.LNG,TC.LAT) in  (select MCC,MNC,LAC,CELL,LNG,LAT from T_CELLID group by MCC,MNC,LAC,CELL,LNG,LAT having count(*) > 1)
and TC.id not in (select min(id) from T_CELLID group by MCC,MNC,LAC,CELL,LNG,LAT having count(*)>1)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Apache Hive入门2Next article:Java操作MongoDB NoSQL数据库