File tree Expand file tree Collapse file tree 6 files changed +26
-4
lines changed Expand file tree Collapse file tree 6 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ from(select *
30
30
where asceding .rnk = descending .rnk
31
31
and i1 .i_item_sk = asceding .item_sk
32
32
and i2 .i_item_sk = descending .item_sk
33
- order by asceding .rnk
33
+ order by asceding .rnk , best_performing, worst_performing
34
34
limit 100 ;
35
35
36
36
-- end query 1 in stream 0 using template ../query_templates/query44.tpl
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $avg_net_profit = (select avg(ss_net_profit) rank_col
11
11
select asceding .rnk , i1 .i_product_name best_performing, i2 .i_product_name worst_performing
12
12
from (select *
13
13
from (select item_sk,rank() over (order by rank_col asc ) rnk
14
- from (select ss_item_sk item_sk,$round(avg (ss_net_profit), - 2 ) rank_col
14
+ from (select ss_item_sk item_sk, $round(avg (ss_net_profit), - 2 ) rank_col
15
15
from {{store_sales}} ss1
16
16
where ss_store_sk = 4
17
17
group by ss_item_sk
@@ -20,7 +20,7 @@ from(select *
20
20
cross join
21
21
(select *
22
22
from (select item_sk,rank() over (order by rank_col desc ) rnk
23
- from (select ss_item_sk item_sk,$round(avg (ss_net_profit), - 2 ) rank_col
23
+ from (select ss_item_sk item_sk, $round(avg (ss_net_profit), - 2 ) rank_col
24
24
from {{store_sales}} ss1
25
25
where ss_store_sk = 4
26
26
group by ss_item_sk
@@ -32,7 +32,7 @@ from(select *
32
32
where asceding .rnk = descending .rnk
33
33
and i1 .i_item_sk = asceding .item_sk
34
34
and i2 .i_item_sk = descending .item_sk
35
- order by asceding .rnk
35
+ order by asceding .rnk , best_performing, worst_performing
36
36
limit 100 ;
37
37
38
38
-- end query 1 in stream 0 using template query44.tpl
Original file line number Diff line number Diff line change
1
+ asceding.rnk,best_performing,worst_performing
2
+ 1,"ablen stationesepri","pricallyantiation"
3
+ 1,"barableoughtcallyought","pricallyantiation"
4
+ 3,"ablecallyeingbarn stought","esen stbarablen st"
5
+ 3,"oughtationationcallyoughtought","esen stbarablen st"
6
+ 5,"n stantiationanti","barn steingableeseought"
7
+ 6,"ationantibarantieingought","barationantieingation"
8
+ 6,"eingn stationn stable","barationantieingation"
9
+ 8,"antiprieingantically","eseoughtpriationpri"
10
+ 8,"ationantioughteseanti","eseoughtpriationpri"
11
+ 8,"oughtn stationeseought","eseoughtpriationpri"
Original file line number Diff line number Diff line change
1
+ asceding.rnk,best_performing,worst_performing
2
+ 1,"prieingantibarese","ableationcallyese"
3
+ 2,"ationcallyn steseanti","eingcallyn stantianti"
4
+ 3,"oughtantiesecallyn st","priableeingbaranti"
5
+ 3,"oughtoughtableoughtpri","priableeingbaranti"
6
+ 5,"antibarationbarought","oughtbarn stcallyese"
7
+ 6,"ationn stablecallyese","callyablen stantieing"
8
+ 6,"n stationoughtcallyation","callyablen stantieing"
9
+ 8,"ableationationcallycally","ablecallypriantieing"
10
+ 8,"oughtn stbaroughtn st","ablecallypriantieing"
11
+ 10,"oughtcallyprioughteing","eingableoughtoughtese"
You can’t perform that action at this time.
0 commit comments