From this SO POST Finding Duplicates, how can I delete duplicates.
SELECT firstname, lastname, list.address FROM list
INNER JOIN (SELECT address FROM list
GROUP BY address HAVING count(id) > 1) dup ON list.address = dup.address
From this SO POST Finding Duplicates, how can I delete duplicates.
SELECT firstname, lastname, list.address FROM list
INNER JOIN (SELECT address FROM list
GROUP BY address HAVING count(id) > 1) dup ON list.address = dup.address
just use the DISTINCT keyword:
SELECT DISTINCT firstname FROM list;
if any of the output is a duplicate, mysql will remove them.
for more documentation on DISTINCT go here:
http://www.cyberciti.biz/faq/howto-removing-eliminating-duplicates-from-a-mysql-table/