1. 根据具体条件统计这批数据落到每组的数量 select to_char(TIMESTAMP, 'yyyy-mm-dd') column1, column2, column3, count(CASE WHEN DURATION<30*60 THEN 1 END) less30, count(CASE WHEN DURATION>=30*60 and DURATION<60*60*1000 THEN 1 END) more30less60, count(CASE WHEN DURATION>=60*60 and...
MERGE INTO user_tab1 t1USING (select to_char(TIMESTAMP, 'yyyy-mm-dd') daily, CLUSTERNAME, RESULT, count(*) usage from user_tab2 where to_char(TIMESTAMP, 'yyyy-mm-dd') in ('2019-09-03') group by to_char(TIMESTAMP, 'yyyy-mm-dd'), CLUSTERNAME, RESULT) t2on (t1.DAILY =...