Query for duplicates.

Поиск
Список
Период
Сортировка
От Matthew Hagerty
Тема Query for duplicates.
Дата
Msg-id 4.1.19990805123926.009fcbf0@mail.venux.net
обсуждение исходный текст
Ответы Re: [SQL] Query for duplicates.  ("John M. Flinchbaugh" <glynis@butterfly.hjsoft.com>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] primary key view failure
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [SQL] primary key view failure