This isn't Linux related.

The obvious answer would be, have a primary key on FirstName +
LastName to avoid duplicates in the first place.

Second answer, SELECT COUNT(*) FROM table WHERE FirstName = ? AND LastName = ?

If the result is >1 then congrats, you have a duplicate. Don't forget
to have indexes on FirstName and LastName.


On 8/7/07, Tito Mari Francis Escaño <[EMAIL PROTECTED]> wrote:
> Pls provide me pointers how to determine via SQL if a PostgreSQL
> record has a duplicate entry.
>
> For example, in a database, in record 1, there's firstname and
> lastname entry of 'Juan dela Cruz', and on record N, there's again
> firstname and lastname entry of 'Juan dela Cruz'.
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to