Re: filtering out doubles with SELECT

Поиск
Список
Период
Сортировка
От Jules Alberts
Тема Re: filtering out doubles with SELECT
Дата
Msg-id 20030312111147.B52B41CB1A5@koshin.dsl.systemec.nl
обсуждение исходный текст
Ответ на filtering out doubles with SELECT  ("Jules Alberts" <jules.alberts@arbodienst-limburg.nl>)
Ответы Re: filtering out doubles with SELECT  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-novice
> I was wondering how to filter out double values (where "value" spans
> two columns COL1 and COL2) with a SELECT statement. If I have this
> table:
>
> COL1 |COL2 |COL3
> -----------------------------
> a    |b    |some value
> a    |b    |another value
> a    |c    |yet another value
>
> what would be the select statement to get this result:
>
> COL1 |COL2 |COL3
> -----------------------------
> a    |b    |some value
> a    |c    |yet another value

Sorry for answering myself, I already found it:

select * from tbl t1 where not exists (select * from tbl t2 where
t1.COL1=t2.COL1 and t1.COL2=t2.COL2 and t1.oid <> t2.oid)


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

Предыдущее
От: "Jules Alberts"
Дата:
Сообщение: filtering out doubles with SELECT
Следующее
От: Muhammad Shariq Muzaffar
Дата:
Сообщение: create function pl/pgsql c langauge