@@ -29,9 +29,24 @@ SELECT MAX(salary) AS max, MIN(salary) AS min FROM test_emp HAVING MIN(salary) >
2929aggWithoutAlias
3030SELECT MAX(salary) AS max FROM test_emp GROUP BY gender ORDER BY MAX(salary);
3131
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+
3238aggWithAlias
3339SELECT MAX(salary) AS m FROM test_emp GROUP BY gender ORDER BY m;
3440
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+
3550multipleAggsThatGetRewrittenWithoutAlias
3651SELECT MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY gender ORDER BY MAX(salary);
3752
@@ -56,12 +71,21 @@ SELECT MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c
5671aggNotSpecifiedInTheAggregateAndGroupWithHaving
5772SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY MAX(salary), gender;
5873
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+
5980groupAndAggNotSpecifiedInTheAggregateWithHaving
6081SELECT gender, MIN(salary) AS min, COUNT(*) AS c FROM test_emp GROUP BY gender HAVING c > 1 ORDER BY gender, MAX(salary);
6182
6283multipleAggsThatGetRewrittenWithAliasOnAMediumGroupBy
6384SELECT languages, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY languages ORDER BY max;
6485
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+
6589multipleAggsThatGetRewrittenWithAliasOnALargeGroupBy
6690SELECT emp_no, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY emp_no ORDER BY max;
6791
0 commit comments