@@ -29,9 +29,24 @@ SELECT MAX(salary) AS max, MIN(salary) AS min FROM test_emp HAVING MIN(salary) >
29
29
aggWithoutAlias
30
30
SELECT MAX(salary) AS max FROM test_emp GROUP BY gender ORDER BY MAX(salary);
31
31
32
+ aggWithoutAliasWithLimit
33
+ SELECT MAX(salary) AS max FROM test_emp GROUP BY gender ORDER BY MAX(salary) LIMIT 3;
34
+
35
+ aggWithoutAliasWithLimitDesc
36
+ SELECT MAX(salary) AS max FROM test_emp GROUP BY gender ORDER BY MAX(salary) DESC LIMIT 3;
37
+
32
38
aggWithAlias
33
39
SELECT MAX(salary) AS m FROM test_emp GROUP BY gender ORDER BY m;
34
40
41
+ aggOrderByCountWithLimit
42
+ SELECT MAX(salary) AS max, COUNT(*) AS c FROM test_emp GROUP BY gender ORDER BY c LIMIT 3;
43
+
44
+ aggOrderByCountWithLimitDescAndGrouping
45
+ SELECT gender, COUNT(*) AS c FROM test_emp GROUP BY gender ORDER BY c DESC LIMIT 5;
46
+
47
+ aggOrderByCountWithLimitDesc
48
+ SELECT MAX(salary) AS max, COUNT(*) AS c FROM test_emp GROUP BY gender ORDER BY c DESC LIMIT 3;
49
+
35
50
multipleAggsThatGetRewrittenWithoutAlias
36
51
SELECT MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY gender ORDER BY MAX(salary);
37
52
@@ -56,12 +71,21 @@ SELECT MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c
56
71
aggNotSpecifiedInTheAggregateAndGroupWithHaving
57
72
SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY MAX(salary), gender;
58
73
74
+ aggNotSpecifiedInTheAggregateAndGroupWithHavingWithLimit
75
+ SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY MAX(salary), c LIMIT 5;
76
+
77
+ aggNotSpecifiedInTheAggregateAndGroupWithHavingWithLimitAndDirection
78
+ SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY MAX(salary) ASC, c DESC LIMIT 5;
79
+
59
80
groupAndAggNotSpecifiedInTheAggregateWithHaving
60
81
SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY gender, MAX(salary);
61
82
62
83
multipleAggsThatGetRewrittenWithAliasOnAMediumGroupBy
63
84
SELECT languages, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY languages ORDER BY max;
64
85
86
+ multipleAggsThatGetRewrittenWithAliasOnAMediumGroupByWithLimit
87
+ SELECT languages, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY languages ORDER BY max DESC LIMIT 5;
88
+
65
89
multipleAggsThatGetRewrittenWithAliasOnALargeGroupBy
66
90
SELECT emp_no, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY emp_no ORDER BY max;
67
91
0 commit comments