I'm having problems returning a 'TOP 10 Car parks' result set: -
I have a 'carparks' table with 2 fields: -
carpark_id (int)
name (varchar)
And a 'bookings' table with 3 fields: -
booking_id (int)
price (float)
carpark_id (int)
I need a query to return the top 10 car parks (based on the most occurences of carpark_id's in the 'bookings' table. In the returned result set, I need the carpark_id and name.
I've been struggling with this trying out group by, order by and limit, but with no success... any ideas?
Thanks,
James