SELECT
   auditor,sum(count) total,
    GROUP_CONCAT(type,'=', count) AS type_count
FROM
    auditor_dm_ol
WHERE created = 20190402 
GROUP BY
    auditor
UNION 
SELECT a.auditor ,SUM(a.total),GROUP_CONCAT(a.type,'=',a.total) from (
SELECT 'all' auditor ,type,sum(count) total FROM
    auditor_dm_ol
WHERE created = 20190402 
GROUP BY type
    )a  ORDER BY  total desc

展示要求

 mysql的group_concat列转行函数

数据结果

mysql的group_concat列转行函数

 

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2021-11-09
  • 2021-09-21
  • 2021-06-03
  • 2022-01-05
  • 2021-11-27
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-01-04
  • 2021-05-06
相关资源
相似解决方案