The problem is:
How many films were rented each month during 2005?
This is on a pre-made database for a film rental store.
I can get SQL to print out the dates and how many movies were rented each day. But how do I group those dates by month?
I.E. Instead of getting
Quote
Rental Date
5/24/2005
5/28/2005
5/30/2005
Films Rented
5/24/2005
8
5/28/2005
30
5/30/2005
45
I want it to appear like this
Quote
Rental Month
5
Films Rented
5
83
How can I group dates like that?
My current SQL query.
Quote
SELECT rent_date AS 'Rental Date', COUNT(rent_date) AS 'Films Rented'
FROM rental
GROUP BY rent_date
FROM rental
GROUP BY rent_date
rent_date in the table is the only information I can use as far as Dates go and they are listed by month/day/year.
I counted rent_date because the date is repeated in the table for every time a movie was rented.
I would prefer to display '5' as May and '6' as June but its not required.
(This may be easy for some of you but I'm fairly new to databases so bear with me)
None.