filtering out doubles with SELECT

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: filtering out doubles with SELECT
Date: 2003-03-12 10:07:25
Message-ID: 20030312100811.8F5171CB1A5@koshin.dsl.systemec.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello everyone,

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

I was thinking that DISTINCT would do this, but I don't want to loose
COL3. TIA for any tips!

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jules Alberts 2003-03-12 11:11:05 Re: filtering out doubles with SELECT
Previous Message Stephan Szabo 2003-03-12 07:34:42 Re: [SQL] SERIAL does not ROLLBACK