1
1
aggSumWithColumnRepeatedWithOrderAsc
2
- SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY gender ORDER BY gender ;
2
+ SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY gender ORDER BY SUM(salary) ;
3
3
4
4
g:s | gender:s | s3:i | SUM(salary):i | s5:i
5
5
null |null |487605 |487605 |487605
@@ -8,7 +8,7 @@ M |M |2671054|2671054 |2671054
8
8
;
9
9
10
10
aggSumWithAliasWithColumnRepeatedWithOrderDesc
11
- SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY g ORDER BY g DESC;
11
+ SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY g ORDER BY s5 DESC;
12
12
13
13
g:s | gender:s | s3:i | SUM(salary):i | s5:i
14
14
M |M |2671054|2671054 |2671054
@@ -17,7 +17,7 @@ null |null |487605 |487605 |487605
17
17
;
18
18
19
19
aggSumWithNumericRefWithColumnRepeatedWithOrderDesc
20
- SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY 2 ORDER BY 2 DESC;
20
+ SELECT gender AS g, gender, SUM(salary) AS s3, SUM(salary), SUM(salary) AS s5 FROM test_emp GROUP BY 2 ORDER BY 3 DESC;
21
21
22
22
g:s | gender:s | s3:i | SUM(salary):i | s5:i
23
23
M |M |2671054|2671054 |2671054
0 commit comments