Samer HR Samer HR - 3 months ago 20
SQL Question

How many guests have made bookings in the month of March?

How can I calculate the amount of numbers and only those from the date of march for instance (24/03/2016, 29/03/2016 etc.)


Three things come to mind. First, I haven't seen a product that uses the @ symbol... it is usually the % symbol. Second you do need the AND keyword.

SELECT * FROM Room WHERE (Price < 200) AND (Types LIKE '%D%')

But that leads to the third thing. This query is going to pull anything that has a 'D' anywhere in the types field. If a new type is added later that happens to have a 'D' in the name you are going to suddenly get results you were not expecting. You may want to be more explicit in your condition...

SELECT * FROM Room WHERE (Price < 200) AND (Types LIKE '%Double%')

Obviously if your product really does use the '@' character then substitute it instead. For what its worth, I found this question that lists valid characters for several products and none of the products listed use @.