X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0E486474E61 for ; Sat, 1 Mar 2003 19:10:30 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 59278-08 for ; Sat, 1 Mar 2003 19:10:02 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id BCCC3474E42 for ; Sat, 1 Mar 2003 19:10:01 -0500 (EST) Received: (qmail 17035 invoked by uid 500); 2 Mar 2003 00:23:48 -0000 Date: Sat, 1 Mar 2003 18:23:48 -0600 From: Bruno Wolff III To: Aaron Chu Cc: pgsql-sql@postgresql.org Subject: Re: Beginner needs help Message-ID: <20030302002348.GA16937@wolff.to> Mail-Followup-To: Aaron Chu , pgsql-sql@postgresql.org References: <96853212-4AA9-11D7-8F7C-000393017462@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96853212-4AA9-11D7-8F7C-000393017462@mac.com> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/18 X-Sequence-Number: 12058 On Thu, Feb 27, 2003 at 23:17:06 +0000, Aaron Chu wrote: > 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. select surname from whatevertable group by surname having count(*) > 1 order by surname;