首页 > 代码库 > mysql 结果集合切换

mysql 结果集合切换

结果集A:


转换成为结果集B:



mysql中实现如下:

SELECT 
		a.biz_date,
		CASE  WHEN a.`event` = 'downClick' THEN a.uv END AS  downClick,
		CASE  WHEN a.`event` = 'successClick' THEN a.uv END AS  successClick,
		CASE  WHEN a.`event` = 'installSuccess' THEN a.uv END AS  installSuccess
from a


mysql 结果集合切换