Re: One to many query question

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re: One to many query question
Дата
Msg-id 3F28C878.EE2EB806@rodos.fzk.de
обсуждение исходный текст
Ответ на One to many query question  (Dave Dribin <dave-ml@dribin.org>)
Список pgsql-sql
>
> On Wed, Jul 30, 2003 at 05:26:23PM -0400, Dmitry Tkach wrote:
> > >How do I write a query to find all CDs that are NOT Rock?
> > >
> > What about
> > select * from cd where not exists (select 1 from cd_genres where
cd_id
> > = cd.id and genre='Rock')?
>
> Thanks everyone!  This did indeed work, and it does seem clearer.  I
> never knew about EXISTS before.  How portable is this?  I'm interested

> in supporting PostgreSQL and MS SQL Server for now, and possibly
> Oracle and MySQL in the future.
>
It should be portable completely. It's SQL standard.
Regards, Christoph




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: TODO item for plpgsql Was Re: obtuse plpgsql function needs
Следующее
От: Christoph Haller
Дата:
Сообщение: Re: NEW and a subselect in a rule