> Message: 4
> Date: Tue, 7 Aug 2007 16:32:56 +0800
> From: " Tito Mari Francis Esca?o "
> <[EMAIL PROTECTED]>
> Subject: [plug] How to determine multiple copy of a
> PostgreSQL record
>       in SQL
> To: "Philippine Linux Users' Group (PLUG) Technical
> Discussion List"
>       <plug@lists.linux.org.ph>
> Message-ID:
> 
>
<[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> 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'.
> 

try doing:

   SELECT    firstname,lastname,count(*)
   FROM      <table>
   GROUP BY  firstname,lastname
   HAVING    count(*) >1

ludwig



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
plug@lists.linux.org.ph (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to