Order by COUNT per value

前端 未结 4 2116
时光说笑
时光说笑 2020-11-27 05:12

I have a table which stores IDs and the city where the store is located.

I want to list all the stores starting with the stores that are in the city where there are

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 05:30

    SELECT `FirstAddressLine4`, count(*) AS `Count` 
    FROM `leads` 
    WHERE `Status`='Yes'
    AND `broker_id`='0'
    GROUPBY `FirstAddressLine4` 
    ORDERBY `Count` DESC 
    LIMIT 0, 8
    

提交回复
热议问题