Recently, I have been sorting out the database of my website. The database is mysql. Because of the increasing access function, I imported access and reviewed the SQL. There are a lot of data, 0.15 million records, about 1 GB. The two fields a and B of some data are repeated, so that duplicate rows can be considered as duplicated data, as long as any row is retained. Simply put, the SQL statement should be written like this, "select distinct A, B from Table1;". Then, haha, it seems wrong. All fields are output. The correct statement should be written like this. "select * From Table1 where ID in (select Min (ID) from Table1 group by a, B);", get it, run it, and the result is correct, however, this process is slow. Execute "select Min (ID) from Table1 group by a, B" separately, store the data in a table, and create an index for the ID field. This process is much faster.