1
votes

I'm trying to find the 8 most common electric vehicles in King County. The following code gives me the correct results, but I also want it to display the Make and Model along with the count. I think this requires a subquery but I can't figure out how to write it.

SELECT COUNT(Model)
FROM electric_vehicle_population_data
WHERE County = 'King'
GROUP BY Model
ORDER BY COUNT(Model) DESC
LIMIT 8;
as we don't know anything about your table and the data please read meta.stackoverflow.com/questions/333952/… and add the missing informaton - nbk