mysql数据库去重:
1) 如果要保留id最小的那一项:
DELETE n1 FROM tableName n1, tableName n2 WHERE n1.columnName = n2.columnName AND n1.id > n2.id;
2) 如果要保留id最大的那一项:
DELETE n1 FROM tableName n1, tableName n2 WHERE n1.columnName = n2.columnName AND n1.id < n2.id;
DELETE n1 FROM tableName n1, tableName n2 WHERE n1.columnName = n2.columnName AND n1.id > n2.id;
DELETE n1 FROM tableName n1, tableName n2 WHERE n1.columnName = n2.columnName AND n1.id < n2.id;