Customers rent cars, cars are grouped in different categories, 'A - D'
The following queries gets entered to display all vehicle groups rented throughout 2016.
SELECT car_group FROM rentals WHERE checkout_date BETWEEN '2016-01-01' AND '2016-12-30'
The output is as follows:
Now I could run the query and sort the groups via some PHP but I am sure it will be more efficient using a mysql statement...?
I know I can use SELECT count(car_group) as cars
but that will return the total sum of cars NOT the amount of different groups.
Any advise appreciated.