i have a table called Rides
id
car_id
distance
i have another table Cars
id
name
i want to run a query that return the most drives per car (on cars that i have rid greater than once)
so the results i am looking for are something like this (to be returned in descending order):
Ford 10
BMW 8
Ferrari 5
Jeep 4
I have:
select car_id, COUNT(car_id) as Cid
from Rides
group by car_id
order by cid desc
but i can't figure out how to eliminate items that are only 1 ride.