MySQL Forums
Forum List  »  General

Re: Duplicate records - Show records that has same FIRSTNAME & LASTNAME
Posted by: Peter Brawley
Date: March 08, 2008 09:40AM

A simple way to find dupes is

SELECT lastname,firstname,COUNT(*) AS Count
FROM users
GROUP BY lastname,firstname
HAVING Count > 1;

A simple way to prevent name dupes is add a unique key(lastname,firstname).

PB
http://www.artfulsoftware.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Duplicate records - Show records that has same FIRSTNAME & LASTNAME
March 08, 2008 09:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.