In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
mysql deduplicates data in two ways:
A field to uniquely identify a record, you can use the following SQL to delete:
delete glt_entity_tmp from glt_entity_tmp,(select idd from glt_entity_tmp group by nam having count(*) > 1 ) as t2
where glt_entity_tmp.idd=t2.idd
Note: idd in the data is inconsistent, and other field information is consistent. If there are more than 2 duplicate records in a nam, multiple executions are required.
Two, with two or more fields to uniquely determine a record, you can use the following SQL to delete, but note that each record must have a third field to uniquely determine this record (use max to delete)
delete gbi_pd_theme_new_tmp from gbi_pd_theme_new_tmp,(select new_code,the_code,max(the_new_code) as the_new_code from gbi_pd_theme_new_tmp group by new_code,the_code having count(*) > 1) as t2
where gbi_pd_theme_new_tmp.new_code=t2.new_code and gbi_pd_theme_new_tmp.the_code=t2.the_code and gbi_pd_theme_new_tmp.the_new_code=t2.the_new_code
Note: If there are more than 2 duplicate records, perform multiple times
Because each record in this example has a unique field, the_new_code, max can be used to remove duplicates
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.