Say I have two tables, 'cars' and 'properties', linked by table 'car_properties'. I can select all cars that have say, electric windows OR radios OR both, doing something like the following...
SELECT cars.id
FROM cars
JOIN car_properties
ON cars.id = car_properties.car_id
WHERE
car_properties.property_id = 1
OR car_properties.property_id = 2
where the property_id of 'electric windows' would be '1' and 'car radio' would be '2'.
BUT, what I really want to do is select ONLY cars that have BOTH properties (not just one or the other or both).
I suspect this is really simple, but what's the most efficient way to do it?