SQL statement to delete a data table repeating field method, SQL statement
Everyone may encounter field duplication, many people on the web looking for methods, but also give some methods, but some methods are misleading, Optimus write the following methods to facilitate the use of everyone
1. Filter the duplicate fields through group by and create a temp table tmp
CREATE TABLE tmp as SELECT MAX (ID) as col1 from WWW Group by DFDFD;
2. To filter out column col1 that are not on the temporary table from a Deduplication object by using the not in condition to perform a delete operation of not in
3. Delete temporary tables
DROP table tmp;
Welcome to join the PHP technology and Workplace Exchange Group: 383730534
http://www.bkjia.com/PHPjc/952777.html www.bkjia.com true http://www.bkjia.com/PHPjc/952777.html techarticle SQL statement Delete data table repeating field method, SQL statement Everyone may encounter field duplication, many people on the web looking for methods, but also give some methods, but some methods are mistaken ...