How to query multiple data records in mysql select multiple data records to find out duplicate data records and prompt which days should be inserted into the database? solution ------------------ if you want to clear the table if the record is repeated, you can use INSERTINTO ..... SELECT ..... the statement is complete. Create a table with the same structure as the original table. use the preceding statement to query multiple data records of the original table in mysql.
How can I check multiple data entries in the select statement and tell me which days should I insert them into the database?
------ Solution --------------------
If you want to clear the duplicate records in the table, you can use the insert into... SELECT... statement to complete the operation.
Create a table with the same structure as the original table. use the preceding statement to insert all records of the original table to the new table. To create a new table, you must create a unique composite index. in this way, when you insert a table, the same record will be automatically skipped instead of inserted.
The SQL statement of the unique compound index is similar:
SQL code
Alter table 'mytable' add unique ('username', 'age ');