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@xxxxxx --------------------------------------------------------------- ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend