@@ -4,69 +4,69 @@ select *
44from
55 (select count (* ) h8_30_to_9
66 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
7- where ss_sold_time_sk = time_dim .t_time_sk
8- and ss_hdemo_sk = household_demographics .hd_demo_sk
7+ where ss_sold_time_sk = time_dim .t_time_sk
8+ and ss_hdemo_sk = household_demographics .hd_demo_sk
99 and ss_store_sk = s_store_sk
1010 and time_dim .t_hour = 8
1111 and time_dim .t_minute >= 30
12- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
13- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
14- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
12+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
13+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
14+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
1515 and store .s_store_name = ' ese' ) s1,
16- (select count (* ) h9_to_9_30
16+ (select count (* ) h9_to_9_30
1717 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
1818 where ss_sold_time_sk = time_dim .t_time_sk
1919 and ss_hdemo_sk = household_demographics .hd_demo_sk
20- and ss_store_sk = s_store_sk
21- and time_dim .t_hour = 9
20+ and ss_store_sk = s_store_sk
21+ and time_dim .t_hour = 9
2222 and time_dim .t_minute < 30
23- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
24- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
25- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
23+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
24+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
25+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
2626 and store .s_store_name = ' ese' ) s2,
27- (select count (* ) h9_30_to_10
27+ (select count (* ) h9_30_to_10
2828 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
2929 where ss_sold_time_sk = time_dim .t_time_sk
3030 and ss_hdemo_sk = household_demographics .hd_demo_sk
3131 and ss_store_sk = s_store_sk
3232 and time_dim .t_hour = 9
3333 and time_dim .t_minute >= 30
34- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
35- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
36- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
34+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
35+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
36+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
3737 and store .s_store_name = ' ese' ) s3,
3838 (select count (* ) h10_to_10_30
3939 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
4040 where ss_sold_time_sk = time_dim .t_time_sk
4141 and ss_hdemo_sk = household_demographics .hd_demo_sk
4242 and ss_store_sk = s_store_sk
43- and time_dim .t_hour = 10
43+ and time_dim .t_hour = 10
4444 and time_dim .t_minute < 30
45- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
46- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
47- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
45+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
46+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
47+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
4848 and store .s_store_name = ' ese' ) s4,
4949 (select count (* ) h10_30_to_11
5050 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
5151 where ss_sold_time_sk = time_dim .t_time_sk
5252 and ss_hdemo_sk = household_demographics .hd_demo_sk
5353 and ss_store_sk = s_store_sk
54- and time_dim .t_hour = 10
54+ and time_dim .t_hour = 10
5555 and time_dim .t_minute >= 30
56- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
57- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
58- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
56+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
57+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
58+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
5959 and store .s_store_name = ' ese' ) s5,
6060 (select count (* ) h11_to_11_30
6161 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
6262 where ss_sold_time_sk = time_dim .t_time_sk
6363 and ss_hdemo_sk = household_demographics .hd_demo_sk
64- and ss_store_sk = s_store_sk
64+ and ss_store_sk = s_store_sk
6565 and time_dim .t_hour = 11
6666 and time_dim .t_minute < 30
67- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
68- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
69- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
67+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
68+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
69+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
7070 and store .s_store_name = ' ese' ) s6,
7171 (select count (* ) h11_30_to_12
7272 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
7575 and ss_store_sk = s_store_sk
7676 and time_dim .t_hour = 11
7777 and time_dim .t_minute >= 30
78- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
79- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
80- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
78+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
79+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
80+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 3 + 2 ))
8181 and store .s_store_name = ' ese' ) s7,
8282 (select count (* ) h12_to_12_30
8383 from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
8686 and ss_store_sk = s_store_sk
8787 and time_dim .t_hour = 12
8888 and time_dim .t_minute < 30
89- and ((household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ) or
90- (household_demographics .hd_dep_count = 0 and household_demographics .hd_vehicle_count <= 0 + 2 ) or
91- (household_demographics .hd_dep_count = 1 and household_demographics .hd_vehicle_count <= 1 + 2 ))
89+ and ((household_demographics .hd_dep_count = 2 and household_demographics .hd_vehicle_count <= 2 + 2 ) or
90+ (household_demographics .hd_dep_count = 4 and household_demographics .hd_vehicle_count <= 4 + 2 ) or
91+ (household_demographics .hd_dep_count = 3 and household_demographics .hd_vehicle_count <= 3 + 2 ))
9292 and store .s_store_name = ' ese' ) s8
9393;
9494
0 commit comments