Re: Selecting exactly one row for each column value - Mailing list pgsql-sql

From Tom Lane
Subject Re: Selecting exactly one row for each column value
Date
Msg-id 4736.1173195155@sss.pgh.pa.us
Whole thread Raw
In response to Selecting exactly one row for each column value  (Florian Weimer <fweimer@bfk.de>)
Responses Re: Selecting exactly one row for each column value  (Florian Weimer <fweimer@bfk.de>)
List pgsql-sql
Florian Weimer <fweimer@bfk.de> writes:
> For each value in the first column, I need one (and only one) matching
> row from the table.  A possible solution is:

SELECT DISTINCT ON would do it, if you don't mind a non-portable solution.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Radhika Sambamurti"
Date:
Subject: [Fwd: View Vs. Table]
Next
From: "Rodrigo De León"
Date:
Subject: Re: Time of executed query