I have a table where all services performed on several cars are saved. The key is the car license plate. A car can have more than one service a day. And for each service performed a new service id is created, even if it is for the same car.
I need to filter the 100 most frequent cars and I can not, therefore, it is inaccurate for saving an id for each service.
Ex: car aaa1234 on the days 01.02.02 made 3 kinds of services per day. car bbb4321 on days 01.02.03 did 1 type of service per day.
If I am right, in my query, it is accusing that the aaa1234 car is the most frequent one. Since I did not want to count by quantity of service, but by frequency.
I'm not very skilled with querys and I can not escape this scope:
SELECT count(placa), placa
FROM [producao].[dbo].[servicos_teste]
group by placa
order by COUNT(placa) DESC