pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Hagerty <matthew@venux.net>
To: pgsql-sql@postgreSQL.org
Subject: Query for duplicates.
Date: Thu, 05 Aug 1999 12:46:01 -0400
Message-ID: <4.1.19990805123926.009fcbf0@mail.venux.net> (raw)

Greetings,

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;


I know this does not work, but if it did it would have the results I am
looking for.

Thanks,
Matthew



view thread (3+ messages)  latest in thread

Message-ID: <4.1.19990805123926.009fcbf0@mail.venux.net>
Permalink:  ../4.1.19990805123926.009fcbf0@mail.venux.net/
Also on:    postgresql.org/message-id/4.1.19990805123926.009fcbf0@mail.venux.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: matthew@venux.net
  Subject: Re: Query for duplicates.
  In-Reply-To: <4.1.19990805123926.009fcbf0@mail.venux.net>
  References: <4.1.19990805123926.009fcbf0@mail.venux.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox