| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 
 | create database app;use app;
 
 CREATE TABLE user_active_day (`pc_active` Nullable(Int32), `app_active` Nullable(Int32), `wap_active` Nullable(Int32), `applet_active` Nullable(Int32), `total_active` Nullable(Int32), `day` Nullable(Date)) ENGINE = MergeTree PARTITION BY ifNull(toYYYYMM(day), 1970 - 1) ORDER BY ifNull(pc_active, 0)
 
 insert into user_active_day values(57935,79333,0,4,137272,'2019-09-17');
 insert into user_active_day values(55814,75298,0,0,131112,'2019-09-16');
 insert into user_active_day values(25486,57406,0,0,82892,'2019-09-15');
 insert into user_active_day values(20012,54274,0,0,74286,'2019-09-14');
 insert into user_active_day values(29490,91950,0,1,121441,'2019-09-13');
 insert into user_active_day values(71483,115066,1,4,186554,'2019-09-12');
 insert into user_active_day values(63010,91418,0,15,154443,'2019-09-11');
 insert into user_active_day values(66699,98543,0,13,165255,'2019-09-10');
 insert into user_active_day values(62377,90621,0,13,153011,'2019-09-09');
 insert into user_active_day values(28423,68287,0,10,96720,'2019-09-08');
 
 select * from user_active_day;
 
 |