Re: Re: Does PostgreSQL support EXISTS?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Re: Does PostgreSQL support EXISTS?
Дата
Msg-id 20010613122315.A30069@svana.org
обсуждение исходный текст
Ответ на Re: Does PostgreSQL support EXISTS?  (Nils Zonneveld <nils@mbit.nl>)
Ответы Re: Re: Does PostgreSQL support EXISTS?  (Michael Meskes <meskes@postgresql.org>)
RE: Re: Does PostgreSQL support EXISTS?  ("Erick Papadakis" <erick_papadakis@yahoo.com>)
Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wed, Jun 06, 2001 at 10:44:04PM +0200, Nils Zonneveld wrote:
>
>
> Raymond Chui wrote:
> >
> > The Subject says its all.
> >
>
> Yes 'exists' works (though I never understood the advantage to the 'in' operator).

On postgres at least, exists is faster than in.

They are equivalent though.

select x from a where v in (select v from b)
select x from a where exists (select 1 from b where a.v = b.v)
select x from a, b where a.v = b.v

are all the same. Postgres doesn't quite know that yet though.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Micallef
Дата:
Сообщение: Unix time stamp function?
Следующее
От: Zak McGregor
Дата:
Сообщение: OIDS in views