filtering out doubles

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

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-sql by date

  From Date Subject
Next Message David Delorme 2003-03-12 14:15:33 The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard
Previous Message Richard Huxton 2003-03-12 09:44:41 Re: Special characters in SQL queries