[Essay★Tens of millions of mailboxes: more than 0.1 billion pieces of data are repeated by email field recently. What data? You know!

Source: Internet
Author: User

Recently, more than 0.1 billion pieces of data are repeated by email field. What data? You know!

More than 0.1 billion pieces of data are duplicated by email error, with more than 60 million remaining.

The following is an SQL statement. It is really not so fun to use a massive amount of data. A simple SQL statement will take a dozen minutes and take half an hour ....

Select min (ID) as ID into TMP from tbl_alluser group by email -- first de-duplicate by mail and then write the ID to the temporary table

Insert into tbl_alluser_new
Select username, email, source from tbl_alluser right join TMP on tbl_alluser.id = TMP. ID -- then write data to the new table by the ID in the temporary table

 Better SQL!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.