Methods for deleting duplicate records (experiment description ):
1. The table stu contains 16 data records, including select rowid, xh, xm, sex, birthday, classid, and degree from stu.
Order by xh; 2. copy the data in the stu table into two copies for the experiment. After the experiment is copied, a total of 32 data entries are repeated, such. Insert into stu select * from stu;
3. for the same data, rowid is unique. Therefore, you can use rowid to delete duplicate data and group the same data. Only the smallest ROWID is retained. The SQL statement is as follows: delete from stu where ROWID not in (-- each of the same minimum ROWID
Select min (ROWID) from stu group by xh); after the SQL statement is executed, the query result is 16 original data records, for example:
4. If there are more than two duplicate data entries, the same applies.
Author: "To_Be_Monster_Of_IT"