?
Try
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))
Or something like that. That's the idea. Probe it and tell us.
(May be the sintaxis it's not corr
On 10/08/2007 21:42, Scott Marlowe wrote:
Show us the query when you're done, I'm sure there are enough folks
who'd like to see your solution.
Here's what I came up with:
select distinct ip.person_id from items_for_people ip
where exists (
(
select item_id from items
where
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(*) = .
On 8/10/07, Raymond O'Donnell <[EMAIL PROTECTED]> wrote:
> On 10/08/2007 21:29, Scott Marlowe wrote:
>
>
> > select table1.id from table1 where table1.id is not in (select id from
> > table2);
>
> Duh! I should have thought of that thanks for that, and apologies
> for the stupidity (blame it o
On 10/08/2007 21:29, Scott Marlowe wrote:
select table1.id from table1 where table1.id is not in (select id from table2);
Duh! I should have thought of that thanks for that, and apologies
for the stupidity (blame it on the glass of wine I had with dinner!).
Ray.
--
On 8/10/07, Raymond O'Donnell <[EMAIL PROTECTED]> wrote:
> - how can I find those people who don't have _all_ of the items which
> are marked "required"?
>
> In other words, how do I select those rows in "people" which don't have
> a corresponding row in "items_for_people" for *each* row in "items"