Re: Existential quantifier - Mailing list pgsql-sql

From Dag-Erling Smørgrav
Subject Re: Existential quantifier
Date
Msg-id 86vdiop1hu.fsf@ds4.des.no
Whole thread Raw
In response to Re: Existential quantifier  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: Existential quantifier  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Not at all tested as I don't have access to my db right now, but I think
> something like one of these would work:
>
> select fs.film.title, fs.film.year
>  from fs.film
>  where exists(select 1 from fs.star where fs.film.id = fs.star.film
>   and fs.star.last = 'Sheen');

Ah, that was exactly what I was looking for.

> select fs.film.title, fs.film.year
>  from fs.film
>  where fs.film.id in (select fs.star.film where fs.star.last = 'Sheen');

ITYM

select fs.film.title, fs.film.yearfrom fs.filmwhere fs.film.id in (  select fs.star.film from fs.star where
fs.star.last= 'Sheen'); 

(missing FROM)

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


pgsql-sql by date:

Previous
From: Dag-Erling Smørgrav
Date:
Subject: Re: Existential quantifier
Next
From: Stephan Szabo
Date:
Subject: Re: Existential quantifier