I need a SQL code that shows me the best sellers but in the result show me which of the stores this official belongs to.
I can do the research to know which are the best sellers but I do not know to select from which store it is. Here is my code below:
select distinct co_operador, count(*) as qtidade_lib
from [dbo].[pistb002_liberacao_beneficio]
group by co_operador
order by "qtidade_lib" desc