I'm using the LOAD DATA command to import a csv file.
I realize that on an indexed field, I have the option of either IGNORE or REPLACE on the load, but I need to be able to produce a list of which records (emails in this case) were duplicates.
We are in the process of converting to MySql from Access, and since MySql does not support nested select statements, the following code no longer works...
SELECT * FROM TABLE A
WHERE A.id <> 1
AND A.id <> (SELECT max(id) from TABLE)
AND id > (SELECT min(id) from TABLE B Where A.email = B.email AND B.id <> 1 AND B.id <> (SELECT max(id) from TABLE))
Anyone have a clue how I can do this efficiently???
I realize that on an indexed field, I have the option of either IGNORE or REPLACE on the load, but I need to be able to produce a list of which records (emails in this case) were duplicates.
We are in the process of converting to MySql from Access, and since MySql does not support nested select statements, the following code no longer works...
SELECT * FROM TABLE A
WHERE A.id <> 1
AND A.id <> (SELECT max(id) from TABLE)
AND id > (SELECT min(id) from TABLE B Where A.email = B.email AND B.id <> 1 AND B.id <> (SELECT max(id) from TABLE))
Anyone have a clue how I can do this efficiently???