Re: SQL question: checking all required items

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: SQL question: checking all required items
Дата
Msg-id 46BDFA3B.8000307@iol.ie
обсуждение исходный текст
Ответ на SQL question: checking all required items  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
On 10/08/2007 22:03, Carlos Ortíz wrote:

> Select * from people where person_id in (
>       Select person_ID from Items_for_people group by Person_id Having Count(*) = (
>            Select count(*) from Items Where is_required = true))

That seems to work fine! I'd only change "having count(*) = ..." to
"having count(*) >= ..." to allow for people having other items in
addition to the required ones.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

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

Предыдущее
От: Hannes Dorbath
Дата:
Сообщение: Re: Installing Postgresql 8.2 on Windows Vista
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: virtual database