Received: from redbox.venux.net (redbox.venux.net [216.47.238.10]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA02881 for ; Thu, 5 Aug 1999 16:45:21 -0400 (EDT) (envelope-from matthew@venux.net) Received: from thunder (net177138.hcv.com [209.153.177.138]) by redbox.venux.net (Postfix) with SMTP id 8A2D72E20B; Thu, 5 Aug 1999 16:45:25 -0400 (EDT) Message-Id: <4.1.19990805164505.009d2830@mail.venux.net> X-Sender: mhagerty@mail.venux.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Thu, 05 Aug 1999 16:45:19 -0400 To: "John M. Flinchbaugh" , pgsql-sql@postgreSQL.org From: Matthew Hagerty Subject: Re: [SQL] Query for duplicates. In-Reply-To: References: <4.1.19990805123926.009fcbf0@mail.venux.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Thanks, that works great! Matthew At 04:19 PM 8/5/99 -0400, John M. Flinchbaugh wrote: >On Thu, 5 Aug 1999, Matthew Hagerty wrote: >> I found myself in an unusual situation today. I need a query to display >> only customers with addresses that appear more than once. Usually I am >> having to get unique addresses, etc. at which I have become very good, but >> this one is giving me a run for. >> What I need is something like this: >> create table customer ( >> custdate date, >> name varchar(30), >> address varchar(30), >> city varchar(20), >> state varchar(2), >> zip varchar(10)); >> select address,city,state,zip from customer >> where custdate<='05-30-1999' >> group by address having count(address)>1; > >select address,city,state,zip from customer >where custdate<='05-30-1999' >group by address,city,state,zip >having count(*)>1; > >____________________}John Flinchbaugh{______________________ >| -> glynis@hjsoft.com <- john@cs.millersv.edu | >| glynis@netrax.net http://www.hjsoft.com/~glynis/ | >~~Powered by Linux: Reboots are for hardware upgrades only~~ > >