Using COUNT in GROUP_CONCAT

前端 未结 5 1020
陌清茗
陌清茗 2021-02-19 12:04

This is my table:

  id  | fk_company
-------------------
  1   |     2    
  2   |     2    
  3   |     2    
  4   |     4    
  5   |     4    
  6   |     11          


        
5条回答
  •  滥情空心
    2021-02-19 12:40

    select GROUP_CONCAT(counts) 
       from (
          select count(id) counts from
              table group by fk_company
       );
    

提交回复
热议问题