X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 205504753A1 for ; Sat, 1 Mar 2003 17:59:38 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 22149-08 for ; Sat, 1 Mar 2003 17:59:09 -0500 (EST) Received: from utahisp.com (mail.cyberwires.com [66.239.12.3]) by postgresql.org (Postfix) with ESMTP id 9FE72474E5C for ; Sat, 1 Mar 2003 17:59:08 -0500 (EST) Received: from chad [63.230.8.76] by utahisp.com (SMTPD32-7.14) id AAD615130332; Sat, 01 Mar 2003 15:57:26 -0700 Message-ID: <094f01c2e045$b9ff5980$32021aac@chad> From: "Chad Thompson" To: "Aaron Chu" , References: <96853212-4AA9-11D7-8F7C-000393017462@mac.com> Subject: Re: Beginner needs help Date: Sat, 1 Mar 2003 15:55:57 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Declude-Sender: chad@weblinkservices.com [63.230.8.76] X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/17 X-Sequence-Number: 12057 So, if I understand. You want a list of people whose surnames appear more than once? Something like select count(*), surname from mytable group by surname having count(*) > 1 This will show a unique list of all the surnames that appear more than 1 time. HTH Chad ----- Original Message ----- From: "Aaron Chu" To: Sent: Thursday, February 27, 2003 4:17 PM Subject: [SQL] Beginner needs help > Hi, > > I have a table which has a column of surnames (string) and I would like > to know how can I retrieve (SELECT) all the repeated surnames, i.e. > more than one person who has the same surname. > > Thanks. > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >