RE: Need a little query help

2002-10-29 Thread Anderson, Alan R
-Original Message- From: Chris Mason [mailto:masonc;masonc.com] [...] The problem is, it is easy to test for one amenity, but I need to test that the hotel has all of the amenities. The query above returns all the hotels that have ANY of the amenities, I need the hotels having ALL

Re: Need a little query help

2002-10-29 Thread Clemente
If you know the total number of amenities, n, then you could try this: SELECT h.ID, count(*) as total FROM AmenityLink al, Hotels h where al.HotelID=h.ID AND ShowHotel = 1 AND PostCode = '$postcode' group by h.ID having total=n Hope it helps. Cheers, Clemente Zamora GlobalReservas