I posted the concern since I have to determine duplicate entries in a database with approx 10K+ entries and I thought PLUG would provide me pointers since PostgreSQL is open source. I would highly appreciate somebody providing me help. Thanks!
On 8/7/07, Orlando Andico <[EMAIL PROTECTED]> wrote: > 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 > -- Tito Mari Francis H. Escaño Computer Engineer and Free Software Proponent _________________________________________________ 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

