SELECT
create_time AS "time",
count(1) as value,
case when platform = 1 then 'metric_a'
when platform = 2 then 'metric_b'
else 'none'
END AS metric
FROM xxtable
group by metric
ORDER BY create_time
示例如下SELECT create_time AS "time", count(1) as value, case when platform = 1 then 'metric_a' when platform = 2 then 'metric_b' else 'none' END AS metricFROM xxtablegroup by metricORDER BY create_time生成如图如何调试如果自行写sql写错了,怎么办?到感叹号处点击