I want to do something like this:
SELECT locations.id, places.id, scannables.id, SUM(scannables.available)
FROM `scannables`
INNER JOIN places ON scannables.place_id = places.id
INNER JOIN locations ON places.location_id = locations.id
WHERE locations.id = 2474 AND scannables.bookdate
BETWEEN '2009-08-27' and date_add('2009-08-27', INTERVAL 3 DAY)
AND SUM(scannables.available) >= 3
GROUP BY scannables.place_id
This works... except for the "AND SUM(scannables.available) >= 3"
I'm not sure how to get it to work,