結果集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