Re: Existential quantifier - Mailing list pgsql-sql

From Dag-Erling Smørgrav
Subject Re: Existential quantifier
Date
Msg-id 86zl80p1ro.fsf@ds4.des.no
Whole thread Raw
In response to Re: Existential quantifier  (Richard Albright <ralbright@insiderscore.com>)
List pgsql-sql
Richard Albright <ralbright@insiderscore.com> writes:
> you could use distinct on
>
> select distinct on (fs.film.title, fs.film.year ) title, year
> from fs.film left join fs.star on fs.film.id = fs.star.film
>   where fs.star.last = 'Sheen';

Thanks, I didn't know about "distinct on".  This version uses the
primary (surrogage) key:

select distinct on (fs.film.id) fs.film.title, fs.film.year from fs.film left join fs.star on fs.film.id = fs.star.film
wherefs.star.last = 'Sheen'; 

DES
--
Dag-Erling Smørgrav - des@des.no


pgsql-sql by date:

Previous
From: Richard Albright
Date:
Subject: Re: Existential quantifier
Next
From: Dag-Erling Smørgrav
Date:
Subject: Re: Existential quantifier