I have table with 3 columns.
- room_id
- date
- price
- availability
I needed a list of rooms with the total price within selected dates.
I could do that as follows:
SELECT SUM (price) from table WHERE date BETWEEN ( 01.08 13 AND 05.08.13 )
Now i need to have the following: in case the room was booked for 03.08.13
and in this case is column availability 0.
How can i implement this availability in this quer in order to exclude any room fron the result list if avalability on any of the dates between the chosen dates is 0 (null).
If i use only availability > 0, than i have price of all other dates where availability is greater than null, and i do not want that.