hash-threshold 8

statement ok
CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER)

statement ok
CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER)

statement ok
CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER)

statement ok
INSERT INTO tab0 VALUES(83,0,38)

statement ok
INSERT INTO tab0 VALUES(26,0,79)

statement ok
INSERT INTO tab0 VALUES(43,81,24)

statement ok
INSERT INTO tab1 VALUES(22,6,8)

statement ok
INSERT INTO tab1 VALUES(28,57,45)

statement ok
INSERT INTO tab1 VALUES(82,44,71)

statement ok
INSERT INTO tab2 VALUES(15,61,87)

statement ok
INSERT INTO tab2 VALUES(91,59,79)

statement ok
INSERT INTO tab2 VALUES(92,41,58)

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT CASE + col2 WHEN 61 THEN NULL ELSE + col2 * - + 95 * + 29 END col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT + col1 - + ( col1 ) FROM tab2 GROUP BY col1
----
0

query I rowsort
SELECT - 0 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 + + - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT + col1 * + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND - + 90 + - col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6
SELECT - col0 * - - col2 * + col2 DIV - col2 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
1032
2054
3154

skipif mysql # not compatible
query I rowsort label-6
SELECT - col0 * - - col2 * + col2 / - col2 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
1032
2054
3154

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 + - col2 col0 FROM tab1 AS cor0 WHERE NOT ( NULL BETWEEN + 93 * + col0 + + + col1 + + col2 * - col0 + col1 * + 74 AND col0 + 11 * col0 ) GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT - 48 * - 90 IN ( + + 87 ) GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + 89 + col2 FROM tab1 GROUP BY col2
----
134
160
97

onlyif mysql # DIV for integer division: 
query I rowsort label-10
SELECT + col1 DIV ( - col1 ) - - col1 FROM tab2 GROUP BY col1, col2, col1
----
40
58
60

skipif mysql # not compatible
query I rowsort label-10
SELECT + col1 / ( - col1 ) - - col1 FROM tab2 GROUP BY col1, col2, col1
----
40
58
60

query I rowsort
SELECT + 19 * - col0 * + 51 FROM tab0 GROUP BY col0, col0
----
-25194
-41667
-80427

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 GROUP BY col2, col1 HAVING - - col2 * - col2 + 92 IS NOT NULL
----
45
71
8

query I rowsort
SELECT col0 - 72 AS col2 FROM tab2 AS cor0 WHERE ( 73 - col1 ) BETWEEN - 44 AND + col2 GROUP BY col0
----
-57
19
20

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-81
0
0

query I rowsort
SELECT ALL - COALESCE ( - col0, col0 ) AS col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT - 98 AS col1 FROM tab0 GROUP BY col0, col2
----
-98
-98
-98

query I rowsort
SELECT DISTINCT 92 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 + ( col1 ) / + col1 AS col2 FROM tab2 WHERE NOT NULL = NULL GROUP BY col1, col1, col2 HAVING NULL NOT IN ( 33 )
----

query I rowsort
SELECT ALL + 41 AS col0 FROM tab0 GROUP BY col1
----
41
41

query I rowsort
SELECT - col0 + 19 * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 + 78 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
119
137
139

query I rowsort
SELECT + + 54 * col0 + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + 10 FROM tab2 AS cor0 GROUP BY col0 HAVING ( 8 ) <= 19
----
10
10
10

query I rowsort
SELECT - 64 FROM tab2 AS cor0 WHERE NOT ( + col2 * + 38 ) IS NULL GROUP BY col2
----
-64
-64
-64

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-26
-43
-83

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING - col1 NOT BETWEEN col2 AND 73
----
58
79
87

query I rowsort
SELECT - 95 FROM tab0 GROUP BY col2, col0, col0
----
-95
-95
-95

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2, - col2 * - ( - 29 ) col0 FROM tab0 GROUP BY col2
----
24
-696
38
-1102
79
-2291

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-30
SELECT DISTINCT - CAST( + - CAST( + 0 AS SIGNED ) AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
0

skipif mysql # not compatible
query I rowsort label-30
SELECT DISTINCT - CAST ( + - CAST ( + 0 AS INTEGER ) AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
0

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab0 GROUP BY col0, col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL col2 / + + col2 + + col2 + col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL col0 + + 76 AS col2 FROM tab0 GROUP BY col0, col2
----
102
119
159

query II rowsort
SELECT ALL + 27 + - col1 AS col0, - col2 - - col1 FROM tab0 GROUP BY col1, col2 HAVING ( - 47 ) IS NOT NULL
----
-54
57
27
-38
27
-79

query I rowsort
SELECT DISTINCT - 24 - 6 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-30

query I rowsort
SELECT - ( + col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL 9 + - - 0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - 31 * col0 NOT BETWEEN ( NULL ) AND col2 * - col0
----
9
9
9

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col1 + 26 AS col1 FROM tab2 GROUP BY col1
----
67
85
87

query I rowsort
SELECT - - col0 * - 23 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-2002
-2024
-330

query I rowsort
SELECT - col0 - - 27 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-2296
-616
-784

query I rowsort
SELECT ALL col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col0 + - - col0 * - - 64 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1638
2709
5229

query II rowsort
SELECT col1 + ( - - col1 ) * + 97 * - col1 AS col2, col1 FROM tab0 GROUP BY col1 HAVING NULL < ( NULL )
----

query I rowsort
SELECT - 67 FROM tab1 GROUP BY col0, col2
----
-67
-67
-67

query II rowsort
SELECT DISTINCT col0 AS col0, - col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + 22 FROM tab0 GROUP BY col0
----
22
22
22

query I rowsort
SELECT DISTINCT col2 + 21 + + + col2 * + col2 + + col2 FROM tab2 GROUP BY col2
----
3501
6420
7764

query I rowsort
SELECT ALL col1 * - col1 FROM tab2 cor0 GROUP BY col0, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - 79 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-79

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-52
SELECT ALL + COALESCE ( + 23, - col2 DIV - 95 ) FROM tab2 WHERE NOT 84 IS NULL GROUP BY col2
----
23
23
23

skipif mysql # not compatible
query I rowsort label-52
SELECT ALL + COALESCE ( + 23, - col2 / - 95 ) FROM tab2 WHERE NOT 84 IS NULL GROUP BY col2
----
23
23
23

query I rowsort
SELECT DISTINCT - ( 98 ) AS col0 FROM tab2 GROUP BY col1, col0 HAVING ( + col0 ) BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT col0 + + 1 - - - 57 FROM tab1 GROUP BY col0
----
-28
-34
26

query II rowsort
SELECT ALL - 88 * col1 * + - col1, col1 AS col1 FROM tab1 GROUP BY col1
----
170368
44
285912
57
3168
6

query I rowsort
SELECT ALL 43 AS col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
43
43
43

query I rowsort
SELECT NULLIF ( col2, - col2 ) AS col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 + - + ( - 41 ) - - - col1 col1, 7 FROM tab1 cor0 GROUP BY col2, col1
----
29
7
43
7
68
7

query I rowsort
SELECT - + 54 FROM tab2 AS cor0 GROUP BY col1, col2
----
-54
-54
-54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( + col0 ) * 14 / - col0 col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * - + 67 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
-5384
26
83

query I rowsort
SELECT DISTINCT - NULLIF ( + 29, - AVG ( ALL - 49 ) ) FROM tab1 cor0 GROUP BY col0
----
-29

query I rowsort
SELECT DISTINCT - 15 * col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-1065
-120
-675

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-65
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col1, col1, col2 HAVING NOT - col2 > CAST( + 20 AS SIGNED )
----
41
59
61

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-65
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col1, col1, col2 HAVING NOT - col2 > CAST ( + 20 AS INTEGER )
----
41
59
61

query I rowsort
SELECT - col1 * 80 * col1 AS col1 FROM tab2 GROUP BY col1, col0
----
-134480
-278480
-297680

query I rowsort
SELECT + ( - col1 ) FROM tab1 GROUP BY col1, col2 HAVING - 6 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL <= + col1 GROUP BY col1
----

query II rowsort
SELECT - col2 - + 6 + col0 AS col2, 86 AS col0 FROM tab2 GROUP BY col2, col0
----
-78
86
28
86
6
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-70
SELECT ALL + + 67 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL = + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-70
SELECT ALL + + 67 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL = + CAST ( NULL AS INTEGER )
----

query II rowsort
SELECT DISTINCT - 44 + - col1 + + col1, - col1 + - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-44
-6642
-44
0

query I rowsort
SELECT ALL - 1 FROM tab2 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT + - col1 * - - col1 + - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-38
-6585
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-74
SELECT ( col0 ) DIV - - col0 + - col2 col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-57
-78
-86

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-74
SELECT ( col0 ) / - - col0 + - col2 col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-57
-78
-86

query I rowsort
SELECT - col2 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL 11 * col2 + - 90 - + 86 * - col2 FROM tab1 GROUP BY col2
----
4275
6797
686

query I rowsort
SELECT ALL col0 * + + 94 + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
2090
2660
7790

query I rowsort
SELECT + col2 - + col1 FROM tab0 GROUP BY col2, col1
----
-57
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL > + 72
----

query I rowsort
SELECT + 65 + + 92 FROM tab1 AS cor0 GROUP BY col2, col2
----
157
157
157

query I rowsort
SELECT 93 * + - col0 AS col2 FROM tab0 GROUP BY col0
----
-2418
-3999
-7719

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-82
SELECT DISTINCT + + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-82
SELECT DISTINCT + + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT ALL - ( + col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - - col1 IS NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 + col0 + + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
129
249
78

query I rowsort
SELECT - + col2 * + 46 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NULL >= + col2
----

query I rowsort
SELECT 34 AS col1 FROM tab1 GROUP BY col2, col0, col1
----
34
34
34

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT + + 8 * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
352
456
48

query I rowsort
SELECT DISTINCT - 53 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
-53

query II rowsort
SELECT ALL col1 AS col0, - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
-26
0
-83
81
-43

query I rowsort
SELECT DISTINCT - 66 - - 18 AS col1 FROM tab1 GROUP BY col0 HAVING NOT - 8 IS NULL
----
-48

query I rowsort
SELECT 88 FROM tab0 GROUP BY col1
----
88
88

query I rowsort
SELECT - + 17 FROM tab0 AS cor0 GROUP BY col0
----
-17
-17
-17

query I rowsort
SELECT - col1 + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
17
20
26

query I rowsort
SELECT ALL - 54 * 34 + - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-1894
-1915
-1923

query I rowsort
SELECT DISTINCT col1 * + + 56 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
4536

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-97
SELECT DISTINCT - col0 * CAST( NULL AS SIGNED ) AS col1 FROM tab1 WHERE NOT - col0 + 57 NOT IN ( + 52, col2 - col1 ) AND - col1 IS NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-97
SELECT DISTINCT - col0 * CAST ( NULL AS INTEGER ) AS col1 FROM tab1 WHERE NOT - col0 + 57 NOT IN ( + 52, col2 - col1 ) AND - col1 IS NULL GROUP BY col0
----

query II rowsort
SELECT col1 AS col1, 19 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
41
19
59
19
61
19

query I rowsort
SELECT DISTINCT - 75 * + col0 + - col0 AS col0 FROM tab2 GROUP BY col2, col0
----
-1140
-6916
-6992

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING - ( - 56 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-101
SELECT CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-101
SELECT CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-102
SELECT ALL + col0 * col0 DIV + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-102
SELECT ALL + col0 * col0 / + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query II rowsort
SELECT 19 AS col0, - col1 FROM tab1 GROUP BY col1
----
19
-44
19
-57
19
-6

query I rowsort
SELECT + col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING + 93 IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT + 49 FROM tab1 AS cor0 GROUP BY col1, col0
----
49

query II rowsort
SELECT DISTINCT - 21 * - - col1, col1 AS col0 FROM tab0 GROUP BY col1
----
-1701
81
0
0

query I rowsort
SELECT DISTINCT + 83 FROM tab1 AS cor0 GROUP BY col0, col0
----
83

query I rowsort
SELECT DISTINCT + 87 * + ( - 2 ) - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-196
-202
-256

query I rowsort
SELECT DISTINCT - 83 AS col0 FROM tab2 GROUP BY col0, col0
----
-83

query I rowsort
SELECT ALL + + col0 - - col0 * col0 * - col0 FROM tab2 cor0 GROUP BY col0
----
-3360
-753480
-778596

query I rowsort
SELECT ALL + 85 FROM tab2 cor0 WHERE NULL > 11 / - col0 * + - 19 GROUP BY col1, col0
----

query I rowsort
SELECT 10 FROM tab2 AS cor0 GROUP BY col1, col0
----
10
10
10

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-113
SELECT ALL - - 46 * CAST( NULL AS DECIMAL ) * + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-113
SELECT ALL - - 46 * CAST ( NULL AS REAL ) * + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT + col0 * - col0 + - col0 AS col1, + col0 - col0 AS col1 FROM tab1 GROUP BY col0
----
-506
0
-6806
0
-812
0

query I rowsort
SELECT ALL - col2 * col2 AS col0 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col2 + + + 90 FROM tab1 WHERE NOT + ( + col0 ) IS NULL GROUP BY col2
----
135
161
98

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-117
SELECT ALL + COALESCE ( + CAST( + ( - col0 ) AS SIGNED ), + - col0 ) - col0 AS col0, - 53 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-166
-53
-52
-53
-86
-53

skipif mysql # not compatible
query II rowsort label-117
SELECT ALL + COALESCE ( + CAST ( + ( - col0 ) AS INTEGER ), + - col0 ) - col0 AS col0, - 53 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-166
-53
-52
-53
-86
-53

query I rowsort
SELECT col1 * + 81 FROM tab1 GROUP BY col1, col0 HAVING ( + - ( 11 ) * + 85 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 69 col0 FROM tab2 GROUP BY col1, col2 HAVING - ( - col1 ) >= NULL
----

query I rowsort
SELECT ( - + col2 ) - + col2 FROM tab2 GROUP BY col2, col0
----
-116
-158
-174

query I rowsort
SELECT ALL col0 FROM tab2 WHERE NULL < - col0 * + col2 - + 13 GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col2, col1, col1 HAVING NOT + 88 IS NULL
----
0
81

query I rowsort
SELECT DISTINCT 85 FROM tab1 WHERE NOT + 84 < - + 69 GROUP BY col0, col0
----
85

query I rowsort
SELECT ALL 49 + 41 AS col2 FROM tab1 GROUP BY col2, col0
----
90
90
90

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query II rowsort
SELECT col0, + 44 FROM tab2 AS cor0 GROUP BY col0
----
15
44
91
44
92
44

query I rowsort
SELECT ALL + - 97 FROM tab0 AS cor0 GROUP BY col0, col0
----
-97
-97
-97

query I rowsort
SELECT + 43 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
43
43
43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-129
SELECT ALL 95 * + - CAST( + 75 AS SIGNED ) FROM tab0 cor0 GROUP BY col1
----
-7125
-7125

skipif mysql # not compatible
query I rowsort label-129
SELECT ALL 95 * + - CAST ( + 75 AS INTEGER ) FROM tab0 cor0 GROUP BY col1
----
-7125
-7125

query I rowsort
SELECT DISTINCT - col2 * col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL > 95 * + 96
----

query I rowsort
SELECT ALL - 50 FROM tab0 GROUP BY col0
----
-50
-50
-50

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-132
SELECT - COALESCE ( ( + col2 ), + CAST( NULL AS SIGNED ) * ( + 14 ), 7 ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-132
SELECT - COALESCE ( ( + col2 ), + CAST ( NULL AS INTEGER ) * ( + 14 ), 7 ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( - 64 ) IS NULL
----
45
71
8

query I rowsort
SELECT col1 * 5 FROM tab0 GROUP BY col0, col1
----
0
0
405

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-136
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-136
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 93 FROM tab2 GROUP BY col0 HAVING ( + 73 + + AVG ( + col0 ) ) IS NULL
----

query I rowsort
SELECT DISTINCT 65 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN + AVG ( 8 ) AND NULL
----

query I rowsort
SELECT ALL col1 + 33 FROM tab2 GROUP BY col1
----
74
92
94

query I rowsort
SELECT DISTINCT + col2 + - 12 FROM tab2 GROUP BY col2
----
46
67
75

query I rowsort
SELECT - col1 + + col1 FROM tab1 GROUP BY col1 HAVING NOT - 63 + - 26 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col2 HAVING NOT + 85 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 35 + col2 * + 96 AS col0 FROM tab0 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT - 19 AS col1 FROM tab1 GROUP BY col0
----
-19
-19
-19

query I rowsort
SELECT DISTINCT - col2 * - col2 + col2 * 58 FROM tab2 GROUP BY col2
----
10823
12615
6728

query I rowsort
SELECT DISTINCT + 44 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query I rowsort
SELECT - ( col1 ) AS col0 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + 24 * + + col0 + + col0 / + 6 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab1 WHERE + 17 + + + 96 IS NULL GROUP BY col2, col2 HAVING NOT col2 IS NULL
----

query II rowsort
SELECT 70 AS col0, 76 AS col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + 32 * + col2 * + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
18432
199712
46208

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT - 34 AS col1 FROM tab2 GROUP BY col2, col0
----
-34
-34
-34

query I rowsort
SELECT + + 45 FROM tab0 AS cor0 GROUP BY col0, col0
----
45
45
45

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + COALESCE ( - col1, col0 ) + - - 50 FROM tab2 cor0 GROUP BY col1, col0
----
-11
-9
9

query I rowsort
SELECT ALL - - col1 + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT + + col2 FROM tab2 WHERE NOT ( - 1 ) IS NULL GROUP BY col2 HAVING NOT + 60 IS NULL
----
58
79
87

query I rowsort
SELECT ALL + col0 + - 29 AS col1 FROM tab1 GROUP BY col0
----
-1
-7
53

onlyif mysql # DIV for integer division: 
query I rowsort label-161
SELECT - 26 DIV 95 - - col2 * 59 - - - 43 FROM tab2 GROUP BY col2, col0
----
3379
4618
5090

skipif mysql # not compatible
query I rowsort label-161
SELECT - 26 / 95 - - col2 * 59 - - - 43 FROM tab2 GROUP BY col2, col0
----
3379
4618
5090

query II rowsort
SELECT - 25, - col1 * + - 42 AS col1 FROM tab2 GROUP BY col1
----
-25
1722
-25
2478
-25
2562

query I rowsort
SELECT ALL 61 FROM tab1 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col1
----

query II rowsort
SELECT DISTINCT + col0 AS col0, - col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT + + col2 / + - ( + - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 62 * + 36 FROM tab1 cor0 GROUP BY col2, col2
----
2232

query I rowsort
SELECT 68 + col1 FROM tab2 GROUP BY col2, col1
----
109
127
129

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT 58 - + col0 AS col0 FROM tab0 GROUP BY col0
----
-25
15
32

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-170
SELECT ALL - 75 + CAST( - 81 AS SIGNED ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
-156
-156
-156

skipif mysql # not compatible
query I rowsort label-170
SELECT ALL - 75 + CAST ( - 81 AS INTEGER ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
-156
-156
-156

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-171
SELECT + 24 * 9 * + - CAST( NULL AS SIGNED ) col2 FROM tab1 cor0 GROUP BY col0 HAVING - 30 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-171
SELECT + 24 * 9 * + - CAST ( NULL AS INTEGER ) col2 FROM tab1 cor0 GROUP BY col0 HAVING - 30 IS NULL
----

query I rowsort
SELECT ALL 33 + + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
115
55
61

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-173
SELECT - + col0 * + - CAST( NULL AS SIGNED ) / + col0 / - - col0, + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-173
SELECT - + col0 * + - CAST ( NULL AS INTEGER ) / + col0 / - - col0, + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
22
NULL
28
NULL
82

query I rowsort
SELECT 72 FROM tab0 GROUP BY col2, col0
----
72
72
72

query I rowsort
SELECT ALL col0 * col0 AS col2 FROM tab2 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - ( col1 ) FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
-41
-59
-61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-178
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL NOT IN ( + + 93, + ( 31 ) )
----

skipif mysql # not compatible
query I rowsort label-178
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL NOT IN ( + + 93, + ( 31 ) )
----

query I rowsort
SELECT col2 * col2 * + col2 AS col2 FROM tab1 GROUP BY col2
----
357911
512
91125

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-180
SELECT DISTINCT + - CAST( + - 46 AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
46

skipif mysql # not compatible
query I rowsort label-180
SELECT DISTINCT + - CAST ( + - 46 AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
46

query I rowsort
SELECT - 89 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-89
-89
-89

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + AVG ( ALL + NULLIF ( - + col1, + col2 + - + col0 + - col1 ) ) * + + 48 AS col2 FROM tab2 GROUP BY col1, col1 HAVING + 22 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-185
SELECT DISTINCT - 32 DIV 94 AS col1 FROM tab1 GROUP BY col1, col1
----
0

skipif mysql # not compatible
query I rowsort label-185
SELECT DISTINCT - 32 / 94 AS col1 FROM tab1 GROUP BY col1, col1
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-186
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-186
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1, col1
----
NULL

query I rowsort
SELECT ALL ( + col2 ) * - col2 AS col2 FROM tab0 WHERE NOT - col0 IS NULL GROUP BY col2
----
-1444
-576
-6241

query II rowsort
SELECT DISTINCT 51, col1 + + col1 AS col0 FROM tab2 GROUP BY col1
----
51
118
51
122
51
82

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING + 59 IS NULL
----

query II rowsort
SELECT col0 AS col0, col0 * + col0 AS col0 FROM tab1 GROUP BY col1, col0
----
22
484
28
784
82
6724

query I rowsort
SELECT ALL - col1 * - 32 AS col2 FROM tab1 GROUP BY col1, col2
----
1408
1824
192

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-192
SELECT - CAST( + + col1 AS SIGNED ) AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-192
SELECT - CAST ( + + col1 AS INTEGER ) AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL + 6 FROM tab1 WHERE NOT col2 - + col0 + 62 NOT IN ( + 70 ) GROUP BY col0
----

query I rowsort
SELECT + 34 + + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
125
126
49

query I rowsort
SELECT DISTINCT 44 AS col1 FROM tab1 GROUP BY col0, col2
----
44

query I rowsort
SELECT - - 71 FROM tab2 AS cor0 GROUP BY col0
----
71
71
71

query I rowsort
SELECT ALL - 48 / col0 FROM tab2 cor0 WHERE NOT - col1 <= + col0 - - col1 GROUP BY col0, col0, col2 HAVING NOT - - col2 <= - ( 16 ) + col0
----

query I rowsort
SELECT ALL + 53 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
53
53
53

query I rowsort
SELECT + 67 FROM tab1 AS cor0 GROUP BY col0
----
67
67
67

query I rowsort
SELECT DISTINCT 16 FROM tab0 GROUP BY col0
----
16

query I rowsort
SELECT ( + col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 33 + - col0 - + - col1 col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-18
1
79

query II rowsort
SELECT DISTINCT col1 * - + 78 * - 87 AS col2, col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT 78 <= NULL
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT ALL + 77 AS col1 FROM tab1 GROUP BY col0, col1
----
77
77
77

query I rowsort
SELECT ALL + col0 * - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2, col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-209
SELECT CAST( - ( + 53 ) AS SIGNED ) FROM tab2 GROUP BY col2, col2
----
-53
-53
-53

skipif mysql # not compatible
query I rowsort label-209
SELECT CAST ( - ( + 53 ) AS INTEGER ) FROM tab2 GROUP BY col2, col2
----
-53
-53
-53

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING + - 14 * col0 * + col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-211
SELECT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-211
SELECT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col1, col2 HAVING NOT NULL NOT IN ( + 52, - 86 + - + col2, col0 )
----

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING - 58 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-214
SELECT + CAST( NULL AS SIGNED ) AS col2, 52 FROM tab0 GROUP BY col0 HAVING NOT - 39 IS NULL
----
NULL
52
NULL
52
NULL
52

skipif mysql # not compatible
query II rowsort label-214
SELECT + CAST ( NULL AS INTEGER ) AS col2, 52 FROM tab0 GROUP BY col0 HAVING NOT - 39 IS NULL
----
NULL
52
NULL
52
NULL
52

query I rowsort
SELECT DISTINCT - - 15 FROM tab1 WHERE NOT NULL > NULL GROUP BY col0 HAVING + 13 = ( NULL )
----

query I rowsort
SELECT col1 - - col0 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( + 13 ) >= + 47
----

query I rowsort
SELECT DISTINCT 52 + + col0 FROM tab1 GROUP BY col0
----
134
74
80

query I rowsort
SELECT ALL + col0 * + ( 87 ) + col0 FROM tab0 GROUP BY col0 HAVING - 16 * 17 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - 94 col1 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1 HAVING ( - 56 ) IS NULL
----

query I rowsort
SELECT + col2 + - - 39 * + 44 FROM tab1 AS cor0 GROUP BY col2
----
1724
1761
1787

query I rowsort
SELECT col2 * col2 + + col2 + col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
1176
12561
2926

query I rowsort
SELECT ( ( + col1 ) ) + - col1 + - ( + col1 ) * - ( - col1 ) FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT + 22 FROM tab1 GROUP BY col0
----
22
22
22

query I rowsort
SELECT 4 FROM tab0 GROUP BY col0, col2
----
4
4
4

query I rowsort
SELECT 33 * col0 FROM tab2 GROUP BY col0
----
3003
3036
495

query I rowsort
SELECT ALL - 50 FROM tab1 AS cor0 GROUP BY col2
----
-50
-50
-50

query I rowsort
SELECT + + col2 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - 20 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT 52, - 92 FROM tab1 AS cor0 WHERE 27 * + - col1 + - col1 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT 81 FROM tab1 GROUP BY col0
----
81
81
81

query I rowsort
SELECT ALL - 23 FROM tab0 GROUP BY col2, col0
----
-23
-23
-23

query I rowsort
SELECT 38 FROM tab2 AS cor0 WHERE NOT COALESCE ( - col1, col2 ) * - ( - 19 + 64 * - col1 ) NOT IN ( - col1 ) GROUP BY col0 HAVING NOT 43 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 - ( + ( - 8 ) ) AS col2 FROM tab1 cor0 GROUP BY col1
----
14
52
65

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-236
SELECT DISTINCT CAST( NULL AS SIGNED ) * + col2 FROM tab2 cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-236
SELECT DISTINCT CAST ( NULL AS INTEGER ) * + col2 FROM tab2 cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT ( + ( - col2 ) ) * + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 AS cor0 WHERE ( NULL ) NOT IN ( + col0 + + col2 * - 41 ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-240
SELECT DISTINCT col2 * 18 DIV - col2 AS col0 FROM tab1 GROUP BY col2, col2, col2
----
-18

skipif mysql # not compatible
query I rowsort label-240
SELECT DISTINCT col2 * 18 / - col2 AS col0 FROM tab1 GROUP BY col2, col2, col2
----
-18

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-241
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( - ( - AVG ( DISTINCT 34 ) ) + CAST( NULL AS SIGNED ) ) BETWEEN 79 AND NULL
----

skipif mysql # not compatible
query I rowsort label-241
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( - ( - AVG ( DISTINCT 34 ) ) + CAST ( NULL AS INTEGER ) ) BETWEEN 79 AND NULL
----

query I rowsort
SELECT col0 * - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1849
-676
-6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-243
SELECT ALL col2 FROM tab2 WHERE NOT 86 BETWEEN NULL AND + - 77 GROUP BY col2, col2 HAVING ( CAST( NULL AS SIGNED ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-243
SELECT ALL col2 FROM tab2 WHERE NOT 86 BETWEEN NULL AND + - 77 GROUP BY col2, col2 HAVING ( CAST ( NULL AS INTEGER ) ) IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT 23 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 66 - - col1 * + col1 col2 FROM tab1 WHERE NOT NULL <= - + col1 GROUP BY col1
----

query I rowsort
SELECT + - col1 FROM tab0 WHERE NOT col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 WHERE NOT - col2 / - - col0 * + col0 + - col0 < NULL GROUP BY col2, col0 HAVING NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 GROUP BY col1 HAVING ( - + ( col1 ) ) BETWEEN 70 AND NULL
----

query I rowsort
SELECT + 2 FROM tab0 AS cor0 WHERE NULLIF ( - 48, col0 * col2 ) >= NULL GROUP BY col0
----

query I rowsort
SELECT + col0 * - - col0 + + - col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING 97 <> NULL
----

query I rowsort
SELECT ALL 27 FROM tab1 cor0 GROUP BY col1
----
27
27
27

query I rowsort
SELECT DISTINCT + col0 FROM tab1 WHERE NOT + + col1 IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - - 50 FROM tab0 AS cor0 GROUP BY col2
----
50

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-254
SELECT ALL 20 + + 77 + - - CAST( NULL AS SIGNED ), CAST( NULL AS SIGNED ) * - 88 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL
NULL
NULL
NULL

skipif mysql # not compatible
query II rowsort label-254
SELECT ALL 20 + + 77 + - - CAST ( NULL AS INTEGER ), CAST ( NULL AS INTEGER ) * - 88 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 33 FROM tab1 cor0 WHERE ( NOT + 43 * col0 IS NOT NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT 19 * - + ( 65 ) AS col0 FROM tab0 GROUP BY col1, col1
----
-1235
-1235

query I rowsort
SELECT ( + - col1 ) FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col1 + + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT - 70 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-260
SELECT DISTINCT + 93 DIV - 46 + + 62 + + 27 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
87

skipif mysql # not compatible
query I rowsort label-260
SELECT DISTINCT + 93 / - 46 + + 62 + + 27 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
87

query I rowsort
SELECT 96 - col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-20
-62
-78

query I rowsort
SELECT DISTINCT - 3 * - 90 FROM tab1 AS cor0 GROUP BY col2
----
270

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NOT NULL = - col2 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 37 col2 FROM tab2 AS cor0 GROUP BY col1
----
-37
-37
-37

query I rowsort
SELECT + 47 FROM tab2 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 45 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
45

query I rowsort
SELECT - 38 FROM tab0 AS cor0 GROUP BY col2, col2
----
-38
-38
-38

onlyif mysql # DIV for integer division: 
query I rowsort label-268
SELECT DISTINCT + - ( + - col0 ) DIV + - 92 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
0

skipif mysql # not compatible
query I rowsort label-268
SELECT DISTINCT + - ( + - col0 ) / + - 92 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
0

query II rowsort
SELECT 57 AS col2, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING ( 23 * - 66 * - - 70 ) > ( NULL )
----

query I rowsort
SELECT NULLIF ( + + col0, + - 51 ) FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL ( + 93 ) AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT + 69 IS NULL
----
-15
-91
-92

query II rowsort
SELECT ALL + col2 AS col2, + 70 AS col2 FROM tab1 WHERE + 43 <> + - 97 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
70
71
70
8
70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + - col1 col2 FROM tab0 GROUP BY col1
----
0
6561

query II rowsort
SELECT ALL NULLIF ( - col0, col1 ) * - 90, col0 * col0 * col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING col1 NOT BETWEEN - col1 - + col1 AND 31
----
1350
3375
8190
753571
8280
778688

query I rowsort
SELECT - 65 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-5915
-5980
-975

query I rowsort
SELECT ALL 7 - - + col0 - - - ( + 59 ) FROM tab2 AS cor0 GROUP BY col0
----
-37
39
40

query I rowsort
SELECT ( - - 48 ) - - + 94 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-280
SELECT ALL col2 + col2 * - col2 DIV - - col2 FROM tab2 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-280
SELECT ALL col2 + col2 * - col2 / - - col2 FROM tab2 GROUP BY col2
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST( NULL AS SIGNED ) / ( + 17 ) = - + ( ( - + col1 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST ( NULL AS INTEGER ) / ( + 17 ) = - + ( ( - + col1 ) )
----

query I rowsort
SELECT + 49 FROM tab2 AS cor0 GROUP BY col2
----
49
49
49

query I rowsort
SELECT - 4 * - 35 FROM tab1 GROUP BY col1
----
140
140
140

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab2 GROUP BY col2, col0
----
3364
6241
7569

query I rowsort
SELECT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NOT + + 22 IS NOT NULL
----

query I rowsort
SELECT 78 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL IS NULL )
----
78
78
78

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col2 + - col2 + + ( col2 ) * 62 col2 FROM tab2 cor0 GROUP BY col2
----
3538
4819
5307

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT ( NOT 22 * 29 IS NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + + 92 col2 FROM tab2 GROUP BY col0
----
107
183
184

query I rowsort
SELECT ALL + 53 FROM tab0 GROUP BY col2 HAVING NOT + 78 IS NOT NULL
----

query I rowsort
SELECT ALL - 3 - + 16 FROM tab0 AS cor0 GROUP BY col2
----
-19
-19
-19

query I rowsort
SELECT - 46 * - 62 * + col2 FROM tab0 GROUP BY col2, col2
----
108376
225308
68448

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-293
SELECT - ( + CAST( NULL AS SIGNED ) ) * + CAST( NULL AS SIGNED ) / - AVG ( + - col0 ) * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-293
SELECT - ( + CAST ( NULL AS INTEGER ) ) * + CAST ( NULL AS INTEGER ) / - AVG ( + - col0 ) * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + ( + + col0 ) AS col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 56 * col1 col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
-2464
-3192
-336

query I rowsort
SELECT ALL 80 FROM tab0 GROUP BY col2, col0
----
80
80
80

query I rowsort
SELECT ALL + + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + 68 + col1 FROM tab0 AS cor0 GROUP BY col1
----
149
68

query I rowsort
SELECT - - 98 FROM tab1 AS cor0 GROUP BY col0, col0
----
98
98
98

query I rowsort
SELECT + col1 + + + col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT + - AVG ( ALL - 37 ) AS col2 FROM tab2 AS cor0 WHERE ( NOT NULL >= - 36 ) GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-303
SELECT - + CAST( + 2 AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-303
SELECT - + CAST ( + 2 AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-304
SELECT - - CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-304
SELECT - - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT - 82, col2 FROM tab1 AS cor0 WHERE col2 IS NOT NULL GROUP BY col2, col2, col0
----
-82
45
-82
71
-82
8

query I rowsort
SELECT ALL 56 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND - 94
----

query I rowsort
SELECT + col2 + col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
-24
-38
-79

query I rowsort
SELECT col0 * - col0 + - col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-240
-8372
-8556

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + ( 41 ) col0 FROM tab2 AS cor0 GROUP BY col2 HAVING col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col2 * col2 + + + col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL < - + col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 52 col0 FROM tab1 AS cor0 WHERE NOT ( + col1 ) IS NULL GROUP BY col1, col0
----
52

query I rowsort
SELECT 13 FROM tab1 GROUP BY col1
----
13
13
13

query I rowsort
SELECT 54 FROM tab0 AS cor0 GROUP BY col1
----
54
54

query I rowsort
SELECT ALL col0 * + 3 * + col0 FROM tab1 GROUP BY col0
----
1452
20172
2352

query I rowsort
SELECT 69 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
69
69
69

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 15 col2 FROM tab2 GROUP BY col0, col2 HAVING NOT - - col2 - - col2 IS NOT NULL
----

query I rowsort
SELECT + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT DISTINCT - 28 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-28

query I rowsort
SELECT 71 + col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
129
150
158

query I rowsort
SELECT ALL + col1 * - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL - ( + col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - 75 + - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-116
-134
-136

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col0, col2
----
-24
-38
-79

query I rowsort
SELECT - + ( - 61 ) AS col0 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING - 85 + - CASE - + 47 WHEN - - col0 THEN - col0 END BETWEEN col1 AND + 75
----

query I rowsort
SELECT ALL - - col2 * col1 + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
2610
3195
56

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, - col2 * + col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-3364
-79
-6241
-87
-7569

query I rowsort
SELECT ALL - col1 + - col1 * - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT DISTINCT - 58 + - 86 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-144

query I rowsort
SELECT ALL + col0 + - col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-334
SELECT - 8 AS col1 FROM tab2 WHERE - NULLIF ( - 14, 89 * - CAST( NULL AS SIGNED ) ) > - - col1 * col2 + + col0 / + col2 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-334
SELECT - 8 AS col1 FROM tab2 WHERE - NULLIF ( - 14, 89 * - CAST ( NULL AS INTEGER ) ) > - - col1 * col2 + + col0 / + col2 GROUP BY col2
----

query I rowsort
SELECT - col0 * ( 66 ) * + - col0 FROM tab2 GROUP BY col0
----
14850
546546
558624

query I rowsort
SELECT DISTINCT ( 75 ) FROM tab0 GROUP BY col2
----
75

query I rowsort
SELECT DISTINCT + 4 AS col1 FROM tab2 GROUP BY col2
----
4

query I rowsort
SELECT + - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + 73 FROM tab2 AS cor0 GROUP BY col1
----
73
73
73

onlyif mysql # DIV for integer division: 
query I rowsort label-340
SELECT ALL + col1 DIV - 68 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-340
SELECT ALL + col1 / - 68 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL 43 * - col1 * - 43 FROM tab1 GROUP BY col1, col1
----
105393
11094
81356

query I rowsort
SELECT DISTINCT + + 65 AS col1 FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL IN ( + - ( - 69 ) )
----

query I rowsort
SELECT ALL - 22 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL BETWEEN + col0 AND + col1 ) GROUP BY col1
----

query I rowsort
SELECT ALL + col0 - - col0 - 18 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING 11 = NULL
----

query I rowsort
SELECT ALL ( + + col0 ) * col0 AS col1 FROM tab0 GROUP BY col0
----
1849
676
6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-347
SELECT ALL 58 FROM tab1 WHERE NOT 69 >= col1 * CAST( NULL AS SIGNED ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-347
SELECT ALL 58 FROM tab1 WHERE NOT 69 >= col1 * CAST ( NULL AS INTEGER ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT + 83 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
83

query I rowsort
SELECT ( col0 ) FROM tab1 AS cor0 WHERE NULL BETWEEN NULL AND - 18 + + col1 GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
-45
-71
-8

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 * col2 FROM tab1 GROUP BY col1, col1, col2
----
2565
3124
48

query I rowsort
SELECT + 62 AS col1 FROM tab1 GROUP BY col2
----
62
62
62

query I rowsort
SELECT ALL - - 25 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING + ( - 28 ) IS NOT NULL
----
25
25
25

query I rowsort
SELECT 52 FROM tab1 WHERE NOT ( + col0 ) >= + 93 GROUP BY col2
----
52
52
52

query I rowsort
SELECT DISTINCT - col0 - + - 45 AS col2 FROM tab2 cor0 GROUP BY col0
----
-46
-47
30

query I rowsort
SELECT 23 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1357
-1403
-943

query I rowsort
SELECT ALL - + 88 + + CASE + col2 WHEN + 75 THEN + col2 END FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT 79 AS col2 FROM tab2 WHERE NULL BETWEEN ( + col1 ) AND col0 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT 48 / col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT col0 NOT BETWEEN + col0 * 96 AND ( NULL )
----

query I rowsort
SELECT col1 FROM tab1 WHERE NOT NULL >= NULL GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----

query I rowsort
SELECT ALL ( - col1 ) AS col2 FROM tab1 WHERE NOT - COALESCE ( 19, + col2 ) * - - 30 / col1 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT 6 * + + 46 AS col1 FROM tab0 GROUP BY col2
----
276
276
276

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-366
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 WHERE NOT col1 + + - col0 * + + col0 NOT BETWEEN ( - col2 * 67 ) AND NULL GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-366
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 WHERE NOT col1 + + - col0 * + + col0 NOT BETWEEN ( - col2 * 67 ) AND NULL GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 + - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
0

query I rowsort
SELECT + COALESCE ( + 12, - + ( - col0 ) + + col0 ) FROM tab0 AS cor0 GROUP BY col0
----
12
12
12

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + ( - 18 ) * - col0 col1 FROM tab2 GROUP BY col0, col0 HAVING ( - 37 ) IS NULL
----

query I rowsort
SELECT + col1 * + col1 AS col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT - col0 * 8 AS col0 FROM tab1 GROUP BY col0, col0
----
-176
-224
-656

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-372
SELECT col0 / col0 + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-372
SELECT col0 / col0 + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

query II rowsort
SELECT ALL - col1, col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT + + col2 + - 28 * - col0 * + + 27 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2, col0
----
19735
32532
62786

query I rowsort
SELECT 29 FROM tab0 GROUP BY col1, col2 HAVING col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - - 45 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
45

query I rowsort
SELECT - ( col2 ) AS col2 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL ( 77 ) * 91 FROM tab0 GROUP BY col2
----
7007
7007
7007

query I rowsort
SELECT - 51 AS col0 FROM tab0 GROUP BY col2
----
-51
-51
-51

query I rowsort
SELECT DISTINCT + 56 * + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
4536

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-383
SELECT col1 FROM tab0 WHERE - 45 + + 49 NOT BETWEEN ( NULL ) AND ( ( - col0 ) ) GROUP BY col1 HAVING NOT CAST( NULL AS SIGNED ) * col1 + 89 IS NOT NULL
----
0
81

skipif mysql # not compatible
query I rowsort label-383
SELECT col1 FROM tab0 WHERE - 45 + + 49 NOT BETWEEN ( NULL ) AND ( ( - col0 ) ) GROUP BY col1 HAVING NOT CAST ( NULL AS INTEGER ) * col1 + 89 IS NOT NULL
----
0
81

query I rowsort
SELECT - 77 AS col1 FROM tab0 GROUP BY col1, col0
----
-77
-77
-77

query I rowsort
SELECT + 78 FROM tab2 GROUP BY col0, col1
----
78
78
78

query I rowsort
SELECT DISTINCT + col2 + - 63 AS col2 FROM tab1 WHERE ( NULL ) <= ( col1 ) GROUP BY col2, col0
----

query I rowsort
SELECT ALL 30 * 28 AS col2 FROM tab0 GROUP BY col0, col0
----
840
840
840

query I rowsort
SELECT col1 + col1 FROM tab2 WHERE NOT col1 + col0 IS NULL GROUP BY col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0, col0 HAVING NOT 3 IS NULL
----
-26
-43
-83

query I rowsort
SELECT + 73 FROM tab0 AS cor0 GROUP BY col2 HAVING col2 IS NOT NULL
----
73
73
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-391
SELECT CAST( NULL AS SIGNED ) * - col2 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-391
SELECT CAST ( NULL AS INTEGER ) * - col2 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 3 AS col0 FROM tab0 GROUP BY col1 HAVING NOT - 48 * col1 BETWEEN NULL AND ( col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-393
SELECT + col1 FROM tab1 WHERE NOT 91 * - col2 IN ( 67 + - col1 * - CAST( NULL AS SIGNED ) ) GROUP BY col1, col1 HAVING - col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-393
SELECT + col1 FROM tab1 WHERE NOT 91 * - col2 IN ( 67 + - col1 * - CAST ( NULL AS INTEGER ) ) GROUP BY col1, col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT col0 + - 18 FROM tab0 AS cor0 GROUP BY col0
----
25
65
8

query I rowsort
SELECT ALL - + col0 FROM tab1 cor0 WHERE col0 IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT - 18 AS col2 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND + col2 GROUP BY col1, col1, col2
----

query I rowsort
SELECT ( - col0 ) FROM tab0 GROUP BY col0 HAVING NOT NULL >= - + 68
----

query I rowsort
SELECT ALL col1 * 62 + + + col0 * + col0 FROM tab1 cor0 GROUP BY col1, col0
----
4318
856
9452

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - ( + col0 ) FROM tab2 WHERE NOT - col1 IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 + ( + col2 ) * - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT 73 AS col2 FROM tab1 GROUP BY col2, col2
----
73

query I rowsort
SELECT ALL - 62 FROM tab0 cor0 GROUP BY col1, col2
----
-62
-62
-62

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col1, col0 HAVING NOT - col1 + + AVG ( DISTINCT col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 * col0 AS col1 FROM tab1 AS cor0 WHERE col0 * - 79 <> + 24 * col2 GROUP BY col1, col0 HAVING - col1 BETWEEN ( col0 ) * + col0 * - col1 AND - col0
----
1596

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * + + 23 col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING ( col0 ) IS NOT NULL
----
1909
598
989

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 11 * + - col0 + - col0 + - col0 * - + 70 + + 47 + col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
2153
3530
6770

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT + + 45 > ( NULL )
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 WHERE - col1 IS NOT NULL GROUP BY col0, col2
----
24
38
79

query II rowsort
SELECT DISTINCT 8 * + col1 + - ( - col1 ) * + 27 AS col1, - col1 FROM tab1 GROUP BY col1
----
1540
-44
1995
-57
210
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + 92 + + + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
107
-91
183
-92
184

query I rowsort
SELECT col1 + 33 * 81 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
2673
2754

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-414
SELECT col0, 4 * - 96 * + CAST( + 45 AS SIGNED ) / - NULLIF ( + 13, - col1 ) * col0 * + 54 * - CAST( NULL AS DECIMAL ) AS col1 FROM tab1 GROUP BY col0, col1
----
22
NULL
28
NULL
82
NULL

skipif mysql # not compatible
query II rowsort label-414
SELECT col0, 4 * - 96 * + CAST ( + 45 AS INTEGER ) / - NULLIF ( + 13, - col1 ) * col0 * + 54 * - CAST ( NULL AS REAL ) AS col1 FROM tab1 GROUP BY col0, col1
----
22
NULL
28
NULL
82
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-415
SELECT DISTINCT - 59 DIV + - col1 col2 FROM tab1 GROUP BY col1
----
1
9

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-415
SELECT DISTINCT - 59 / + - col1 col2 FROM tab1 GROUP BY col1
----
1
9

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col2, col0, col1
----
41
59
61

query I rowsort
SELECT - ( col0 ) + - col0 * + col0 FROM tab2 GROUP BY col0, col1 HAVING NOT - col0 + + col0 IS NULL
----
-240
-8372
-8556

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-418
SELECT + col2 * - 10 / col2 / + + ( col2 ) + col2 * + col2 * 2 * + CAST( col2 AS SIGNED ) AS col1, col2 / + col2 col0 FROM tab0 AS cor0 WHERE NULL = - col1 GROUP BY col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-418
SELECT + col2 * - 10 / col2 / + + ( col2 ) + col2 * + col2 * 2 * + CAST ( col2 AS INTEGER ) AS col1, col2 / + col2 col0 FROM tab0 AS cor0 WHERE NULL = - col1 GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col2 * - col0 AS col1 FROM tab1 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT + 37 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
37
37
37

query I rowsort
SELECT ALL - 48 AS col1 FROM tab1 AS cor0 WHERE NOT NULL NOT IN ( col0 ) GROUP BY col2
----

query I rowsort
SELECT 80 * - col2 / + + col2 + col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2 HAVING - col2 + col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-423
SELECT DISTINCT + col2 FROM tab1 WHERE NOT NULL NOT IN ( col1, + 96 + - col1, - + col2 + + col2, col0, + col0, - col0 ) AND ( NOT ( NULL <> + CAST( - + ( - 77 ) AS SIGNED ) + CAST( NULL AS SIGNED ) - + col1 * - + col2 + col1 ) ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-423
SELECT DISTINCT + col2 FROM tab1 WHERE NOT NULL NOT IN ( col1, + 96 + - col1, - + col2 + + col2, col0, + col0, - col0 ) AND ( NOT ( NULL <> + CAST ( - + ( - 77 ) AS INTEGER ) + CAST ( NULL AS INTEGER ) - + col1 * - + col2 + col1 ) ) GROUP BY col2
----

query I rowsort
SELECT 61 AS col1 FROM tab0 GROUP BY col1, col0 HAVING ( NOT NULL IS NOT NULL )
----
61
61
61

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT 26 + 48 AS col2, + col0 FROM tab0 GROUP BY col0, col0
----
74
26
74
43
74
83

query I rowsort
SELECT ALL - col0 + + 80 + + col0 * + col0 * + + ( col0 ) * + col0 FROM tab1 cor0 GROUP BY col0
----
234314
45212174
614708

query I rowsort
SELECT + col2 * + ( col2 ) + + + col2 / + col2 FROM tab0 GROUP BY col2 HAVING NOT + 1 IS NOT NULL
----

query II rowsort
SELECT ALL ( col0 ), - col0 FROM tab0 GROUP BY col0, col0
----
26
-26
43
-43
83
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-430
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - - CAST( NULL AS SIGNED ) * col1 * - AVG ( + 68 ) + CAST( NULL AS SIGNED ) + - 47 + + - col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-430
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - - CAST ( NULL AS INTEGER ) * col1 * - AVG ( + 68 ) + CAST ( NULL AS INTEGER ) + - 47 + + - col1 IS NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col2 * + + col2 * - - ( - 26 ) FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT - col1 IS NULL
----
-3001050
-5766904
-9984

query I rowsort
SELECT + + col0 FROM tab1 cor0 GROUP BY col2, col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT - ( col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + 64 FROM tab2 AS cor0 GROUP BY col1 HAVING ( + col1 ) <= ( NULL )
----

query I rowsort
SELECT ALL + 25 FROM tab1 AS cor0 GROUP BY col0
----
25
25
25

query I rowsort
SELECT ALL + col2 * ( 40 ) + + 30 AS col0 FROM tab0 GROUP BY col0, col2
----
1550
3190
990

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-437
SELECT + NULLIF ( - 0, + col0 ) DIV + - 12 + + 41 * col0 AS col1, + col2 + + CAST( NULL AS SIGNED ) + + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
3731
NULL
3772
NULL
615
NULL

skipif mysql # not compatible
query II rowsort label-437
SELECT + NULLIF ( - 0, + col0 ) / + - 12 + + 41 * col0 AS col1, + col2 + + CAST ( NULL AS INTEGER ) + + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
3731
NULL
3772
NULL
615
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING 44 IS NOT NULL
----
-45
-71
-8

query II rowsort
SELECT ALL 52 + - col1 + + 66 + - col0, col1 FROM tab1 GROUP BY col1, col0
----
-8
44
33
57
90
6

query II rowsort
SELECT DISTINCT + col1, ( 44 ) * - col0 + - - col0 + 70 + - col0 * - col1 AS col0 FROM tab0 GROUP BY col1, col0
----
0
-1048
0
-3499
81
1704

query I rowsort
SELECT - 35 FROM tab1 WHERE NOT - col1 * col0 IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 89 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
89
89
89

query I rowsort
SELECT - col1 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT - 92 AS col2 FROM tab1 GROUP BY col0, col0
----
-92
-92
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-445
SELECT + col0 DIV + col2 AS col1 FROM tab0 GROUP BY col2, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-445
SELECT + col0 / + col2 AS col1 FROM tab0 GROUP BY col2, col0
----
0
1
2

query I rowsort
SELECT ALL - 21 + + + ( + 47 ) AS col2 FROM tab1 GROUP BY col0, col1
----
26
26
26

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING col0 <> - 66
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 87 FROM tab0 cor0 GROUP BY col2 HAVING NOT - 74 * - 6 + 7 = NULL
----

query I rowsort
SELECT DISTINCT + 70 FROM tab1 AS cor0 GROUP BY col0, col0
----
70

query I rowsort
SELECT DISTINCT + + ( - + col0 ) FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT - 4 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-4
-4

query II rowsort
SELECT + 84 AS col1, col0 FROM tab2 AS cor0 GROUP BY col0
----
84
15
84
91
84
92

query II rowsort
SELECT + col2, 14 AS col0 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 49 FROM tab1 cor0 WHERE NOT col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + 42 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT - col0 + + col0 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + + 37 AS col0, + 21 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
37
21

query I rowsort
SELECT + 14 + + ( col0 ) * col0 + + + col0 AS col0 FROM tab2 GROUP BY col0
----
254
8386
8570

query I rowsort
SELECT - - ( - - col0 ) + - 66 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT - + 64 IS NOT NULL
----

query I rowsort
SELECT - ( 8 ) FROM tab1 AS cor0 GROUP BY col1
----
-8
-8
-8

query II rowsort
SELECT DISTINCT col0 * 6, col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
546
91
552
92
90
15

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1, col0 HAVING NOT + + col1 < ( 54 * col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-465
SELECT - 5 DIV + 80 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING - - ( - + col2 ) * 2 IS NOT NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-465
SELECT - 5 / + 80 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING - - ( - + col2 ) * 2 IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT + 24 + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
107
50
67

query I rowsort
SELECT col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT col2 + - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT - col1 + + col1 FROM tab0 GROUP BY col1 HAVING NOT ( col1 ) IS NULL
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( ( 43 ) ) * col2 col0 FROM tab0 GROUP BY col2
----
-1032
-1634
-3397

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-471
SELECT col0 FROM tab0 WHERE NOT ( CAST( NULL AS SIGNED ) ) IS NOT NULL GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-471
SELECT col0 FROM tab0 WHERE NOT ( CAST ( NULL AS INTEGER ) ) IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT - 13 * + 1 FROM tab0 GROUP BY col2, col2, col1 HAVING NOT NULL IS NOT NULL
----
-13
-13
-13

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col0 HAVING col0 <> - col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 47 IS NULL
----
44
57
6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL <= col1
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 WHERE NOT ( NULL ) <= col1 GROUP BY col1 HAVING NOT AVG ( + col1 ) IS NULL
----

query I rowsort
SELECT 20 / - col0 + col0 AS col1 FROM tab0 WHERE NULL BETWEEN NULL AND NULL GROUP BY col1, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-478
SELECT ALL - col0 DIV - ( col0 ) - + - 99 FROM tab1 cor0 GROUP BY col0
----
100
100
100

skipif mysql # not compatible
query I rowsort label-478
SELECT ALL - col0 / - ( col0 ) - + - 99 FROM tab1 cor0 GROUP BY col0
----
100
100
100

query I rowsort
SELECT + col2 + ( + col2 + - col2 ) AS col2 FROM tab0 WHERE NOT ( + 69 ) IS NULL GROUP BY col2, col2 HAVING NOT 51 IS NOT NULL
----

query I rowsort
SELECT col0 + - CASE WHEN 64 IS NULL THEN + col0 END FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + ( col0 ) / col0 - col0 / - col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT ( + 38 ) IS NOT NULL
----

query I rowsort
SELECT - 11 AS col2 FROM tab1 GROUP BY col0
----
-11
-11
-11

query I rowsort
SELECT - 78 * col2 - + col2 FROM tab1 GROUP BY col2
----
-3555
-5609
-632

onlyif mysql # DIV for integer division: 
query I rowsort label-484
SELECT DISTINCT - 1 DIV 86 AS col1 FROM tab0 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-484
SELECT DISTINCT - 1 / 86 AS col1 FROM tab0 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col1 HAVING NOT 9 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 23 + col1 FROM tab1 AS cor0 WHERE NOT ( col2 * col1 ) BETWEEN col1 / col1 AND ( + col1 + + col2 ) GROUP BY col1
----
29
67
80

query I rowsort
SELECT 25 AS col0 FROM tab2 GROUP BY col2, col1 HAVING + 23 / - col1 IS NULL
----

query I rowsort
SELECT DISTINCT - - col0 * + col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL IS NOT NULL
----
240
8372
8556

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-489
SELECT - CAST( + 31 AS SIGNED ) AS col2 FROM tab2 GROUP BY col1, col0
----
-31
-31
-31

skipif mysql # not compatible
query I rowsort label-489
SELECT - CAST ( + 31 AS INTEGER ) AS col2 FROM tab2 GROUP BY col1, col0
----
-31
-31
-31

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0, col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-491
SELECT DISTINCT + - 88 + - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT 33 <> ( - CAST( 61 AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-491
SELECT DISTINCT + - 88 + - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT 33 <> ( - CAST ( 61 AS REAL ) )
----

query I rowsort
SELECT - + 74 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 32 IS NULL
----
-74
-74
-74

query I rowsort
SELECT ALL col0 + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-494
SELECT ALL - ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE 19 / 33 NOT IN ( + col1 * COALESCE ( + col1, 62 ) ) GROUP BY col0, col2 HAVING ( CAST( col0 AS SIGNED ) ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-494
SELECT ALL - ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE 19 / 33 NOT IN ( + col1 * COALESCE ( + col1, 62 ) ) GROUP BY col0, col2 HAVING ( CAST ( col0 AS INTEGER ) ) <= NULL
----

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col0 * + - col0 * + col0 * - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + - 99 IS NULL
----
-50625
-68574961
-71639296

query I rowsort
SELECT ALL + col0 - - col0 + 23 FROM tab1 AS cor0 GROUP BY col0
----
187
67
79

query I rowsort
SELECT ALL 74 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-499
SELECT - - CAST( + col0 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-499
SELECT - - CAST ( + col0 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-500
SELECT ALL col1 DIV + col1 + - col1 FROM tab2 GROUP BY col1
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-500
SELECT ALL col1 / + col1 + - col1 FROM tab2 GROUP BY col1
----
-40
-58
-60

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-501
SELECT + CAST( NULL AS DECIMAL ) FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-501
SELECT + CAST ( NULL AS REAL ) FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 * - - 62 - + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - ( + ( - col2 ) ) * - 68 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-3060
-4828
-544

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-504
SELECT DISTINCT CAST( NULL AS SIGNED ) / + + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-504
SELECT DISTINCT CAST ( NULL AS INTEGER ) / + + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-505
SELECT ALL NULLIF ( ( + - 36 ), - - CAST( - col0 AS SIGNED ) + - col2 + - col2 - - - col0 * - 4 + - - 64 ) AS col2, ( + + col2 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-36
24
-36
38
-36
79

skipif mysql # not compatible
query II rowsort label-505
SELECT ALL NULLIF ( ( + - 36 ), - - CAST ( - col0 AS INTEGER ) + - col2 + - col2 - - - col0 * - 4 + - - 64 ) AS col2, ( + + col2 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-36
24
-36
38
-36
79

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING ( + col2 ) BETWEEN NULL AND - 85
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 * - col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 89 IS NULL
----
484
6724
784

query I rowsort
SELECT - - col1 FROM tab0 cor0 GROUP BY col1, col2, col0 HAVING NULL < NULL
----

query II rowsort
SELECT DISTINCT + 39 AS col2, ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
39
-15
39
-91
39
-92

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-511
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING + CAST( NULL AS SIGNED ) IS NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-511
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING + CAST ( NULL AS INTEGER ) IS NULL
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-512
SELECT + 11 * CAST( NULL AS SIGNED ) - - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING + - col2 NOT BETWEEN + - ( 80 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-512
SELECT + 11 * CAST ( NULL AS INTEGER ) - - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING + - col2 NOT BETWEEN + - ( 80 ) AND NULL
----

query I rowsort
SELECT 72 * + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-1872
-3096
-5976

query II rowsort
SELECT col2, + 4 FROM tab0 GROUP BY col2
----
24
4
38
4
79
4

query II rowsort
SELECT - col0 + - col0 + - + col0, col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-273
91
-276
92
-45
15

query II rowsort
SELECT DISTINCT + col1 * + 72 AS col1, 31 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
2952
31
4248
31
4392
31

query I rowsort
SELECT DISTINCT - col1 + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + 92 - + col0, col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
-114
22
-120
28
-174
82

query I rowsort
SELECT 7 + - - 17 AS col1 FROM tab2 GROUP BY col2
----
24
24
24

query I rowsort
SELECT + 71 * + 70 FROM tab2 GROUP BY col1
----
4970
4970
4970

query I rowsort
SELECT + col0 - + 0 AS col0 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 * + col2 AS col0 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT 10 FROM tab1 cor0 GROUP BY col0
----
10

query II rowsort
SELECT ALL - - 18 * + - ( + col0 ), + 1 FROM tab2 AS cor0 WHERE NOT 97 * 41 IS NOT NULL GROUP BY col0, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-525
SELECT ALL + + CAST( NULL AS SIGNED ) * - CAST( NULL AS SIGNED ) * 90 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-525
SELECT ALL + + CAST ( NULL AS INTEGER ) * - CAST ( NULL AS INTEGER ) * 90 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 59 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
59

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-527
SELECT DISTINCT col2 + 46 * - 79, - CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col2, col1
----
-3555
NULL
-3596
NULL
-3610
NULL

skipif mysql # not compatible
query II rowsort label-527
SELECT DISTINCT col2 + 46 * - 79, - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col2, col1
----
-3555
NULL
-3596
NULL
-3610
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-528
SELECT ALL - + 81 FROM tab1 AS cor0 WHERE CAST( NULL AS SIGNED ) * ( - col2 ) IS NOT NULL GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-528
SELECT ALL - + 81 FROM tab1 AS cor0 WHERE CAST ( NULL AS INTEGER ) * ( - col2 ) IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT - ( col2 ) - - + 15 * 5 + - ( + 95 ) * - col2 FROM tab0 GROUP BY col2 HAVING + 54 >= col2
----
2331
3647

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-530
SELECT DISTINCT 37 AS col2, - CAST( NULL AS SIGNED ) * + + col2 col1 FROM tab0 GROUP BY col2
----
37
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-530
SELECT DISTINCT 37 AS col2, - CAST ( NULL AS INTEGER ) * + + col2 col1 FROM tab0 GROUP BY col2
----
37
NULL

query I rowsort
SELECT ALL - ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 7 col2, 12 col2 FROM tab2 GROUP BY col0, col1
----
7
12
7
12
7
12

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-533
SELECT + CAST( NULL AS SIGNED ) * - col2 FROM tab1 GROUP BY col1, col2 HAVING - + 58 * + ( + 25 ) + - + col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-533
SELECT + CAST ( NULL AS INTEGER ) * - col2 FROM tab1 GROUP BY col1, col2 HAVING - + 58 * + ( + 25 ) + - + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT + - 76 IS NOT NULL
----

query I rowsort
SELECT ALL 75 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
75
75
75

query I rowsort
SELECT DISTINCT + 64 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 / - - 31 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL = - col2 * + - col1 / col2 + + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * col1 col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL + 17 FROM tab2 GROUP BY col0, col1, col1 HAVING NOT ( 34 ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-540
SELECT + col2 * + CAST( - col2 AS SIGNED ) / + + 23 * - col2 + - col2 - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN col2 + + + col2 AND NULL
----

skipif mysql # not compatible
query I rowsort label-540
SELECT + col2 * + CAST ( - col2 AS INTEGER ) / + + 23 * - col2 + - col2 - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN col2 + + + col2 AND NULL
----

query I rowsort
SELECT DISTINCT + ( + 81 ) FROM tab1 GROUP BY col1, col2
----
81

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query II rowsort
SELECT col0, 91 + + col0 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
15
106
91
182
92
183

query I rowsort
SELECT ALL - ( - 90 ) FROM tab2 AS cor0 WHERE NULL BETWEEN NULL AND col2 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-545
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-545
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - ( + col0 ) * + - 60 - - + col0 FROM tab2 cor0 GROUP BY col0
----
5551
5612
915

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT col1 <> NULL
----

query I rowsort
SELECT + col2 * + col2 FROM tab1 cor0 GROUP BY col0, col2
----
2025
5041
64

query I rowsort
SELECT ALL - - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-550
SELECT CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-550
SELECT CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT - col2 + - + 89 * + col2 AS col1 FROM tab1 GROUP BY col2
----
-4050
-6390
-720

query I rowsort
SELECT DISTINCT + ( - col0 ) AS col1 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col0 * - col0 AS col1 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING - 3 <= NULL
----

query I rowsort
SELECT ALL + 18 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT - - col0 / - 68 BETWEEN - + 96 AND NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-557
SELECT - 95 DIV 56 + - 67 AS col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-68
-68
-68

skipif mysql # not compatible
query I rowsort label-557
SELECT - 95 / 56 + - 67 AS col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-68
-68
-68

query I rowsort
SELECT DISTINCT - 91 * + 47 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-4277

query I rowsort
SELECT DISTINCT - - ( - + col1 ) AS col1 FROM tab2 AS cor0 WHERE NOT + 39 * - + col1 IS NULL GROUP BY col2, col1 HAVING NOT 36 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-560
SELECT DISTINCT - col1 DIV - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-560
SELECT DISTINCT - col1 / - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1

query II rowsort
SELECT + col1 AS col1, - col1 AS col1 FROM tab1 GROUP BY col0, col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT DISTINCT + 13 FROM tab1 GROUP BY col2, col0
----
13

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - 80 AS col0 FROM tab0 GROUP BY col2, col0
----
-80

onlyif mysql # DIV for integer division: 
query I rowsort label-565
SELECT ALL + col0 DIV col0 * + col0 FROM tab2 cor0 GROUP BY col1, col2, col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-565
SELECT ALL + col0 / col0 * + col0 FROM tab2 cor0 GROUP BY col1, col2, col0
----
15
91
92

query I rowsort
SELECT ALL - + col1 - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-118
-122
-82

query I rowsort
SELECT - col0 + + + 71 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1080
-6552
-6624

query I rowsort
SELECT ALL + ( 14 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
14
14
14

query I rowsort
SELECT col1 * + + col1 + - col1 * col1 + + col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT - 57 IS NOT NULL
----

query I rowsort
SELECT - 69 FROM tab2 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-571
SELECT DISTINCT 29 * + CAST( - col0 AS DECIMAL ) + - CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL OR - + 95 IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-571
SELECT DISTINCT 29 * + CAST ( - col0 AS REAL ) + - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL OR - + 95 IS NULL
----
NULL

query I rowsort
SELECT 21 FROM tab0 AS cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 86 FROM tab0 GROUP BY col1, col0
----
86
86
86

query I rowsort
SELECT DISTINCT - col2 * - - col2 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT + 89 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT 43 IS NOT NULL
----

query I rowsort
SELECT ALL + + 22 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( ( NULL ) IS NOT NULL )
----
22
22
22

query I rowsort
SELECT DISTINCT col0 * + col0 + - - 96 + + 88 * + col0 FROM tab1 GROUP BY col0
----
14036
2516
3344

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - 30 FROM tab1 GROUP BY col2
----
-30

query II rowsort
SELECT DISTINCT - 77 AS col0, + col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col2 / - col2 - col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( - - 23 ) IS NULL
----

query I rowsort
SELECT ALL ( - - ( + 2 ) ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
2
2

query I rowsort
SELECT DISTINCT - col0 * - ( 28 ) FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
1204
2324
728

onlyif mysql # DIV for integer division: 
query I rowsort label-584
SELECT DISTINCT + - col1 DIV + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-584
SELECT DISTINCT + - col1 / + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1

query II rowsort
SELECT ALL + col1 * + col2 - + col1 + - col2, + 93 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL = ( col1 / + 9 * + 68 )
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2 HAVING NOT - 97 IS NOT NULL
----

query I rowsort
SELECT - - 84 FROM tab2 cor0 GROUP BY col1, col2
----
84
84
84

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-588
SELECT col1 * + - col1 / + + 70 + + col1 / AVG ( + 96 ) FROM tab1 GROUP BY col1 HAVING ( NOT 34 + + col1 > ( - CAST( NULL AS DECIMAL ) ) )
----

skipif mysql # not compatible
query I rowsort label-588
SELECT col1 * + - col1 / + + 70 + + col1 / AVG ( + 96 ) FROM tab1 GROUP BY col1 HAVING ( NOT 34 + + col1 > ( - CAST ( NULL AS REAL ) ) )
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT - col0 * - col0 + - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
506
6806
812

query I rowsort
SELECT DISTINCT col1 * col1 AS col1 FROM tab2 GROUP BY col1, col0
----
1681
3481
3721

query I rowsort
SELECT + 88 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NULL ) NOT BETWEEN col1 AND - col1
----

query I rowsort
SELECT col0 * - col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT 72 AS col1 FROM tab1 GROUP BY col2
----
72

query II rowsort
SELECT ALL - - col2 AS col2, col2 FROM tab1 cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT + 60 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
16
3
54

query I rowsort
SELECT - 73 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-73
-73
-73

query I rowsort
SELECT 35 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) >= NULL GROUP BY col2, col2
----

query I rowsort
SELECT - 28 FROM tab2 WHERE NOT - 64 NOT BETWEEN ( col1 ) AND - col0 + - col1 * col2 GROUP BY col2
----

query I rowsort
SELECT DISTINCT + 26 + - col0 FROM tab1 cor0 GROUP BY col0
----
-2
-56
4

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * - 52 - - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
1378
2279
4399

query I rowsort
SELECT DISTINCT + 30 - + - ( + + col2 ) FROM tab0 AS cor0 GROUP BY col2, col1
----
109
54
68

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 > NULL
----

query I rowsort
SELECT + - 94 - + 33 - + - col1 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1554
3354
3594

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN ( NULL ) AND + 38
----

query I rowsort
SELECT ALL - ( - col2 ) FROM tab2 GROUP BY col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-607
SELECT DISTINCT + col0 * - - 70 + - - 86 + 8 + + col0 * CAST( 43 AS SIGNED ) FROM tab0 GROUP BY col0
----
3032
4953
9473

skipif mysql # not compatible
query I rowsort label-607
SELECT DISTINCT + col0 * - - 70 + - - 86 + 8 + + col0 * CAST ( 43 AS INTEGER ) FROM tab0 GROUP BY col0
----
3032
4953
9473

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-608
SELECT DISTINCT CAST( NULL AS SIGNED ) / + 43 FROM tab2 AS cor0 WHERE NOT + col0 BETWEEN NULL AND + - 68 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-608
SELECT DISTINCT CAST ( NULL AS INTEGER ) / + 43 FROM tab2 AS cor0 WHERE NOT + col0 BETWEEN NULL AND + - 68 GROUP BY col0, col1
----
NULL

query I rowsort
SELECT ALL col2 * 44 FROM tab2 cor0 GROUP BY col2
----
2552
3476
3828

query I rowsort
SELECT COALESCE ( - col1, col2, + col1 ) FROM tab2 GROUP BY col0, col1, col2 HAVING NOT NULL <> ( col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-611
SELECT + CAST( NULL AS SIGNED ) - + ( + - 29 ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-611
SELECT + CAST ( NULL AS INTEGER ) - + ( + - 29 ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-612
SELECT + - CAST( 54 AS SIGNED ) * 17 + 13 + ( col2 ) * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-329
5336
539

skipif mysql # not compatible
query I rowsort label-612
SELECT + - CAST ( 54 AS INTEGER ) * 17 + 13 + ( col2 ) * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-329
5336
539

query II rowsort
SELECT DISTINCT - col2 AS col1, 72 FROM tab1 AS cor0 GROUP BY col2
----
-45
72
-71
72
-8
72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-614
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NOT ( col1 ) BETWEEN COALESCE ( 22, + ( - - col2 ) + - col2 ) + col2 AND 14 / ( - CAST( NULL AS SIGNED ) ) GROUP BY col2 HAVING ( - 60 ) <= - col2
----
58

skipif mysql # not compatible
query I rowsort label-614
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NOT ( col1 ) BETWEEN COALESCE ( 22, + ( - - col2 ) + - col2 ) + col2 AND 14 / ( - CAST ( NULL AS INTEGER ) ) GROUP BY col2 HAVING ( - 60 ) <= - col2
----
58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 + + + col1 - - - col1 col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING ( NOT 49 IS NULL )
----
41
59
61

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 WHERE NULL BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + 27 FROM tab1 AS cor0 GROUP BY col0
----
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-618
SELECT DISTINCT + + col0 - - col0 + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 64 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-618
SELECT DISTINCT + + col0 - - col0 + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 64 IS NOT NULL
----

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 AS cor0 WHERE col0 NOT BETWEEN - - col2 AND NULL GROUP BY col1
----
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 GROUP BY col2, col0 HAVING NOT - col2 * + col0 IS NULL
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-621
SELECT ALL - col0 DIV + col0 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-621
SELECT ALL - col0 / + col0 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - 54 FROM tab2 AS cor0 GROUP BY col1, col1
----
-54
-54
-54

query II rowsort
SELECT DISTINCT - col0 * - col0 * + + ( + col0 ) AS col0, ( + ( col0 ) ) FROM tab2 AS cor0 WHERE ( NULL ) > + + col2 GROUP BY col0
----

query I rowsort
SELECT DISTINCT + 89 * - 23 + + - col0 FROM tab0 AS cor0 WHERE col1 - + col2 IS NULL GROUP BY col2, col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col1 + col1 * + col1 * col1 FROM tab0 GROUP BY col1 HAVING + - 81 IS NOT NULL
----
0
531522

query I rowsort
SELECT - 17 FROM tab1 GROUP BY col0
----
-17
-17
-17

query I rowsort
SELECT ALL col0 - 51 FROM tab0 GROUP BY col0
----
-25
-8
32

query I rowsort
SELECT - - 76 FROM tab0 AS cor0 GROUP BY col2
----
76
76
76

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - 42 + - ( - - 1 ) FROM tab1 GROUP BY col1
----
-43
-43
-43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-633
SELECT + 92 * + CAST( NULL AS SIGNED ) / - col2 - + col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-633
SELECT + 92 * + CAST ( NULL AS INTEGER ) / - col2 - + col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT 8 * col1 * col1 * + col1 AS col0 FROM tab2 GROUP BY col1
----
1643032
1815848
551368

query II rowsort
SELECT ALL col1, col1 - + 86 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
-86
81
76

query I rowsort
SELECT DISTINCT - 35 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-35

query I rowsort
SELECT ALL - 43 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1763
-2537
-2623

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL col0 - - - ( + col0 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT - 21 + + - 87 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-108
-108
-108

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-641
SELECT - ( col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT + CAST( NULL AS SIGNED ) IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-641
SELECT - ( col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT + CAST ( NULL AS INTEGER ) IS NOT NULL )
----

query I rowsort
SELECT ALL + 17 FROM tab2 AS cor0 WHERE NOT 94 IS NULL GROUP BY col1
----
17
17
17

query I rowsort
SELECT ALL 12 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
12
12
12

query I rowsort
SELECT DISTINCT - col1 * + 97 FROM tab2 AS cor0 GROUP BY col1
----
-3977
-5723
-5917

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( NOT - 20 IS NOT NULL )
----
45
71
8

query I rowsort
SELECT DISTINCT + + col1 * - ( + 1 ) - + col2 * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL <= col1
----

query I rowsort
SELECT + 69 AS col0 FROM tab1 GROUP BY col2, col2
----
69
69
69

query I rowsort
SELECT ALL 17 FROM tab0 GROUP BY col2, col1, col0
----
17
17
17

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NOT - 75 NOT BETWEEN NULL AND - col1 GROUP BY col2
----

query I rowsort
SELECT DISTINCT - 97 * - col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
163057
337657
360937

query I rowsort
SELECT ALL + ( - + col0 ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT 32 + - + col0 AS col0 FROM tab0 GROUP BY col2, col0
----
-11
-51
6

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col0, col1, col0
----
-81
0
0

query I rowsort
SELECT - ( - + col0 ) + + col0 AS col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + col2 AS col2 FROM tab2 WHERE NOT - col1 * - 15 IN ( - - col2 * + 86 + 74, + col1 ) GROUP BY col2
----
58
79
87

query I rowsort
SELECT - - 87 FROM tab1 AS cor0 GROUP BY col2, col1
----
87
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 * - col0 + col1 col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-478
-6680
-727

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-658
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab0 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-658
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab0 cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 35 FROM tab2 GROUP BY col1
----
-35
-35
-35

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + col1 col1 FROM tab0 GROUP BY col1 HAVING NOT col1 - 60 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col2 * - ( - + col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT 87 / col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT + + 5 < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-664
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT + 55 * - 80 + - - CAST( NULL AS SIGNED ) - + + 71 IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-664
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT + 55 * - 80 + - - CAST ( NULL AS INTEGER ) - + + 71 IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING - 15 IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 WHERE NULL NOT IN ( + 49 ) GROUP BY col2
----

query I rowsort
SELECT + 31 + + 63 * + - ( - col2 ) AS col1 FROM tab1 GROUP BY col2, col0 HAVING - - 28 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-668
SELECT - 30 DIV 33 * col1 FROM tab2 GROUP BY col0, col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-668
SELECT - 30 / 33 * col1 FROM tab2 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1, col2
----
0
0
81

query I rowsort
SELECT col1 * + COALESCE ( 21, + 24 ) + col1 FROM tab2 AS cor0 WHERE ( 8 ) NOT IN ( col0 * col2, + 96 * - col0 * - - 96 + - 24, + - col2 ) GROUP BY col1
----
1298
1342
902

query I rowsort
SELECT ALL - 72 FROM tab2 AS cor0 WHERE col2 * + col1 IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col1 + + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - 91 IS NULL
----
114
12
88

query I rowsort
SELECT DISTINCT 88 FROM tab2 cor0 GROUP BY col1
----
88

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-674
SELECT CAST( NULL AS SIGNED ) * - 12 * + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-674
SELECT CAST ( NULL AS INTEGER ) * - 12 * + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT + col1, + col1 AS col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query II rowsort
SELECT + + col2, col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
24
576
38
1444
79
6241

onlyif mysql # DIV for integer division: 
query I rowsort label-677
SELECT ALL - 12 DIV 93 * - col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-677
SELECT ALL - 12 / 93 * - col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 - + col2 col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-158
-48
-76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col0 col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + + col2 > NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT NULL IN ( col2 * col1 ) GROUP BY col1
----

query I rowsort
SELECT ALL + ( + 15 ) FROM tab2 GROUP BY col1 HAVING + col1 <= AVG ( col2 ) + col1
----
15
15
15

query I rowsort
SELECT ALL - 87 FROM tab0 GROUP BY col0, col1
----
-87
-87
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-683
SELECT ALL + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT ( - 22 + - - CAST( NULL AS SIGNED ) ) = 51
----

skipif mysql # not compatible
query I rowsort label-683
SELECT ALL + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT ( - 22 + - - CAST ( NULL AS INTEGER ) ) = 51
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-684
SELECT - CAST( 23 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) > ( NULL )
----

skipif mysql # not compatible
query I rowsort label-684
SELECT - CAST ( 23 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) > ( NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 81 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) < 65 / col0 * 39
----

query I rowsort
SELECT ALL - 71 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( + - 18 + - 34 ) > ( NULL )
----

query I rowsort
SELECT ALL - ( col2 ) AS col0 FROM tab0 AS cor0 WHERE NOT ( col0 * - COALESCE ( col2, + - 75, 11 * col0 ) * col1 + + 58 ) NOT BETWEEN - ( - 33 ) + 99 AND col2 GROUP BY col1, col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - col1 * col1 / ( + - col1 ) - - col1 / col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = ( + col1 / - ( + col2 ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-689
SELECT col1 - + + 42 DIV - 42 - - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( - col1 ) IS NOT NULL
----
1
163

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-689
SELECT col1 - + + 42 / - 42 - - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( - col1 ) IS NOT NULL
----
1
163

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-690
SELECT + - col1 / + CAST( NULL AS SIGNED ) + - + col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-690
SELECT + - col1 / + CAST ( NULL AS INTEGER ) + - + col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + ( + + 10 ) + col2 FROM tab2 WHERE NOT NULL IN ( - - col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + 51 AS col0 FROM tab1 GROUP BY col2
----
51

query I rowsort
SELECT ALL 3 FROM tab2 GROUP BY col2
----
3
3
3

query I rowsort
SELECT - - 22 FROM tab0 AS cor0 WHERE NOT + col1 * + + col2 BETWEEN NULL AND - col2 + + col2 GROUP BY col0, col1 HAVING 30 < - 51 * + 2
----

query II rowsort
SELECT - col1 - + - 95 AS col1, ( - col1 ) * + col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
34
-3660
36
-3422
54
-1640

query I rowsort
SELECT DISTINCT + 51 + + ( - col0 ) * 36 - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
-3316
-3353
-504

query I rowsort
SELECT DISTINCT + + col1 + - col1 + col1 FROM tab1 WHERE NOT ( NOT + col2 IS NULL ) GROUP BY col1, col1 HAVING ( - 30 * - col1 ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1849
676
6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-699
SELECT DISTINCT 95 + + col2 - col2 + + col2 * CAST( NULL AS SIGNED ) / 39 + 50 AS col1 FROM tab2 GROUP BY col2 HAVING col2 * + col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-699
SELECT DISTINCT 95 + + col2 - col2 + + col2 * CAST ( NULL AS INTEGER ) / 39 + 50 AS col1 FROM tab2 GROUP BY col2 HAVING col2 * + col2 IS NULL
----

query I rowsort
SELECT - - col2 * + 28 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
1102
2291
696

query I rowsort
SELECT ALL - col0 * + col0 + 78 * + 0 AS col0 FROM tab2 WHERE NOT - + 3 + - col0 + - col2 * - col1 - - col2 > + 75 / - col1 GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 + 53 FROM tab2 GROUP BY col1, col0
----
112
114
94

query I rowsort
SELECT ALL - 32 * - col0 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
3003
3036
495

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-704
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NOT + col1 NOT BETWEEN - CAST( NULL AS SIGNED ) AND + col0 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-704
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NOT + col1 NOT BETWEEN - CAST ( NULL AS INTEGER ) AND + col0 GROUP BY col2
----

query I rowsort
SELECT + col1 * + col1 * 40 + - col1 + + col1 + + 53 * + col1 * + col1 FROM tab2 cor0 GROUP BY col1, col2, col1
----
156333
323733
346053

query I rowsort
SELECT ALL + col2 + + col2 FROM tab1 GROUP BY col2, col1
----
142
16
90

query I rowsort
SELECT - col2 * + col2 + col2 FROM tab0 GROUP BY col0, col2
----
-1406
-552
-6162

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0, col1, col2
----
22
28
82

query I rowsort
SELECT + 17 * + col1 AS col2 FROM tab1 WHERE NOT ( + col1 * - col2 + col0 ) NOT BETWEEN ( NULL ) AND NULL GROUP BY col1 HAVING NOT ( NULL ) <= + col1
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN col0 AND ( NULL )
----

query I rowsort
SELECT DISTINCT + 24 * - col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
-1056
-1368
-144

query I rowsort
SELECT col1 * + col1 + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE - col2 > NULL GROUP BY col0
----

query I rowsort
SELECT ALL col0 * col0 + 36 AS col2 FROM tab1 GROUP BY col0
----
520
6760
820

query I rowsort
SELECT ALL col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT 62 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT + col2 * + col0 IS NOT NULL GROUP BY col2, col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 24 + - col0 AS col2 FROM tab0 GROUP BY col0
----
-19
-2
-59

query I rowsort
SELECT 79 AS col2 FROM tab1 WHERE NOT + 18 IS NULL GROUP BY col2, col1
----
79
79
79

onlyif mysql # DIV for integer division: 
query I rowsort label-720
SELECT DISTINCT - col0 DIV + 73 FROM tab1 GROUP BY col0
----
-1
0

skipif mysql # not compatible
query I rowsort label-720
SELECT DISTINCT - col0 / + 73 FROM tab1 GROUP BY col0
----
-1
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 31 col1 FROM tab2 WHERE NOT + 47 + - col2 <> ( - col1 ) GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 17 + + - col0 * + col0 AS col2 FROM tab1 GROUP BY col0
----
-467
-6707
-767

query I rowsort
SELECT ALL - col0 * + 35 * 3 FROM tab0 GROUP BY col0 HAVING NOT NULL <> ( col0 )
----

query I rowsort
SELECT + col1 * - ( col1 ) + + col1 AS col1 FROM tab0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT DISTINCT - col0 / + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col1 HAVING NOT - col1 - - NULLIF ( ( col1 ), - 51 ) IS NOT NULL
----

query I rowsort
SELECT + col2 * + col2 AS col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST( NULL AS SIGNED ) >= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST ( NULL AS INTEGER ) >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST ( NULL AS REAL )
----

query I rowsort
SELECT - 58 * col1 FROM tab1 GROUP BY col1
----
-2552
-3306
-348

query I rowsort
SELECT DISTINCT - col0 * + col0 * + - col0 AS col0 FROM tab2 GROUP BY col0, col0
----
3375
753571
778688

query I rowsort
SELECT ( + + col2 ) + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT + 26 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
26
26
26

query II rowsort
SELECT ALL col0, 41 FROM tab1 AS cor0 GROUP BY col0
----
22
41
28
41
82
41

query I rowsort
SELECT 37 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT col2 - col2 IS NOT NULL
----

query I rowsort
SELECT - col0 + - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1 + - col1 AS col2, 19 * + + col1 AS col2 FROM tab1 GROUP BY col1
----
-114
1083
-12
114
-88
836

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-738
SELECT + col2 * - CAST( NULL AS SIGNED ) + + 31 * - - ( 88 ) * col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-738
SELECT + col2 * - CAST ( NULL AS INTEGER ) + + 31 * - - ( 88 ) * col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 36 FROM tab0 GROUP BY col1, col2
----
36
36
36

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-740
SELECT ALL + NULLIF ( 4, - ( col0 ) / + col0 ) * + col0 * CAST( - + col0 AS SIGNED ) AS col0 FROM tab1 GROUP BY col0
----
-1936
-26896
-3136

skipif mysql # not compatible
query I rowsort label-740
SELECT ALL + NULLIF ( 4, - ( col0 ) / + col0 ) * + col0 * CAST ( - + col0 AS INTEGER ) AS col0 FROM tab1 GROUP BY col0
----
-1936
-26896
-3136

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-741
SELECT + CAST( 57 AS SIGNED ) AS col1 FROM tab2 GROUP BY col0
----
57
57
57

skipif mysql # not compatible
query I rowsort label-741
SELECT + CAST ( 57 AS INTEGER ) AS col1 FROM tab2 GROUP BY col0
----
57
57
57

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT 24 / + + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NULL > - - col1
----

query I rowsort
SELECT + col0 + col0 * 21 FROM tab0 GROUP BY col0 HAVING NOT - - 77 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-745
SELECT + col2 + col2 * - col2 + - 49 DIV + col2 AS col1 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

skipif mysql # not compatible
query I rowsort label-745
SELECT + col2 + col2 * - col2 + - 49 / + col2 AS col1 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

query I rowsort
SELECT + + 27 FROM tab1 AS cor0 GROUP BY col1, col0
----
27
27
27

query I rowsort
SELECT 57 FROM tab1 AS cor0 GROUP BY col2, col1
----
57
57
57

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-748
SELECT - col0 * 17 + + CAST( NULL AS SIGNED ) AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-748
SELECT - col0 * 17 + + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 AS cor0 WHERE - 53 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - 79 FROM tab1 GROUP BY col2
----
-79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING + NULLIF ( col2, + + 58 ) >= NULL
----

query I rowsort
SELECT DISTINCT - ( - 30 ) + col1 FROM tab1 AS cor0 GROUP BY col1
----
36
74
87

onlyif mysql # DIV for integer division: 
query I rowsort label-753
SELECT 92 DIV col2 * 42 AS col0 FROM tab2 GROUP BY col2
----
42
42
42

skipif mysql # not compatible
query I rowsort label-753
SELECT 92 / col2 * 42 AS col0 FROM tab2 GROUP BY col2
----
42
42
42

query II rowsort
SELECT - ( col1 ) AS col1, col1 AS col2 FROM tab0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 WHERE NOT ( - 51 ) + + col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + 3 * - col2 * col2 * - + 87 * - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING 3 IS NULL
----

query II rowsort
SELECT DISTINCT - 89, + 95 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-758
SELECT col0 + + col0 DIV 70 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 NOT BETWEEN + - ( 96 ) AND - 97
----
26
43
84

skipif mysql # not compatible
query I rowsort label-758
SELECT col0 + + col0 / 70 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 NOT BETWEEN + - ( 96 ) AND - 97
----
26
43
84

query I rowsort
SELECT ALL + 22 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
22
22
22

onlyif mysql # DIV for integer division: 
query I rowsort label-760
SELECT ALL - 87 DIV col0 + - 53 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT col0 < - 25
----
-53
-53
-58

skipif mysql # not compatible
query I rowsort label-760
SELECT ALL - 87 / col0 + - 53 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT col0 < - 25
----
-53
-53
-58

query I rowsort
SELECT DISTINCT 96 AS col2 FROM tab2 GROUP BY col1
----
96

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-762
SELECT - 19 * - CAST( NULL AS DECIMAL ) + 24 + + - 27 + + + col2 FROM tab1 WHERE NOT - col2 IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-762
SELECT - 19 * - CAST ( NULL AS REAL ) + 24 + + - 27 + + + col2 FROM tab1 WHERE NOT - col2 IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT COALESCE ( 13, + + ( col2 ) ) + 53 FROM tab2 GROUP BY col2, col1
----
66
66
66

query I rowsort
SELECT - ( + + col2 ) AS col0 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL 14 * + 63 FROM tab0 GROUP BY col1
----
882
882

query I rowsort
SELECT col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT + col0 * - + 79 FROM tab0 GROUP BY col0 HAVING NOT - - 66 NOT BETWEEN NULL AND - 68
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT 47 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NOT ( NULL IS NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col2, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-772
SELECT ALL col1 / + ( col1 ) + - 49 AS col2, - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col2 HAVING NOT + 45 >= NULL
----

skipif mysql # not compatible
query II rowsort label-772
SELECT ALL col1 / + ( col1 ) + - 49 AS col2, - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col2 HAVING NOT + 45 >= NULL
----

query I rowsort
SELECT - 25 * + - 65 FROM tab1 GROUP BY col2, col1 HAVING NULL > - col2
----

query I rowsort
SELECT DISTINCT 45 * - + col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
0
295245

query I rowsort
SELECT + NULLIF ( + + col2, col2 ) + col2 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 - - 44 col2 FROM tab1 AS cor0 GROUP BY col1
----
101
50
88

query I rowsort
SELECT ALL col0 + col1 * - - col1 FROM tab2 GROUP BY col0, col1
----
1773
3572
3736

query I rowsort
SELECT 86 FROM tab1 GROUP BY col0
----
86
86
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 57 col0 FROM tab2 AS cor0 GROUP BY col2
----
-57
-57
-57

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE NOT col2 * - col1 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - 50 * - 90 + - col2 + - + ( + - 88 ) * - - 56 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
9341
9349
9370

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-784
SELECT ALL - 29 + - CAST( NULL AS SIGNED ) col1 FROM tab0 cor0 GROUP BY col1 HAVING ( 91 * - 31 < NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-784
SELECT ALL - 29 + - CAST ( NULL AS INTEGER ) col1 FROM tab0 cor0 GROUP BY col1 HAVING ( 91 * - 31 < NULL )
----

query I rowsort
SELECT + - 60 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-60
-60
-60

query I rowsort
SELECT DISTINCT - - col2 / - 89 FROM tab1 WHERE ( col0 + 73 * - 90 ) IN ( ( - 4 ), + col1 / - col2 ) GROUP BY col2
----

query I rowsort
SELECT - + col2 - - - 81 * + col2 FROM tab1 cor0 GROUP BY col1, col2
----
-3690
-5822
-656

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING + COALESCE ( + - 64, - col2 * + 3 * col2 ) IS NULL
----

query I rowsort
SELECT - - 32 FROM tab2 AS cor0 GROUP BY col1
----
32
32
32

query I rowsort
SELECT 22 - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
105
48
65

query I rowsort
SELECT ( + - 57 ) AS col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT 14 + + 94 NOT IN ( + - 21 * + - 53 )
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-793
SELECT DISTINCT - 91 DIV + + col2 - col1 FROM tab0 GROUP BY col2, col1
----
-1
-2
-84

skipif mysql # not compatible
query I rowsort label-793
SELECT DISTINCT - 91 / + + col2 - col1 FROM tab0 GROUP BY col2, col1
----
-1
-2
-84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, col0 FROM tab0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + 7 col1 FROM tab2 GROUP BY col0, col0
----
22
98
99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - 1, col2 * - 82 + - 7 col1 FROM tab0 cor0 GROUP BY col2, col1
----
-1
-1975
-1
-3123
-1
-6485

query II rowsort
SELECT ALL + - col2 AS col2, + col2 * col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
3364
-79
6241
-87
7569

query I rowsort
SELECT ALL - col2 - - + col2 * col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3306
6162
7482

query I rowsort
SELECT ALL 97 * 18 * - + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
-137934
-41904
-66348

query I rowsort
SELECT + 31 + - 37 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-6
-6
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab2 GROUP BY col2 HAVING col2 BETWEEN - - 49 + + - col2 AND 0
----

query I rowsort
SELECT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-804
SELECT + - CAST( NULL AS SIGNED ), col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= 96 * - col0
----

skipif mysql # not compatible
query II rowsort label-804
SELECT + - CAST ( NULL AS INTEGER ), col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= 96 * - col0
----

query I rowsort
SELECT + col2 * + col2 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----
3364
6241
7569

onlyif mysql # DIV for integer division: 
query I rowsort label-806
SELECT col2 + 19 + + col2 DIV + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
28
65
91

skipif mysql # not compatible
query I rowsort label-806
SELECT col2 + 19 + + col2 / + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
28
65
91

query I rowsort
SELECT + - ( - col2 ) + col2 * + 4 + + 89 FROM tab0 AS cor0 GROUP BY col2, col2
----
209
279
484

query II rowsort
SELECT col0, col0 + col0 FROM tab0 GROUP BY col2, col0
----
26
52
43
86
83
166

query I rowsort
SELECT 31 FROM tab1 AS cor0 GROUP BY col1
----
31
31
31

query I rowsort
SELECT 31 AS col1 FROM tab2 GROUP BY col1, col2 HAVING + col1 + - 88 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1, col0, col1 HAVING NOT 37 IS NULL
----
-44
-57
-6

query I rowsort
SELECT 73 AS col1 FROM tab2 GROUP BY col0, col0
----
73
73
73

query I rowsort
SELECT ALL + 22 AS col0 FROM tab0 GROUP BY col1 HAVING ( NULL ) NOT BETWEEN ( col1 ) AND NULL
----

query I rowsort
SELECT - NULLIF ( + col1, + 50 ) AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 79 AS col2 FROM tab2 GROUP BY col2, col0, col2
----
79
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 14 col2 FROM tab1 GROUP BY col0
----
-14
-14
-14

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( 59 ) col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col2 * col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL 36 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
36
36
36

onlyif mysql # DIV for integer division: 
query I rowsort label-820
SELECT + 9 DIV + 55 + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

skipif mysql # not compatible
query I rowsort label-820
SELECT + 9 / + 55 + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL 85 + - col1 FROM tab0 cor0 GROUP BY col1, col2
----
4
85
85

query I rowsort
SELECT col0 * ( - col0 ) AS col0 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT 83 * col1 AS col0 FROM tab2 GROUP BY col1
----
3403
4897
5063

query I rowsort
SELECT - 54 AS col1 FROM tab0 GROUP BY col1, col2
----
-54
-54
-54

query I rowsort
SELECT 68 * + col2 AS col1 FROM tab2 GROUP BY col2
----
3944
5372
5916

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - - col2 col1 FROM tab1 GROUP BY col0, col2
----
142
16
90

query II rowsort
SELECT ALL + col1 / - - 67 AS col1, + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ( - col2 ) FROM tab2 WHERE NOT - - 79 + + col2 + + col1 NOT IN ( - col1 ) GROUP BY col2 HAVING col2 - + col2 IS NOT NULL
----

query I rowsort
SELECT 88 AS col2 FROM tab1 GROUP BY col1
----
88
88
88

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 15 col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT - col1 / + 24 + + col0 IS NULL
----
-15
-15
-15

onlyif mysql # DIV for integer division: 
query I rowsort label-832
SELECT 14 DIV - + col2 + + 20 + 46 * col2 FROM tab0 cor0 GROUP BY col2, col2, col2
----
1124
1768
3654

skipif mysql # not compatible
query I rowsort label-832
SELECT 14 / - + col2 + + 20 + 46 * col2 FROM tab0 cor0 GROUP BY col2, col2, col2
----
1124
1768
3654

onlyif mysql # DIV for integer division: 
query I rowsort label-833
SELECT DISTINCT - col2 DIV col2 DIV - + 26 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

skipif mysql # not compatible
query I rowsort label-833
SELECT DISTINCT - col2 / col2 / - + 26 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

query I rowsort
SELECT - ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT col1 * + + ( - 98 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-4018
-5782
-5978

query I rowsort
SELECT ALL - 21 - + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-27
-65
-78

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL - 70 AS col0, 2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - ( - - col0 ) <= NULL
----

query I rowsort
SELECT + ( - col1 ) FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT ( - + 68 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col0, col1 HAVING NULL IS NULL
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-842
SELECT ALL col1 FROM tab2 GROUP BY col1, col1 HAVING + + CAST( + - col1 AS SIGNED ) IS NOT NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-842
SELECT ALL col1 FROM tab2 GROUP BY col1, col1 HAVING + + CAST ( + - col1 AS INTEGER ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NOT - 51 > NULL )
----

query I rowsort
SELECT ALL ( col2 ) + - col2 + + ( col2 ) + 28 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
36
73
99

query I rowsort
SELECT - + col1 + - 67 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-846
SELECT DISTINCT + - col2 FROM tab0 cor0 WHERE NULL IN ( - 57, col2 * col1 + + + CAST( - col2 AS DECIMAL ), + - ( + + CAST( - - 84 AS SIGNED ) ) + 6 + - - col2 + + col1, col0 * col1 * col0 - - - col2 + col0, - + col2 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-846
SELECT DISTINCT + - col2 FROM tab0 cor0 WHERE NULL IN ( - 57, col2 * col1 + + + CAST ( - col2 AS REAL ), + - ( + + CAST ( - - 84 AS INTEGER ) ) + 6 + - - col2 + + col1, col0 * col1 * col0 - - - col2 + col0, - + col2 ) GROUP BY col2
----

query I rowsort
SELECT - col2 - - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + 74 IS NULL
----

query I rowsort
SELECT DISTINCT + ( + 29 ) AS col0 FROM tab0 AS cor0 GROUP BY col0
----
29

query I rowsort
SELECT - 17 AS col0 FROM tab1 GROUP BY col1
----
-17
-17
-17

query I rowsort
SELECT + 96 * + col1 * - + col1 / - 79 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 33 + - col0 FROM tab1 GROUP BY col0
----
-49
11
5

query I rowsort
SELECT ALL + col1 + + 86 AS col2 FROM tab1 GROUP BY col1, col2, col1
----
130
143
92

query I rowsort
SELECT ALL + col0 + - col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col0 / - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 92 FROM tab1 WHERE ( 0 * col1 ) <= ( NULL ) GROUP BY col0 HAVING NOT ( + 0 ) = ( 18 )
----

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - + ( + 10 ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 + - + ( - col2 ) FROM tab2 GROUP BY col2
----
116
158
174

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-858
SELECT CAST( col0 AS SIGNED ) DIV - 5 FROM tab0 GROUP BY col0
----
-16
-5
-8

skipif mysql # not compatible
query I rowsort label-858
SELECT CAST ( col0 AS INTEGER ) / - 5 FROM tab0 GROUP BY col0
----
-16
-5
-8

query I rowsort
SELECT DISTINCT + + 53 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
53

query I rowsort
SELECT ALL + AVG ( DISTINCT - + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING ( ( NULL ) IS NOT NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 * - col0 * CASE WHEN NULL = + col2 THEN NULL ELSE col0 END + + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-149688
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 37, col2 / + col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( + col0 ) * - - 4 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 9 * col2 + col2 + 30 * - col0 col1, col0 + - 1 * + 0 * - ( - col0 ) AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
-1750
82
-390
28
-580
22

query II rowsort
SELECT - + 48 + + 79 AS col0, + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
31
44
31
57
31
6

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-865
SELECT - - CAST( NULL AS SIGNED ) + - 13, col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-865
SELECT - - CAST ( NULL AS INTEGER ) + - 13, col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
22
NULL
28
NULL
82

query I rowsort
SELECT ALL - - 60 + 55 * - col1 * + 64 AS col2 FROM tab0 cor0 WHERE NULL < - col1 GROUP BY col1
----

query I rowsort
SELECT DISTINCT 64 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT - + col1 IS NULL
----
64

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2, col2 HAVING NOT ( NOT 82 IS NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-869
SELECT - 73 FROM tab2 GROUP BY col1, col2 HAVING NOT + - 42 >= CAST( 27 AS DECIMAL ) + 4
----
-73
-73
-73

skipif mysql # not compatible
query I rowsort label-869
SELECT - 73 FROM tab2 GROUP BY col1, col2 HAVING NOT + - 42 >= CAST ( 27 AS REAL ) + 4
----
-73
-73
-73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-870
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN 23 * + CAST( NULL AS SIGNED ) * + 71 AND - + col0 * ( - col2 ) GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-870
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN 23 * + CAST ( NULL AS INTEGER ) * + 71 AND - + col0 * ( - col2 ) GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - 20 AS col1 FROM tab0 GROUP BY col1 HAVING - col1 IS NOT NULL
----
-20

query I rowsort
SELECT - ( + + col0 ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - - col0 * col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT 19 * + col0 + - + 66 FROM tab2 GROUP BY col0
----
1663
1682
219

query I rowsort
SELECT col0 + col0 - - col0 FROM tab2 GROUP BY col0, col0
----
273
276
45

query I rowsort
SELECT ( 10 ) * - 82 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL BETWEEN + col0 * 90 AND + - 21
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-877
SELECT DISTINCT - 13 + - - col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + col2 / CAST( NULL AS SIGNED ) * + col2 = NULL
----

skipif mysql # not compatible
query I rowsort label-877
SELECT DISTINCT - 13 + - - col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + col2 / CAST ( NULL AS INTEGER ) * + col2 = NULL
----

query I rowsort
SELECT - - col1 + + + 67 * 64 AS col2 FROM tab0 WHERE NOT + col1 < NULL GROUP BY col1, col1
----

query I rowsort
SELECT + col2 + + ( - - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
116
158
174

query I rowsort
SELECT DISTINCT - 52 FROM tab1 AS cor0 GROUP BY col1
----
-52

query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT + 14 * + 14 <> NULL
----

query I rowsort
SELECT - 88 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-27
-29
-47

query I rowsort
SELECT - ( + col2 ) AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT 19 + - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT - col2 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-887
SELECT + - 62 * + col0 + - col0 + - - col0 DIV + col2, col0 + + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-5732
12
-5795
34
-945
-72

skipif mysql # not compatible
query II rowsort label-887
SELECT + - 62 * + col0 + - col0 + - - col0 / + col2, col0 + + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-5732
12
-5795
34
-945
-72

onlyif mysql # DIV for integer division: 
query I rowsort label-888
SELECT + col2 DIV - COALESCE ( - col2, col2 ) + + col2 + - - col2 FROM tab0 GROUP BY col2, col0
----
159
49
77

skipif mysql # not compatible
query I rowsort label-888
SELECT + col2 / - COALESCE ( - col2, col2 ) + + col2 + - - col2 FROM tab0 GROUP BY col2, col0
----
159
49
77

query I rowsort
SELECT + 75 AS col1 FROM tab2 GROUP BY col2
----
75
75
75

query I rowsort
SELECT col1 * + 51 FROM tab1 GROUP BY col1
----
2244
2907
306

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-891
SELECT - + NULLIF ( - col1, + CASE + CAST( NULL AS SIGNED ) WHEN 66 THEN NULL WHEN - + col2 THEN + 81 END ) + - + 57 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
-16
2
4

skipif mysql # not compatible
query I rowsort label-891
SELECT - + NULLIF ( - col1, + CASE + CAST ( NULL AS INTEGER ) WHEN 66 THEN NULL WHEN - + col2 THEN + 81 END ) + - + 57 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
-16
2
4

query I rowsort
SELECT DISTINCT - 53 + - COALESCE ( 36, + + 52 ) AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
-89

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 AS col2, - col1 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
-81
38
0
79
0

query I rowsort
SELECT ALL - ( - col2 ) FROM tab0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - 17 * + - 64 col0, + 49 AS col2 FROM tab2 cor0 GROUP BY col1
----
1088
49
1088
49
1088
49

query I rowsort
SELECT DISTINCT - 52 * + + col2 * + 87 * - 94 * - - 13 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - ( col2 ) BETWEEN NULL AND - col2
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 16 FROM tab1 GROUP BY col1
----
16
16
16

query I rowsort
SELECT ALL 9 AS col0 FROM tab2 GROUP BY col1, col1
----
9
9
9

query I rowsort
SELECT - col2 * + 0 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - 90 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT 95 + - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
121
138
178

query I rowsort
SELECT col0 * ( col0 ) * + 2 * - col0 FROM tab2 GROUP BY col0
----
-1507142
-1557376
-6750

query I rowsort
SELECT DISTINCT + - col0 + - 28 * col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-2378
-638
-812

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-905
SELECT ALL - + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-905
SELECT ALL - + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 81 AS col2 FROM tab0 GROUP BY col0
----
81
81
81

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col0, col1, col1
----
44
57
6

query II rowsort
SELECT ALL col1 * + col1 * + - ( + + 4 ), - col1 AS col0 FROM tab0 GROUP BY col1
----
-26244
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 GROUP BY col1 HAVING col1 > NULL
----

query I rowsort
SELECT ALL 36 FROM tab2 GROUP BY col1, col0
----
36
36
36

onlyif mysql # DIV for integer division: 
query I rowsort label-911
SELECT col1 - + col0 + - col2 DIV col2 FROM tab2 GROUP BY col2, col0, col1
----
-33
-52
45

skipif mysql # not compatible
query I rowsort label-911
SELECT col1 - + col0 + - col2 / col2 FROM tab2 GROUP BY col2, col0, col1
----
-33
-52
45

query II rowsort
SELECT - - col0 * col2 AS col0, 70 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING NOT + ( col2 ) <= + col2
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 49 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
49

query I rowsort
SELECT + - 27 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-27
-27

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-916
SELECT - - 92 * + + CAST( NULL AS SIGNED ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-916
SELECT - - 92 * + + CAST ( NULL AS INTEGER ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

query I rowsort
SELECT - 7 FROM tab0 GROUP BY col1
----
-7
-7

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 * - + col1 * + COALESCE ( + - 17, - COALESCE ( - col0, + + col0 * col2 + + + col2 ), - col2 ) - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL 43 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * col0 * - 39 AS col0 FROM tab0 GROUP BY col0
----
26364
268671
72111

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-921
SELECT DISTINCT - CAST( ( + - ( - 53 ) ) AS DECIMAL ) FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-921
SELECT DISTINCT - CAST ( ( + - ( - 53 ) ) AS REAL ) FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT + 70 * + + 17 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1190

query I rowsort
SELECT - col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL + 49, + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <> - 50
----

query I rowsort
SELECT + col0 * + - col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col2 - + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT 60 IS NULL
----
-142
-16
-90

query I rowsort
SELECT ALL - 11 * col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 - - col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING 1 IS NULL
----

query I rowsort
SELECT ALL - col0 * 40 AS col2 FROM tab1 GROUP BY col0, col0
----
-1120
-3280
-880

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + - 23 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
18
36
38

query I rowsort
SELECT ( + 88 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
88
88
88

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-934
SELECT DISTINCT - 39, CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-39
NULL

skipif mysql # not compatible
query II rowsort label-934
SELECT DISTINCT - 39, CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-39
NULL

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 WHERE ( ( col2 ) ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - + col1 - + + 2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-2
-83

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - + 62 < NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( + 6 ) IS NOT NULL
----

query I rowsort
SELECT ALL 49 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( col1 ) IN ( + ( 54 ) )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-940
SELECT - - 19 + + ( CAST( NULL AS DECIMAL ) ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-940
SELECT - - 19 + + ( CAST ( NULL AS REAL ) ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-941
SELECT ALL 64 + col1 DIV - 95 - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
108
121
70

skipif mysql # not compatible
query I rowsort label-941
SELECT ALL 64 + col1 / - 95 - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
108
121
70

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 WHERE NOT + col0 NOT BETWEEN ( + + col1 ) AND ( + 96 + + col1 ) GROUP BY col0, col2
----
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 43 * - col0 + + 68 col0 FROM tab0 AS cor0 GROUP BY col0
----
-1050
-1781
-3501

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 + 87 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - + 2 AS col1 FROM tab2 WHERE NULL >= NULL GROUP BY col2
----

query I rowsort
SELECT ALL + - 37 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( - ( col0 ) NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - - 2 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-118
-122
-82

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 * col0 FROM tab2 WHERE ( NOT ( NULL IS NOT NULL ) ) GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL 91 FROM tab2 cor0 GROUP BY col2
----
91
91
91

query II rowsort
SELECT ALL col2 AS col2, - 75 AS col2 FROM tab2 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col1 * - + col1 AS col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col1 * - + col1 AS col1 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT - - 59 FROM tab2 AS cor0 GROUP BY col0
----
59
59
59

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0, col0 HAVING NOT - + col0 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-957
SELECT ALL - CAST( NULL AS SIGNED ) * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-957
SELECT ALL - CAST ( NULL AS INTEGER ) * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

query II rowsort
SELECT - col0 * col0 AS col1, - col0 FROM tab0 GROUP BY col0
----
-1849
-43
-676
-26
-6889
-83

query I rowsort
SELECT DISTINCT 45 FROM tab2 AS cor0 GROUP BY col2
----
45

onlyif mysql # DIV for integer division: 
query II rowsort label-960
SELECT DISTINCT - NULLIF ( - + 38, - col1 ) DIV - col1 AS col0, - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
0
-41
0
-59
0
-61

skipif mysql # not compatible
query II rowsort label-960
SELECT DISTINCT - NULLIF ( - + 38, - col1 ) / - col1 AS col0, - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
0
-41
0
-59
0
-61

query I rowsort
SELECT - col2 + + col2 - - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT 73 <= NULL
----

query I rowsort
SELECT ALL - col2 * - col2 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-963
SELECT DISTINCT - CAST( NULL AS SIGNED ) * ( - 55 ) col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-963
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * ( - 55 ) col2 FROM tab1 GROUP BY col1
----
NULL

query I rowsort
SELECT col0 + + 55 FROM tab2 AS cor0 GROUP BY col0, col1
----
146
147
70

query I rowsort
SELECT DISTINCT col2 * + 1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT - 17 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NULL BETWEEN ( - - col1 ) AND col2
----

query I rowsort
SELECT DISTINCT + + 44 * - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
1144
1892
3652

onlyif mysql # DIV for integer division: 
query I rowsort label-968
SELECT col0 DIV 94 FROM tab0 cor0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-968
SELECT col0 / 94 FROM tab0 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + 48 + - + col0 AS col0 FROM tab2 GROUP BY col0
----
-43
-44
33

query I rowsort
SELECT DISTINCT + 88 FROM tab1 AS cor0 GROUP BY col0
----
88

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 WHERE - 65 * - 84 IN ( + 68 * col2, - 97, + col0 / - col1 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 * 68 * 85 AS col1 FROM tab2 GROUP BY col2 HAVING + + 63 IS NULL
----

query I rowsort
SELECT 47 FROM tab2 GROUP BY col0
----
47
47
47

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL >= + col2
----

query I rowsort
SELECT - col1 * - col2 FROM tab1 GROUP BY col1, col2
----
2565
3124
48

query II rowsort
SELECT ALL + col1 + - col1 + - + col1 AS col0, col1 FROM tab0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT 91 - + ( + + col0 ) FROM tab0 GROUP BY col0
----
48
65
8

query I rowsort
SELECT DISTINCT + 27 FROM tab0 WHERE NOT - - 61 IS NULL GROUP BY col1, col0
----
27

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 84 col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-84

query I rowsort
SELECT - 83 FROM tab0 AS cor0 GROUP BY col0
----
-83
-83
-83

query I rowsort
SELECT ALL + col2 + col2 + - - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
114
237
72

query I rowsort
SELECT ALL 60 FROM tab2 GROUP BY col0, col1
----
60
60
60

query I rowsort
SELECT + col1 * - col1 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL 89 AS col1 FROM tab2 GROUP BY col2
----
89
89
89

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 56 + + 85 col1 FROM tab2 AS cor0 GROUP BY col0
----
141
141
141

onlyif mysql # DIV for integer division: 
query I rowsort label-989
SELECT DISTINCT 71 DIV + - col2 AS col0 FROM tab1 GROUP BY col2
----
-1
-8

skipif mysql # not compatible
query I rowsort label-989
SELECT DISTINCT 71 / + - col2 AS col0 FROM tab1 GROUP BY col2
----
-1
-8

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - col1 * + + col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col0 + + col0 col1, col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
0
26
0
43
0
83

query I rowsort
SELECT DISTINCT col2 * - col2 * - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( + col0 IS NOT NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-994
SELECT DISTINCT - CAST( NULL AS SIGNED ) + - - col2 + + + col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-994
SELECT DISTINCT - CAST ( NULL AS INTEGER ) + - - col2 + + + col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-995
SELECT ALL col0 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0 HAVING + 33 * + + col0 / CAST( NULL AS SIGNED ) * - + 19 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-995
SELECT ALL col0 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0 HAVING + 33 * + + col0 / CAST ( NULL AS INTEGER ) * - + 19 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 62 AS col0 FROM tab2 WHERE NOT + col2 + + col2 * + CASE + + col1 WHEN + col1 * col1 + col0 THEN NULL ELSE - col2 END + - + ( + - col2 ) IS NULL GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-997
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2 HAVING - col2 <= CAST( 43 AS SIGNED ) / + - col2 * - 42
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-997
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2 HAVING - col2 <= CAST ( 43 AS INTEGER ) / + - col2 * - 42
----
-58
-79
-87

query I rowsort
SELECT + 13 FROM tab2 GROUP BY col1 HAVING + 59 IS NULL
----

query I rowsort
SELECT DISTINCT - ( col2 ) FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT - 83 AS col1 FROM tab1 WHERE + col2 * col0 + - col2 + col2 IS NOT NULL GROUP BY col1, col0
----
-83
-83
-83

query I rowsort
SELECT - + 53 FROM tab2 cor0 GROUP BY col2
----
-53
-53
-53

query I rowsort
SELECT - ( - + col1 ) * - ( - col1 ) FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - ( - 77 ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT + + ( + col2 ) IS NULL
----
24
38
79

query I rowsort
SELECT + col1 * - 70 AS col2 FROM tab1 GROUP BY col1
----
-3080
-3990
-420

query I rowsort
SELECT col1 + - + col1 + - + col1 * - - col1 AS col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT - 67 + 32 AS col0 FROM tab1 GROUP BY col1
----
-35
-35
-35

query I rowsort
SELECT ALL + 73 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
73
73
73

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 GROUP BY col1, col0
----
22
28
82

query II rowsort
SELECT + col0 * + - col0 AS col2, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
43
-676
26
-6889
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1011
SELECT + CAST( + - col1 AS SIGNED ) FROM tab0 GROUP BY col1
----
-81
0

skipif mysql # not compatible
query I rowsort label-1011
SELECT + CAST ( + - col1 AS INTEGER ) FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - - 56 * - 83 + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT + 76 IS NULL
----
-4561
-4569
-4590

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - ( 86 ), + col1 * - - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-86
1681
-86
3481
-86
3721

query I rowsort
SELECT DISTINCT + col2 * 8 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
464
632
696

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1015
SELECT + CAST( - col1 AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-1015
SELECT + CAST ( - col1 AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-1016
SELECT + col2 DIV - + 3 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
39
53
58

skipif mysql # not compatible
query I rowsort label-1016
SELECT + col2 / - + 3 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
39
53
58

query I rowsort
SELECT col0 * 49 AS col0 FROM tab0 GROUP BY col0
----
1274
2107
4067

query I rowsort
SELECT DISTINCT - 3 * - col2 + 1 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1019
SELECT CAST( 99 AS SIGNED ) AS col0 FROM tab0 WHERE NOT - - CAST( NULL AS SIGNED ) IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-1019
SELECT CAST ( 99 AS INTEGER ) AS col0 FROM tab0 WHERE NOT - - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1020
SELECT - col2 * + col2 * - - col2 - + col2 FROM tab1 AS cor0 WHERE - CAST( NULL AS SIGNED ) IS NULL GROUP BY col2
----
-357982
-520
-91170

skipif mysql # not compatible
query I rowsort label-1020
SELECT - col2 * + col2 * - - col2 - + col2 FROM tab1 AS cor0 WHERE - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2
----
-357982
-520
-91170

query I rowsort
SELECT DISTINCT 11 AS col2 FROM tab2 cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
11

query I rowsort
SELECT ALL - ( - - 90 ) FROM tab1 AS cor0 GROUP BY col1 HAVING ( - - 11 ) IS NOT NULL
----
-90
-90
-90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1023
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1023
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col1, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1024
SELECT DISTINCT + - col2 AS col1, col2 FROM tab0 WHERE NOT + - col1 IN ( - - 38, + 41, CAST( + + col1 AS SIGNED ) ) GROUP BY col2, col2
----
-24
24

skipif mysql # not compatible
query II rowsort label-1024
SELECT DISTINCT + - col2 AS col1, col2 FROM tab0 WHERE NOT + - col1 IN ( - - 38, + 41, CAST ( + + col1 AS INTEGER ) ) GROUP BY col2, col2
----
-24
24

query I rowsort
SELECT 60 FROM tab0 GROUP BY col1, col1
----
60
60

query I rowsort
SELECT col0 * 84 * - 41 AS col2 FROM tab0 GROUP BY col0, col0
----
-148092
-285852
-89544

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2, col2 HAVING NOT 76 = NULL
----

query I rowsort
SELECT DISTINCT 14 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
14

query I rowsort
SELECT DISTINCT - col2 + - - 81 * + 27 FROM tab1 AS cor0 GROUP BY col2
----
2116
2142
2179

query I rowsort
SELECT ALL + + col0 * col0 * + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
3375
753571
778688

query II rowsort
SELECT - col1, col1 + + - col1 AS col2 FROM tab0 GROUP BY col1
----
-81
0
0
0

query I rowsort
SELECT - + ( - - 26 ) FROM tab1 AS cor0 GROUP BY col2, col1, col1 HAVING NOT ( - col1 ) IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST( NULL AS DECIMAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST ( NULL AS REAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

query I rowsort
SELECT + col1 - 26 FROM tab2 GROUP BY col1, col0 HAVING NULL BETWEEN + CASE - 99 WHEN - - col1 THEN NULL ELSE + 56 END AND 35 * - 64
----

query I rowsort
SELECT ALL 85 FROM tab0 GROUP BY col0, col0
----
85
85
85

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( NOT NULL < - col1 * 9 )
----

query I rowsort
SELECT - 36 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-36
-36
-36

query I rowsort
SELECT ( 61 ) FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
61
61
61

query II rowsort
SELECT ALL + col0, + 81 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT ( - 59 ) IS NULL
----
15
81
91
81
92
81

query I rowsort
SELECT ALL + 9 FROM tab2 GROUP BY col0, col1, col1
----
9
9
9

query I rowsort
SELECT - col2 + + + col2 FROM tab1 GROUP BY col2, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - 41 col1 FROM tab0 AS cor0 GROUP BY col0
----
-41

query I rowsort
SELECT DISTINCT + col2 + + 17 FROM tab1 GROUP BY col2
----
25
62
88

query I rowsort
SELECT - 99 * - ( col0 ) AS col1 FROM tab1 GROUP BY col0
----
2178
2772
8118

query I rowsort
SELECT - ( - + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query II rowsort
SELECT - col1 * - - 10 AS col0, + 19 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-810
19
0
19

query I rowsort
SELECT ALL + + col0 * + AVG ( DISTINCT + 54 ) * - col0 AS col2 FROM tab2 cor0 WHERE NOT col2 * + 1 BETWEEN + ( + 63 ) AND - col0 GROUP BY col0 HAVING NOT ( - 34 ) IS NOT NULL
----

query I rowsort
SELECT + 53 FROM tab2 AS cor0 GROUP BY col1
----
53
53
53

query I rowsort
SELECT - 37 FROM tab1 AS cor0 WHERE NOT + 52 NOT IN ( + col2 * - + col0 - + 81 ) GROUP BY col1
----

query I rowsort
SELECT - col0 + + + col0 + - col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT 79 IS NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 30 col1 FROM tab1 AS cor0 WHERE NOT col0 / - - col0 IS NULL GROUP BY col2
----
30
30
30

query I rowsort
SELECT ALL 80 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + 79 * 20 IS NOT NULL
----

query I rowsort
SELECT - - ( col2 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - NULLIF ( 23, col2 - 58 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0 HAVING NOT 37 IS NULL
----
-23
-23
-23

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1057
SELECT + 32 * CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1057
SELECT + 32 * CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col0 + - 54 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
-137
-80
-97

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 30, + col0 ) - 2 FROM tab0 cor0 GROUP BY col2
----
28

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE ( - 94 ) < col2 GROUP BY col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1061
SELECT CAST( NULL AS SIGNED ) * - - col2 AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1061
SELECT CAST ( NULL AS INTEGER ) * - - col2 AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 31 FROM tab0 GROUP BY col1
----
31
31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1063
SELECT DISTINCT - CAST( NULL AS SIGNED ) col1 FROM tab2 GROUP BY col1 HAVING NOT ( - 47 ) IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1063
SELECT DISTINCT - CAST ( NULL AS INTEGER ) col1 FROM tab2 GROUP BY col1 HAVING NOT ( - 47 ) IS NULL
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 58 + - 50 col1 FROM tab1 GROUP BY col2
----
-108
-108
-108

query I rowsort
SELECT col2 * - col2 + 37 FROM tab2 GROUP BY col2 HAVING NOT ( 87 ) IS NULL
----
-3327
-6204
-7532

query I rowsort
SELECT + ( col2 ) FROM tab0 WHERE - col2 * col2 + - 18 IS NULL GROUP BY col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1069
SELECT ALL - CAST( NULL AS SIGNED ) + - - col2 + col2 * - + 97 + - 79 AS col1 FROM tab2 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1069
SELECT ALL - CAST ( NULL AS INTEGER ) + - - col2 + col2 * - + 97 + - 79 AS col1 FROM tab2 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 + 25 FROM tab0 WHERE ( + 97 ) >= - col2 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 49 - + 77 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-28
-28
-28

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - 75 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-75
-75
-75

query I rowsort
SELECT ALL + 44 + - + col1 * - - ( col1 ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-6517
44
44

query I rowsort
SELECT - col0 - + - col2 FROM tab2 GROUP BY col0, col2 HAVING NOT ( + col2 * 27 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1076
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING CAST( + col2 AS SIGNED ) * + col2 BETWEEN NULL AND - 98
----

skipif mysql # not compatible
query I rowsort label-1076
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING CAST ( + col2 AS INTEGER ) * + col2 BETWEEN NULL AND - 98
----

query I rowsort
SELECT - 7 + - - 14 AS col1 FROM tab2 GROUP BY col0 HAVING - + col0 IS NOT NULL
----
7
7
7

onlyif mysql # DIV for integer division: 
query I rowsort label-1078
SELECT col0 DIV col0 FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1078
SELECT col0 / col0 FROM tab2 GROUP BY col0
----
1
1
1

query I rowsort
SELECT 14 AS col2 FROM tab0 GROUP BY col1
----
14
14

query I rowsort
SELECT DISTINCT - 50 AS col2 FROM tab0 cor0 GROUP BY col1
----
-50

query I rowsort
SELECT DISTINCT + 76 * - col1 FROM tab0 GROUP BY col1
----
-6156
0

onlyif mysql # DIV for integer division: 
query I rowsort label-1082
SELECT - - col0 DIV + - ( + 81 ) + col0 + col0 * + col0 * - ( - - col0 ) - + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
-10648
-21952
-551369

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1082
SELECT - - col0 / + - ( + 81 ) + col0 + col0 * + col0 * - ( - - col0 ) - + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
-10648
-21952
-551369

query I rowsort
SELECT + col2 + + + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col2 * - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - ( - 0 ) IS NOT NULL
----
-3422
-6320
-7656

query I rowsort
SELECT + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 * 29 / 30 IS NOT NULL
----

query I rowsort
SELECT + - 66 FROM tab1 cor0 GROUP BY col2, col2
----
-66
-66
-66

query I rowsort
SELECT - ( ( + col0 ) ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( - 90 ) IS NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1088
SELECT 53 DIV 44 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - 28 IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1088
SELECT 53 / 44 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - 28 IS NULL
----
1
1
1

query II rowsort
SELECT 56 AS col1, - col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 0 FROM tab1 GROUP BY col1 HAVING NOT - 0 NOT BETWEEN NULL AND 8 * 90
----

query I rowsort
SELECT DISTINCT col1 * - AVG ( col0 ) FROM tab1 GROUP BY col0, col1, col0 HAVING NOT CASE - 49 WHEN + col1 THEN 18 * col1 END IS NULL
----

query I rowsort
SELECT - col0 * - 3 AS col1 FROM tab0 GROUP BY col0
----
129
249
78

query I rowsort
SELECT 18 AS col2 FROM tab0 WHERE NULL NOT IN ( - 24 ) GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT 89 AS col1 FROM tab1 GROUP BY col1
----
89

onlyif mysql # DIV for integer division: 
query I rowsort label-1095
SELECT DISTINCT 35 DIV ( - col0 ) FROM tab2 GROUP BY col0
----
-2
0

skipif mysql # not compatible
query I rowsort label-1095
SELECT DISTINCT 35 / ( - col0 ) FROM tab2 GROUP BY col0
----
-2
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 95 * ( - col2 ) col1 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-5510
-7505
-8265

query I rowsort
SELECT ALL + 43 * + col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 * col1 AS col2 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NULL >= col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1099
SELECT DISTINCT CAST( NULL AS SIGNED ) col0 FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1099
SELECT DISTINCT CAST ( NULL AS INTEGER ) col0 FROM tab1 GROUP BY col2
----
NULL

query II rowsort
SELECT ALL + 50 * - + col0 AS col2, - col0 FROM tab1 GROUP BY col0
----
-1100
-22
-1400
-28
-4100
-82

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IN ( 74 + + 14 * + 45, 55 )
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT 89 < col0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + 90 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 col2, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT + - col1 + + 33 + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
112
71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1107
SELECT - col2 + CAST( CAST( NULL AS SIGNED ) AS SIGNED ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING - + 92 IS NULL
----

skipif mysql # not compatible
query I rowsort label-1107
SELECT - col2 + CAST ( CAST ( NULL AS INTEGER ) AS INTEGER ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING - + 92 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 73 col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + - 58 FROM tab0 WHERE col2 IS NOT NULL GROUP BY col0
----
-58
-58
-58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 52 * 54 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING + + 5 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1111
SELECT + + col2 DIV col2 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1111
SELECT + + col2 / col2 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT + 21 AS col2 FROM tab2 AS cor0 WHERE NOT + col0 BETWEEN col1 AND - col2 * - col2 GROUP BY col0
----
21

query II rowsort
SELECT - - 94 AS col2, + col2 * + ( 38 ) FROM tab2 cor0 GROUP BY col2, col0
----
94
2204
94
3002
94
3306

query II rowsort
SELECT col1, - col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT DISTINCT + + 88 * + AVG ( col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 91 + - 73 * + + col0 FROM tab1 GROUP BY col2, col0
----
-1515
-1953
-5895

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1117
SELECT + CAST( NULL AS DECIMAL ) * + + ( + + col1 ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1117
SELECT + CAST ( NULL AS REAL ) * + + ( + + col1 ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT 74 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1119
SELECT ALL - 40 + - + col2 * - + 16 FROM tab1 GROUP BY col2 HAVING NOT NULL > - CAST( + + 87 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-1119
SELECT ALL - 40 + - + col2 * - + 16 FROM tab1 GROUP BY col2 HAVING NOT NULL > - CAST ( + + 87 AS INTEGER )
----

query I rowsort
SELECT 69 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + 92 FROM tab0 AS cor0 GROUP BY col1, col1
----
92

query I rowsort
SELECT DISTINCT - - col0 - - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
0

query I rowsort
SELECT 91 FROM tab0 AS cor0 GROUP BY col0
----
91
91
91

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1, col1, col0
----
-81
0
0

query I rowsort
SELECT ALL 51 - + + col1 + - col1 AS col1 FROM tab1 GROUP BY col1
----
-37
-63
39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1126
SELECT DISTINCT - CAST( + 27 AS SIGNED ) FROM tab2 WHERE + col0 * - - col0 IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-1126
SELECT DISTINCT - CAST ( + 27 AS INTEGER ) FROM tab2 WHERE + col0 * - - col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT + ( - 79 ) / - - 50 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 27 * + 50 FROM tab2 GROUP BY col0
----
1350
1350
1350

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1130
SELECT DISTINCT 37 * - CAST( NULL AS SIGNED ) * - - 27 * + - 15 + + + col2, 52 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <> - 88
----

skipif mysql # not compatible
query II rowsort label-1130
SELECT DISTINCT 37 * - CAST ( NULL AS INTEGER ) * - - 27 * + - 15 + + + col2, 52 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <> - 88
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1131
SELECT + col1 * + col1 + - 42 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NOT + col1 * - col1 * + - CAST( NULL AS SIGNED ) * 43 IS NULL )
----

skipif mysql # not compatible
query I rowsort label-1131
SELECT + col1 * + col1 + - 42 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NOT + col1 * - col1 * + - CAST ( NULL AS INTEGER ) * 43 IS NULL )
----

query I rowsort
SELECT col0 * 74 * + + col0 FROM tab0 GROUP BY col0 HAVING - + 26 * - 93 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 + + - 88 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-17
-43
-80

query I rowsort
SELECT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1135
SELECT DISTINCT + CAST( NULL AS SIGNED ) col1 FROM tab2 GROUP BY col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1135
SELECT DISTINCT + CAST ( NULL AS INTEGER ) col1 FROM tab2 GROUP BY col1
----
NULL

query I rowsort
SELECT ALL 23 * col2 * + - col2 FROM tab0 GROUP BY col2, col2
----
-13248
-143543
-33212

query I rowsort
SELECT col0 + - + col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING + - col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + - 85 FROM tab1 AS cor0 GROUP BY col0, col2
----
-85
-85
-85

query I rowsort
SELECT DISTINCT - 74 FROM tab0 GROUP BY col0 HAVING NULL = NULL
----

query II rowsort
SELECT ALL col2 + + col2 * - 95 AS col2, col2 FROM tab1 GROUP BY col2
----
-4230
45
-6674
71
-752
8

query I rowsort
SELECT DISTINCT col2 + - + ( col2 ) + col2 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT - - 69 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
69
69
69

query I rowsort
SELECT ALL + 70 * 34 * - + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - 97 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( - + col1, col1 * - col1 )
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING NOT - 95 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * + 58 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
3364
4582
5046

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1148
SELECT - col0 * 22 AS col1 FROM tab1 cor0 WHERE NOT col2 + - CAST( NULL AS SIGNED ) * + + col2 - + + col1 <> NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-1148
SELECT - col0 * 22 AS col1 FROM tab1 cor0 WHERE NOT col2 + - CAST ( NULL AS INTEGER ) * + + col2 - + + col1 <> NULL GROUP BY col0
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 WHERE + COALESCE ( + + col0, - - col2 ) <= CASE - col2 WHEN + col2 THEN - ( - col0 ) END GROUP BY col0, col1 HAVING NOT 84 = NULL
----

query I rowsort
SELECT + 56 * col2 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
188384
349496
423864

query I rowsort
SELECT DISTINCT - 9 + + + col1 AS col0 FROM tab1 GROUP BY col1
----
-3
35
48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * - col1 col0 FROM tab2 GROUP BY col2, col1 HAVING ( + col2 + col1 ) <= + col1
----

query I rowsort
SELECT ALL - col1 - + col1 AS col2 FROM tab2 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT 53 FROM tab1 WHERE ( col2 ) IS NOT NULL GROUP BY col1, col0 HAVING 92 NOT BETWEEN ( 93 ) AND - col0 + col1
----
53
53
53

query I rowsort
SELECT + col1 + - + col2 FROM tab0 GROUP BY col2, col1
----
-38
-79
57

query I rowsort
SELECT DISTINCT col2 * col1 + - col2 * col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING NOT col2 IS NULL
----
0

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + 21 FROM tab0 AS cor0 GROUP BY col0, col0
----
21
21
21

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
38
79

query I rowsort
SELECT ALL - 23 AS col0 FROM tab0 cor0 GROUP BY col1, col1 HAVING NULL NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL col2 * 48 - 9 FROM tab0 WHERE NOT ( NULL ) > + col0 GROUP BY col2, col1
----

query I rowsort
SELECT ALL ( + - 47 ) FROM tab0 GROUP BY col2
----
-47
-47
-47

query I rowsort
SELECT col2 FROM tab2 cor0 WHERE NULL BETWEEN col0 AND ( + col2 - 75 * col0 ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT col1 + - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1166
SELECT ALL + 59 * - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) BETWEEN - 58 + - col0 * CASE CAST( - col2 AS SIGNED ) / col0 WHEN ( 22 ) THEN - 82 WHEN + col0 + + 86 THEN 98 END AND - 19 GROUP BY col2, col0 HAVING NOT NULL >= col0 * - col0
----

skipif mysql # not compatible
query I rowsort label-1166
SELECT ALL + 59 * - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) BETWEEN - 58 + - col0 * CASE CAST ( - col2 AS INTEGER ) / col0 WHEN ( 22 ) THEN - 82 WHEN + col0 + + 86 THEN 98 END AND - 19 GROUP BY col2, col0 HAVING NOT NULL >= col0 * - col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1167
SELECT - - ( - CAST( NULL AS SIGNED ) ) * 67 AS col1 FROM tab1 AS cor0 WHERE NOT 91 IS NULL GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1167
SELECT - - ( - CAST ( NULL AS INTEGER ) ) * 67 AS col1 FROM tab1 AS cor0 WHERE NOT 91 IS NULL GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-1168
SELECT - + 6 + - - col2 * 1 DIV + col2 FROM tab0 cor0 GROUP BY col2
----
-5
-5
-5

skipif mysql # not compatible
query I rowsort label-1168
SELECT - + 6 + - - col2 * 1 / + col2 FROM tab0 cor0 GROUP BY col2
----
-5
-5
-5

query I rowsort
SELECT DISTINCT + - col2 + col2 + - 42 * - 1 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - ( col2 ) ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1170
SELECT DISTINCT + 33 AS col1 FROM tab2 WHERE - 36 IN ( col1 ) GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) - ( - col1 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-1170
SELECT DISTINCT + 33 AS col1 FROM tab2 WHERE - 36 IN ( col1 ) GROUP BY col1 HAVING NOT - CAST ( NULL AS INTEGER ) - ( - col1 ) IS NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1172
SELECT col0 DIV + ( - 15 ) FROM tab0 GROUP BY col0 HAVING NOT ( - 42 ) IS NULL
----
-1
-2
-5

skipif mysql # not compatible
query I rowsort label-1172
SELECT col0 / + ( - 15 ) FROM tab0 GROUP BY col0 HAVING NOT ( - 42 ) IS NULL
----
-1
-2
-5

query I rowsort
SELECT ALL - col0 * - + col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + 89 IS NULL
----
132
1596
3608

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 7 col0 FROM tab2 GROUP BY col2
----
7
7
7

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 WHERE ( col0 ) NOT IN ( col2 ) GROUP BY col0, col0, col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1177
SELECT DISTINCT + - 32 * - CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING + + 0 IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-1177
SELECT DISTINCT + - 32 * - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING + + 0 IS NOT NULL
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1178
SELECT 57 AS col1 FROM tab1 WHERE NOT NULL NOT IN ( + col2 * - col1 * - col0 + - col1 - + + CAST( NULL AS SIGNED ), - col0, - + 30 - + 35 ) GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1178
SELECT 57 AS col1 FROM tab1 WHERE NOT NULL NOT IN ( + col2 * - col1 * - col0 + - col1 - + + CAST ( NULL AS INTEGER ), - col0, - + 30 - + 35 ) GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 + - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT + 16 FROM tab1 cor0 GROUP BY col0, col0
----
16

query II rowsort
SELECT + col0 AS col2, + col1 FROM tab2 cor0 GROUP BY col1, col0
----
15
61
91
59
92
41

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= ( - 16 )
----

query I rowsort
SELECT - 86 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-86
-86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST( NULL AS SIGNED ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST ( NULL AS INTEGER ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

query I rowsort
SELECT DISTINCT 85 FROM tab0 GROUP BY col1, col0
----
85

query I rowsort
SELECT ALL col1 - col1 * - ( - col1 ) FROM tab1 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1187
SELECT DISTINCT + col2 + - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1187
SELECT DISTINCT + col2 + - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col2, col1
----
-22
-28
-82

query I rowsort
SELECT ALL + col0 + + col0 * col0 FROM tab0 GROUP BY col0
----
1892
6972
702

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-1190
SELECT 93 * col0 FROM tab2 AS cor0 WHERE NOT + CAST( CAST( - 34 AS DECIMAL ) AS DECIMAL ) <> CAST( + col0 AS SIGNED ) * + col0 GROUP BY col0 HAVING NOT 97 IN ( - 39 )
----

skipif mysql # not compatible
query I rowsort label-1190
SELECT 93 * col0 FROM tab2 AS cor0 WHERE NOT + CAST ( CAST ( - 34 AS REAL ) AS REAL ) <> CAST ( + col0 AS INTEGER ) * + col0 GROUP BY col0 HAVING NOT 97 IN ( - 39 )
----

query I rowsort
SELECT col2 + + col2 AS col0 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT + 40 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
40
40
40

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1193
SELECT DISTINCT ( - col1 ) + 81 FROM tab2 AS cor0 WHERE - col1 * - CAST( NULL AS SIGNED ) + - col1 IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-1193
SELECT DISTINCT ( - col1 ) + 81 FROM tab2 AS cor0 WHERE - col1 * - CAST ( NULL AS INTEGER ) + - col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - ( - 8 ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - col1 + + 16 FROM tab2 AS cor0 GROUP BY col2, col1
----
-25
-43
-45

query I rowsort
SELECT 85 FROM tab2 GROUP BY col2, col0
----
85
85
85

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 - + col0 col1 FROM tab0 AS cor0 WHERE NULL NOT IN ( - col1 ) GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1199
SELECT ALL 29 DIV + col0 AS col1 FROM tab1 GROUP BY col0
----
0
1
1

skipif mysql # not compatible
query I rowsort label-1199
SELECT ALL 29 / + col0 AS col1 FROM tab1 GROUP BY col0
----
0
1
1

query I rowsort
SELECT ALL - ( + col0 ) AS col1 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT - col1 + - col2 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1202
SELECT - 21, CAST( NULL AS SIGNED ) + + col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1202
SELECT - 21, CAST ( NULL AS INTEGER ) + + col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 > NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 68 * + + 88 AS col0 FROM tab0 GROUP BY col2, col0
----
-5984

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1205
SELECT DISTINCT + CAST( + - 92 AS SIGNED ) AS col2 FROM tab2 GROUP BY col2, col0
----
-92

skipif mysql # not compatible
query I rowsort label-1205
SELECT DISTINCT + CAST ( + - 92 AS INTEGER ) AS col2 FROM tab2 GROUP BY col2, col0
----
-92

query II rowsort
SELECT 83, + NULLIF ( + 73, + 25 ) * - 41 * col2 AS col0 FROM tab1 GROUP BY col2
----
83
-134685
83
-212503
83
-23944

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1207
SELECT + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1 HAVING + 79 IS NOT NULL
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1207
SELECT + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1 HAVING + 79 IS NOT NULL
----
NULL
NULL

query I rowsort
SELECT ALL + - col2 + - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-142
-16
-90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1209
SELECT 10 + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1209
SELECT 10 + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2, col1 HAVING + 71 >= NULLIF ( - 46, col1 ) OR ( NOT NULL < col1 - - + col2 )
----
41
59
61

query I rowsort
SELECT + ( + col2 ) + - - 36 FROM tab0 AS cor0 GROUP BY col0, col2
----
115
60
74

query I rowsort
SELECT DISTINCT + ( - + col2 ) AS col2 FROM tab2 WHERE NULL NOT BETWEEN - - col2 AND NULL GROUP BY col2
----

query I rowsort
SELECT ALL 53 * col2 FROM tab1 GROUP BY col2
----
2385
3763
424

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1214
SELECT ALL - CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col1, col0 HAVING col1 + - 81 IS NULL
----

skipif mysql # not compatible
query I rowsort label-1214
SELECT ALL - CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col1, col0 HAVING col1 + - 81 IS NULL
----

query I rowsort
SELECT ALL col0 + - ( col0 ) + + + 40 + 45 AS col1 FROM tab1 GROUP BY col1, col0
----
85
85
85

query II rowsort
SELECT + ( + + col0 ) AS col0, - 44 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
-44
28
-44
82
-44

query I rowsort
SELECT DISTINCT 86 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + + + col1 * - col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1640
-3422
-3660

query I rowsort
SELECT ALL 43 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
43
43
43

query I rowsort
SELECT DISTINCT 28 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
28

query I rowsort
SELECT - 87 FROM tab1 AS cor0 GROUP BY col2
----
-87
-87
-87

query I rowsort
SELECT col2 * col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - ( 78 ) - + 41 FROM tab1 GROUP BY col1, col1
----
-119
-119
-119

query II rowsort
SELECT DISTINCT col1 - - col1 AS col0, 39 - col1 AS col2 FROM tab2 GROUP BY col1, col1
----
118
-20
122
-22
82
-2

query I rowsort
SELECT ALL - 85 * - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
2210
3655
7055

query I rowsort
SELECT ALL col2 * + 72 AS col2 FROM tab2 cor0 GROUP BY col2
----
4176
5688
6264

onlyif mysql # DIV for integer division: 
query I rowsort label-1227
SELECT + col2 DIV + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1227
SELECT + col2 / + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT col2 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1229
SELECT ALL - - CAST( NULL AS DECIMAL ) + - CASE - 79 WHEN 2 THEN NULL ELSE col2 + + 11 END FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1229
SELECT ALL - - CAST ( NULL AS REAL ) + - CASE - 79 WHEN 2 THEN NULL ELSE col2 + + 11 END FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + ( + - col2 ) AS col1 FROM tab0 GROUP BY col2
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1231
SELECT CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-1231
SELECT CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 93 AS col0 FROM tab0 GROUP BY col1
----
93
93

query I rowsort
SELECT DISTINCT + - 30 AS col0 FROM tab0 WHERE NOT col0 * + col1 IS NULL GROUP BY col2
----
-30

query I rowsort
SELECT - 28 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - - 14 * + 11 IS NULL
----
-28
-28
-28

query I rowsort
SELECT DISTINCT 56 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 + - col2 * + + ( + - col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL = - - col2
----

query I rowsort
SELECT ALL - ( col1 ) + - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT - 72 - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT - 22 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT - col2 NOT IN ( + ( - col0 ) + - col0 )
----

query I rowsort
SELECT DISTINCT - ( + col1 ) AS col2 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - 82 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL ( + 97 ) * - - 80 + col1 + col1 FROM tab0 AS cor0 GROUP BY col1
----
7760
7922

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT col0 <= - 19
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1248
SELECT - + col2 * + - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1248
SELECT - + col2 * + - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 96 FROM tab0 cor0 GROUP BY col0, col0
----
96
96
96

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col2
----

query II rowsort
SELECT - col2, 84 + - col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-24
41
-38
1
-79
58

query I rowsort
SELECT DISTINCT 45 * col1 FROM tab1 GROUP BY col1, col1
----
1980
2565
270

query I rowsort
SELECT - 88 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-88
-88
-88

query I rowsort
SELECT - col1 * - col1 - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
-41
-59
-61

query I rowsort
SELECT 82 FROM tab2 WHERE NOT - 1 IS NULL GROUP BY col2 HAVING 90 IS NOT NULL
----
82
82
82

query I rowsort
SELECT ALL - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1258
SELECT col0 + - CAST( NULL AS SIGNED ) + - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1258
SELECT col0 + - CAST ( NULL AS INTEGER ) + - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 63 + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
144
63

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

query II rowsort
SELECT 2 * - col0, - col2 * - + 82 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
-164
5822
-44
656
-56
3690

query I rowsort
SELECT ALL ( + col0 ) AS col0 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 * + col0 * + col0 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
3360
753480
778596

query I rowsort
SELECT col0 + - 82 FROM tab0 AS cor0 GROUP BY col0
----
-39
-56
1

query II rowsort
SELECT DISTINCT 39 AS col0, + col2 - + - ( - 7 ) * + - col2 + - col2 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NULL
----
39
315
39
497
39
56

query I rowsort
SELECT - ( col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - 74 AS col2 FROM tab1 cor0 GROUP BY col1
----
-74
-74
-74

query I rowsort
SELECT col1 FROM tab0 WHERE - col1 + - NULLIF ( 52, + - ( col0 ) ) IN ( col0 ) GROUP BY col2, col1 HAVING NOT + 49 - col2 IS NULL
----

query I rowsort
SELECT DISTINCT 21 FROM tab1 WHERE NOT + col1 * - + 81 + + + ( - col2 ) NOT IN ( - col1 / - - 24 * - 4 ) GROUP BY col2, col2, col1
----

query I rowsort
SELECT ALL - col1 * - - col1 AS col2 FROM tab0 WHERE NOT - + col1 > NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 6 AS col1, + 85 col2 FROM tab1 GROUP BY col2
----
6
85

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1272
SELECT 71 + - - col1 + + CAST( + + CAST( - col1 AS SIGNED ) AS SIGNED ) FROM tab0 GROUP BY col1, col0, col1
----
71
71
71

skipif mysql # not compatible
query I rowsort label-1272
SELECT 71 + - - col1 + + CAST ( + + CAST ( - col1 AS INTEGER ) AS INTEGER ) FROM tab0 GROUP BY col1, col0, col1
----
71
71
71

query III rowsort
SELECT - 74 AS col1, col0 * + 6, - + 87 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
9 values hashing to 82400da0118fb9c47ba34b8a43a08ad9

query I rowsort
SELECT DISTINCT + 67 FROM tab2 GROUP BY col2, col0, col1 HAVING NULL IS NULL
----
67

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT + - col0 + + col2 + - col1 + + + col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * 45 + - + ( + col0 ) + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( AVG ( ALL + col0 ) ) IS NULL
----

query I rowsort
SELECT ALL + 32 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + 84 FROM tab0 cor0 GROUP BY col2, col2 HAVING NOT - col2 NOT BETWEEN ( - 13 ) AND col2 + - - 56
----

query I rowsort
SELECT + col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT - col2 IS NULL
----
484
6724
784

query I rowsort
SELECT - col0 + - - col0 * col0 + + - col0 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL - 90 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL >= 81
----

query I rowsort
SELECT - 9 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
-9
-9
-9

query I rowsort
SELECT DISTINCT + - col0 * + + 64 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
-5824
-5888
-960

query I rowsort
SELECT ALL - - 36 FROM tab2 cor0 GROUP BY col2, col0
----
36
36
36

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT - col0 IS NULL
----
22
28
82

query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE NULL < + col0 + - col0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1287
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT + - col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1287
SELECT CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT + - col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0 HAVING NULL BETWEEN - - 83 * AVG ( DISTINCT col1 ) AND + ( - + col0 )
----

query I rowsort
SELECT col1 * + - 89 AS col1 FROM tab2 GROUP BY col1, col2
----
-3649
-5251
-5429

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1290
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-1290
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 76 col2 FROM tab0 GROUP BY col1, col0
----
76
76
76

query I rowsort
SELECT - - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT 96 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 - + 12 col0 FROM tab1 AS cor0 GROUP BY col1
----
-6
32
45

query I rowsort
SELECT DISTINCT - 62 FROM tab0 AS cor0 GROUP BY col2, col2, col0 HAVING + ( + col2 ) * + col0 IS NOT NULL
----
-62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1295
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST( NULL AS SIGNED ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1295
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST ( NULL AS INTEGER ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 85 FROM tab1 GROUP BY col0
----
85
85
85

query I rowsort
SELECT DISTINCT 23 AS col0 FROM tab2 GROUP BY col2
----
23

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1298
SELECT ALL CAST( NULL AS SIGNED ) + col2 + + col2 col1 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1298
SELECT ALL CAST ( NULL AS INTEGER ) + col2 + + col2 col1 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT ALL + 56 AS col0, 51 * col1 FROM tab0 GROUP BY col1 HAVING NOT + 30 * + 69 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 50 col2, + col0 * + + 69 * - + col0 * ( + + col0 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT 26 * + col2 + - col2 + + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING ( ( NULL > NULL ) )
----

query II rowsort
SELECT ALL + 0, - col2 FROM tab2 AS cor0 WHERE ( NOT 32 IS NOT NULL ) GROUP BY col2
----

query I rowsort
SELECT 37 / - ( + col0 ) AS col1 FROM tab2 AS cor0 WHERE NULL < NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL col0 - + 95 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-13
-67
-73

query II rowsort
SELECT DISTINCT col1 + - col1 - col1 - + 69 AS col1, + 8 FROM tab1 AS cor0 GROUP BY col1
----
-113
8
-126
8
-75
8

query I rowsort
SELECT - ( 97 ) * + col0 FROM tab0 AS cor0 GROUP BY col0
----
-2522
-4171
-8051

query I rowsort
SELECT + 50 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
108
129
137

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1308
SELECT DISTINCT ( COALESCE ( - + col2, col2 ) ) AS col0, + col2 FROM tab2 AS cor0 WHERE 29 * + col1 * + + 34 * 24 + + - NULLIF ( - col0, + + col0 ) >= - col0 GROUP BY col2 HAVING NOT ( + CAST( NULL AS SIGNED ) ) BETWEEN + col2 AND NULL
----

skipif mysql # not compatible
query II rowsort label-1308
SELECT DISTINCT ( COALESCE ( - + col2, col2 ) ) AS col0, + col2 FROM tab2 AS cor0 WHERE 29 * + col1 * + + 34 * 24 + + - NULLIF ( - col0, + + col0 ) >= - col0 GROUP BY col2 HAVING NOT ( + CAST ( NULL AS INTEGER ) ) BETWEEN + col2 AND NULL
----

query I rowsort
SELECT ALL + - 54 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
-54
-54
-54

query I rowsort
SELECT col2 * + ( + 84 ) FROM tab0 GROUP BY col1, col2
----
2016
3192
6636

query I rowsort
SELECT 15 AS col0 FROM tab2 GROUP BY col2
----
15
15
15

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING + col2 < NULL
----

query I rowsort
SELECT DISTINCT - 22 * + 29 AS col1 FROM tab0 GROUP BY col1
----
-638

query I rowsort
SELECT - 20 * 70 + - col2 FROM tab2 GROUP BY col2
----
-1458
-1479
-1487

query I rowsort
SELECT + 40 AS col2 FROM tab1 GROUP BY col0
----
40
40
40

query I rowsort
SELECT - col2 * - 11 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
495
781
88

query I rowsort
SELECT ALL - col2 / - ( - - col2 ) AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 * - 67 + + col1 + + col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
3036
3933
414

query I rowsort
SELECT DISTINCT NULLIF ( - col0, - 99 ) AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col2 - + + col0 AS col0 FROM tab1 GROUP BY col0, col2, col0
----
-153
-30
-73

query II rowsort
SELECT + + col2, 61 FROM tab1 AS cor0 GROUP BY col2
----
45
61
71
61
8
61

query I rowsort
SELECT ALL 24 FROM tab2 GROUP BY col1, col1
----
24
24
24

query I rowsort
SELECT + col2 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab2 WHERE + 13 <> NULL GROUP BY col2
----

query I rowsort
SELECT + 0 - + col0 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1326
SELECT 73 AS col0 FROM tab1 GROUP BY col2 HAVING + COALESCE ( + - col2, + - CAST( NULL AS SIGNED ) ) < NULL
----

skipif mysql # not compatible
query I rowsort label-1326
SELECT 73 AS col0 FROM tab1 GROUP BY col2 HAVING + COALESCE ( + - col2, + - CAST ( NULL AS INTEGER ) ) < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1327
SELECT + col0 + CAST( NULL AS SIGNED ) + - + 14 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1327
SELECT + col0 + CAST ( NULL AS INTEGER ) + - + 14 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 58 col1 FROM tab0 cor0 GROUP BY col1, col2, col2
----
58
58
58

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 90 * + col2 AS col2 FROM tab1 GROUP BY col0, col2
----
4050
6390
720

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + col1 + - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * + col1 * - col1 col0 FROM tab2 cor0 GROUP BY col1
----
-205379
-226981
-68921

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - 48 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-48

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1335
SELECT 51 * - + 44, CAST( NULL AS SIGNED ) / - - col2 * + col1 col0 FROM tab2 GROUP BY col2, col1 HAVING NOT ( + 14 * + col2 ) IS NULL
----
-2244
NULL
-2244
NULL
-2244
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1335
SELECT 51 * - + 44, CAST ( NULL AS INTEGER ) / - - col2 * + col1 col0 FROM tab2 GROUP BY col2, col1 HAVING NOT ( + 14 * + col2 ) IS NULL
----
-2244
NULL
-2244
NULL
-2244
NULL

query I rowsort
SELECT ALL - 24 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL < - 40
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col2 + + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING - 54 + + + 27 IS NOT NULL
----
-116
-158
-174

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT - 88 + + - col1 IS NULL
----
41
59
61

query I rowsort
SELECT ALL ( - col0 ) - + col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - ( - col1 ) FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + 82 IS NOT NULL
----

query I rowsort
SELECT - 54 + col0 AS col0 FROM tab2 GROUP BY col0
----
-39
37
38

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
-24
-38
-79

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1347
SELECT DISTINCT - col1 * + CAST( - - 52 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col1
----
-4212
0

skipif mysql # not compatible
query I rowsort label-1347
SELECT DISTINCT - col1 * + CAST ( - - 52 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col1
----
-4212
0

query I rowsort
SELECT col0 * 10 * - NULLIF ( 42, - 40 ) AS col2 FROM tab1 GROUP BY col0
----
-11760
-34440
-9240

query I rowsort
SELECT 38 - ( col1 ) * - - 87 * col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-570769
38

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-1350
SELECT - col0 AS col1 FROM tab0 WHERE col1 + ( + 68 ) - + + CAST( + + col2 AS DECIMAL ) NOT IN ( - col2, CAST( NULL AS SIGNED ) - col0 * + col0, - col2 - + - col0, - col1 * - - col2 + col2 + + 23 ) GROUP BY col0, col1 HAVING NOT - CAST( CAST( - 62 AS SIGNED ) AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1350
SELECT - col0 AS col1 FROM tab0 WHERE col1 + ( + 68 ) - + + CAST ( + + col2 AS REAL ) NOT IN ( - col2, CAST ( NULL AS INTEGER ) - col0 * + col0, - col2 - + - col0, - col1 * - - col2 + col2 + + 23 ) GROUP BY col0, col1 HAVING NOT - CAST ( CAST ( - 62 AS INTEGER ) AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT AVG ( + 74 ) AS col2 FROM tab0 GROUP BY col1 HAVING + 73 IS NULL
----

query I rowsort
SELECT + 51 FROM tab0 WHERE + - ( col1 ) NOT IN ( - col2 ) GROUP BY col1
----
51
51

query I rowsort
SELECT 75 * + - 36 * - - col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT col0 = ( col0 )
----

query I rowsort
SELECT + 76 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + 43 * + col0 IS NULL
----

query I rowsort
SELECT ALL - col0 / ( - col0 ) * col0 FROM tab1 AS cor0 WHERE col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col0 + + + 93 * + col0 * + + 95 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = + 45
----

query II rowsort
SELECT DISTINCT + 44, + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
44
22
44
28
44
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1359
SELECT - CAST( NULL AS SIGNED ) * col1 + 82 / + col1 AS col2 FROM tab2 cor0 WHERE ( COALESCE ( + 19, - col0 * + 21 * + 64, CAST( 66 AS SIGNED ) ) * 70 + - 44 ) IS NOT NULL GROUP BY col1 HAVING ( NULL ) BETWEEN ( + 58 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-1359
SELECT - CAST ( NULL AS INTEGER ) * col1 + 82 / + col1 AS col2 FROM tab2 cor0 WHERE ( COALESCE ( + 19, - col0 * + 21 * + 64, CAST ( 66 AS INTEGER ) ) * 70 + - 44 ) IS NOT NULL GROUP BY col1 HAVING ( NULL ) BETWEEN ( + 58 ) AND NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT 92 + + + col2 FROM tab2 GROUP BY col2, col1
----
150
171
179

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL >= ( NULL )
----

query II rowsort
SELECT ( + col0 ) AS col2, col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT 60 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
60

query I rowsort
SELECT ALL - col2 + col2 FROM tab2 GROUP BY col2, col1 HAVING 21 IS NOT NULL
----
0
0
0

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING 2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 42 col0 FROM tab2 GROUP BY col0, col1 HAVING + 55 - col0 + + col0 BETWEEN + 69 AND - col1
----

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1370
SELECT DISTINCT - + col1 FROM tab0 cor0 WHERE - 65 * + col2 <= - CAST( - col2 AS SIGNED ) + + col0 GROUP BY col1
----
-81
0

skipif mysql # not compatible
query I rowsort label-1370
SELECT DISTINCT - + col1 FROM tab0 cor0 WHERE - 65 * + col2 <= - CAST ( - col2 AS INTEGER ) + + col0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 AS cor0 WHERE NOT + col2 > NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + 0 * col1 + - 73 FROM tab0 AS cor0 GROUP BY col1
----
-73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1373
SELECT - CAST( NULL AS SIGNED ) / col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( + col0 + 79 ) BETWEEN NULL AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-1373
SELECT - CAST ( NULL AS INTEGER ) / col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( + col0 + 79 ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - + col2 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST( + col0 AS SIGNED ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST( NULL AS SIGNED ) - col1 / - col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( + col0 AS INTEGER ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST ( NULL AS INTEGER ) - col1 / - col0
----

query I rowsort
SELECT DISTINCT - 53 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
-53

query I rowsort
SELECT - + NULLIF ( 41, 72 ) * - col1 FROM tab0 WHERE NOT - col2 / 19 = NULL GROUP BY col1, col1
----

query I rowsort
SELECT 89 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL OR + col0 / + NULLIF ( + 87 * col0, col0 / 59 ) > ( NULL )
----

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT + - col1 * + 29 + - ( - col1 ) * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-138
1596
660

query I rowsort
SELECT 32 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1382
SELECT + CAST( NULL AS SIGNED ) * - col0 FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1382
SELECT + CAST ( NULL AS INTEGER ) * - col0 FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT col2, col1 - + col1 FROM tab2 GROUP BY col1, col2 HAVING col2 IS NOT NULL
----
58
0
79
0
87
0

query I rowsort
SELECT - ( - + col1 ) * + 23 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
1863

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING - 73 * + 17 + - col0 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( col0 ) NOT BETWEEN ( NULL ) AND ( col1 )
----

query I rowsort
SELECT + 59 + + col1 AS col2 FROM tab2 GROUP BY col1, col1
----
100
118
120

query I rowsort
SELECT - col2 - + col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT + 45 * 17 - + col1 AS col0 FROM tab0 GROUP BY col1
----
684
765

query I rowsort
SELECT ALL - ( 51 ) AS col2 FROM tab2 GROUP BY col2, col0 HAVING 82 * - ( - col2 ) + 64 BETWEEN 97 AND col0
----

query I rowsort
SELECT ALL + 22 + 83 * - col0 FROM tab0 GROUP BY col0
----
-2136
-3547
-6867

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( col1 ) BETWEEN ( + col2 ) AND ( NULL )
----

query I rowsort
SELECT ALL + 60 AS col0 FROM tab2 GROUP BY col2
----
60
60
60

query I rowsort
SELECT + col0 * 96 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
2496
4128
7968

onlyif mysql # DIV for integer division: 
query I rowsort label-1396
SELECT 16 - - col0 + + ( 15 - col0 ) DIV 2 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
37
45
65

skipif mysql # not compatible
query I rowsort label-1396
SELECT 16 - - col0 + + ( 15 - col0 ) / 2 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
37
45
65

onlyif mysql # DIV for integer division: 
query I rowsort label-1397
SELECT DISTINCT ( - + col0 ) DIV col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( 11 ) IS NOT NULL
----
-1

skipif mysql # not compatible
query I rowsort label-1397
SELECT DISTINCT ( - + col0 ) / col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( 11 ) IS NOT NULL
----
-1

query I rowsort
SELECT + 94 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 22 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
22
22
22

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1400
SELECT ALL col2 * CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1400
SELECT ALL col2 * CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + - 21 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-21

query I rowsort
SELECT DISTINCT - + COALESCE ( - col0, 88 ) FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT 96 AS col1 FROM tab1 GROUP BY col2 HAVING ( NOT NULL < NULL )
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
1681
3481
3721

onlyif mysql # DIV for integer division: 
query I rowsort label-1406
SELECT DISTINCT - 78 DIV + col2 AS col2 FROM tab1 GROUP BY col2
----
-1
-9

skipif mysql # not compatible
query I rowsort label-1406
SELECT DISTINCT - 78 / + col2 AS col2 FROM tab1 GROUP BY col2
----
-1
-9

query I rowsort
SELECT - 62 + + col0 AS col1 FROM tab2 GROUP BY col0
----
-47
29
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 98 col0 FROM tab1 WHERE NOT + col0 BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col1 - - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + + AVG ( + col2 ) AND NULL
----

query I rowsort
SELECT + - AVG ( DISTINCT 83 ) FROM tab1 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1412
SELECT + CAST( - 38 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
-38
-38
-38

skipif mysql # not compatible
query I rowsort label-1412
SELECT + CAST ( - 38 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
-38
-38
-38

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1413
SELECT DISTINCT - col2 + CAST( col2 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
0

skipif mysql # not compatible
query I rowsort label-1413
SELECT DISTINCT - col2 + CAST ( col2 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
0

query I rowsort
SELECT + 37 FROM tab0 AS cor0 GROUP BY col2
----
37
37
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1415
SELECT + CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-1415
SELECT + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1416
SELECT DISTINCT 74 FROM tab2 WHERE NOT + NULLIF ( + + col1, - col0 ) >= - + CAST( - ( - - col2 ) AS DECIMAL ) GROUP BY col1, col1
----
74

skipif mysql # not compatible
query I rowsort label-1416
SELECT DISTINCT 74 FROM tab2 WHERE NOT + NULLIF ( + + col1, - col0 ) >= - + CAST ( - ( - - col2 ) AS REAL ) GROUP BY col1, col1
----
74

query I rowsort
SELECT DISTINCT - col2 + 63 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-8
18
55

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 / + - col0 + col0 AS col1, - 82 col1 FROM tab1 AS cor0 GROUP BY col0
----
21
-82
27
-82
81
-82

query I rowsort
SELECT - 16 AS col0 FROM tab1 GROUP BY col2
----
-16
-16
-16

query I rowsort
SELECT ALL - - 32 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
32
32
32

query I rowsort
SELECT DISTINCT + 40 FROM tab0 GROUP BY col2, col2
----
40

query I rowsort
SELECT 31 + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
110
118
89

query I rowsort
SELECT DISTINCT 4 AS col0 FROM tab2 GROUP BY col2 HAVING NOT - - ( col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE NULL <> - 2 GROUP BY col0, col1
----

query I rowsort
SELECT ( col0 ) * + - col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT + 48 - + + col2 - + - col2 * - 58 * - 51 AS col1 FROM tab2 cor0 GROUP BY col2
----
171554
233651
257307

query I rowsort
SELECT ALL col2 * - 30 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1305
-2059
-232

query I rowsort
SELECT + 89 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
89
89
89

query II rowsort
SELECT - 63 AS col0, + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL < - col1
----

query I rowsort
SELECT ALL - 54 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - + col2 * 79 * col2 IS NOT NULL
----
-54
-54
-54

onlyif mysql # DIV for integer division: 
query II rowsort label-1431
SELECT DISTINCT - 16 AS col2, col2 DIV - col2 col2 FROM tab1 GROUP BY col1, col2
----
-16
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1431
SELECT DISTINCT - 16 AS col2, col2 / - col2 col2 FROM tab1 GROUP BY col1, col2
----
-16
-1

query I rowsort
SELECT ALL + ( + col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT - 38 FROM tab1 AS cor0 GROUP BY col2, col2, col0
----
-38
-38
-38

query I rowsort
SELECT ALL + 18 AS col2 FROM tab0 GROUP BY col0, col2 HAVING - + col0 IS NOT NULL
----
18
18
18

query I rowsort
SELECT ALL - 38 AS col2 FROM tab2 GROUP BY col0
----
-38
-38
-38

query I rowsort
SELECT DISTINCT + NULLIF ( - + 12, + ( + col0 ) ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-12

query I rowsort
SELECT ALL + 87 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 79 col0 FROM tab2 GROUP BY col0, col0
----
79

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING 72 + - 80 + - - 45 <= 90
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL AND COALESCE ( 5, - + NULLIF ( + 8, + + col1 ) ) IS NOT NULL
----

query II rowsort
SELECT DISTINCT 47, 94 AS col2 FROM tab1 GROUP BY col1, col2
----
47
94

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 33 col2 FROM tab2 GROUP BY col1
----
33

query I rowsort
SELECT DISTINCT - col0 * - 96 FROM tab0 GROUP BY col0
----
2496
4128
7968

query I rowsort
SELECT + - 31 + + col1 + - col2 - - ( - col0 ) FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NOT + col1 = NULL
----

query II rowsort
SELECT DISTINCT - col2 AS col1, 64 + + ( - - col2 ) FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
88
-38
102
-79
143

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2, col1, col1
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-1447
SELECT ALL + col0 DIV + col1 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
0
1
2

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1447
SELECT ALL + col0 / + col1 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
0
1
2

query I rowsort
SELECT - 42 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) BETWEEN ( - col1 ) AND NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 * - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - + 86 )
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IN ( + - col1 )
----

query I rowsort
SELECT - + COALESCE ( - 2, + ( 61 ) ) + + ( col2 ) FROM tab2 WHERE NOT ( NOT - col1 IS NULL ) GROUP BY col2
----

query I rowsort
SELECT ALL + 34 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
34
34
34

query I rowsort
SELECT col2 * - col2 AS col0 FROM tab2 GROUP BY col0, col1, col2
----
-3364
-6241
-7569

query II rowsort
SELECT DISTINCT - col2, col1 FROM tab1 GROUP BY col1, col2, col0
----
-45
57
-71
44
-8
6

query I rowsort
SELECT DISTINCT col1 + col1 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
118
122
82

query I rowsort
SELECT ALL - ( + + ( + - col2 ) ) FROM tab0 AS cor0 GROUP BY col2, col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( + 97 * col0 ) BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1459
SELECT + - 47 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING - CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1459
SELECT + - 47 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING - CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + - ( + 62 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1 HAVING - 33 + - col2 IS NOT NULL
----
-62
-62
-62

query I rowsort
SELECT DISTINCT 88 FROM tab1 GROUP BY col2
----
88

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-1463
SELECT DISTINCT + - col2 * + CASE + - CAST( NULL AS DECIMAL ) WHEN + 97 THEN - + 24 ELSE NULL END, - 49 * + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
-1176
NULL
-1862
NULL
-3871

skipif mysql # not compatible
query II rowsort label-1463
SELECT DISTINCT + - col2 * + CASE + - CAST ( NULL AS REAL ) WHEN + 97 THEN - + 24 ELSE NULL END, - 49 * + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
-1176
NULL
-1862
NULL
-3871

query I rowsort
SELECT + 30 FROM tab0 GROUP BY col0
----
30
30
30

query I rowsort
SELECT ALL + col1 + - col1 * NULLIF ( + col1, col1 ) AS col0 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 * + col2 + - col0 + + 39 - - + 32 <= NULL
----

query II rowsort
SELECT ALL 91 AS col2, + col0 + + 83 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
91
109
91
126
91
166

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1468
SELECT ALL + 47 + - CAST( NULL AS SIGNED ) col2, + col0 - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
0
NULL
0
NULL
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1468
SELECT ALL + 47 + - CAST ( NULL AS INTEGER ) col2, + col0 - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
0
NULL
0
NULL
0

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 4 / + col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT + 52 >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1471
SELECT DISTINCT + CAST( NULL AS DECIMAL ) FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( - col2 ) GROUP BY col0 HAVING NOT NULL >= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-1471
SELECT DISTINCT + CAST ( NULL AS REAL ) FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( - col2 ) GROUP BY col0 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - 46 + - 28 < NULL
----

query I rowsort
SELECT col0 / col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL NOT BETWEEN 96 / 5 AND ( col2 ) * col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1474
SELECT - ( CAST( NULL AS SIGNED ) ) AS col1, + col1 col0 FROM tab0 GROUP BY col1, col2
----
NULL
0
NULL
0
NULL
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1474
SELECT - ( CAST ( NULL AS INTEGER ) ) AS col1, + col1 col0 FROM tab0 GROUP BY col1, col2
----
NULL
0
NULL
0
NULL
81

query I rowsort
SELECT ALL + 82 + - col1 FROM tab2 GROUP BY col1
----
21
23
41

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 64 * - col0 col1, - ( - - col0 ) AS col0 FROM tab1 GROUP BY col0, col0
----
-1408
-22
-1792
-28
-5248
-82

query I rowsort
SELECT - col1 + 39 FROM tab0 cor0 GROUP BY col0, col1
----
-42
39
39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1478
SELECT ALL CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1478
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT - ( + col2 ) FROM tab0 AS cor0 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 40 AS col0 FROM tab1 GROUP BY col1 HAVING ( NULL ) < - col0
----

query I rowsort
SELECT 63 FROM tab1 AS cor0 GROUP BY col0
----
63
63
63

query I rowsort
SELECT 91 FROM tab2 GROUP BY col0
----
91
91
91

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1483
SELECT + col2 * + col2 / + + 76 * col2 / CAST( NULL AS SIGNED ) - 85 + 64 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-1483
SELECT + col2 * + col2 / + + 76 * col2 / CAST ( NULL AS INTEGER ) - 85 + 64 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT - col0 + - - 41 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( NOT NULL IS NULL ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col1, + 40 * ( - col0 ) col0 FROM tab0 cor0 GROUP BY col0
----
-26
-1040
-43
-1720
-83
-3320

query I rowsort
SELECT DISTINCT - + 17 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-17

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col2 AS col2, + 26 col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-45
26
-71
26
-8
26

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1488
SELECT + AVG ( ALL + CAST( col1 AS SIGNED ) ) + + col0 FROM tab1 AS cor0 WHERE - col0 <> NULL GROUP BY col1, col0
----

skipif mysql # not compatible
query I rowsort label-1488
SELECT + AVG ( ALL + CAST ( col1 AS INTEGER ) ) + + col0 FROM tab1 AS cor0 WHERE - col0 <> NULL GROUP BY col1, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1489
SELECT DISTINCT - col2 DIV - col2 FROM tab2 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-1489
SELECT DISTINCT - col2 / - col2 FROM tab2 AS cor0 GROUP BY col2
----
1

query I rowsort
SELECT - 11 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-11
-11
-11

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 3 col2 FROM tab0 GROUP BY col0
----
-3
-3
-3

query I rowsort
SELECT DISTINCT + col0 + - col0 FROM tab2 WHERE NOT col2 > - 48 GROUP BY col0 HAVING NOT 81 / col0 IS NULL
----

query I rowsort
SELECT col0 + + col2 * + col0 FROM tab1 GROUP BY col2, col0, col0
----
1288
198
5904

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1494
SELECT - 4 + col1 FROM tab2 GROUP BY col1 HAVING NOT ( CAST( NULL AS SIGNED ) ) IS NOT NULL
----
37
55
57

skipif mysql # not compatible
query I rowsort label-1494
SELECT - 4 + col1 FROM tab2 GROUP BY col1 HAVING NOT ( CAST ( NULL AS INTEGER ) ) IS NOT NULL
----
37
55
57

query I rowsort
SELECT 44 * - col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-1936
-2508
-264

query I rowsort
SELECT 66 * + col2 FROM tab0 WHERE NOT - 88 * + COALESCE ( 36, 65, col0 ) IS NULL GROUP BY col2
----
1584
2508
5214

query I rowsort
SELECT DISTINCT 71 * 67 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 20 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + 51 * + col0 + 5 AS col1 FROM tab2 GROUP BY col0, col1
----
4646
4697
770

query I rowsort
SELECT - 71 * col0 FROM tab0 GROUP BY col0
----
-1846
-3053
-5893

query II rowsort
SELECT DISTINCT + - col1 AS col0, - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-44
-57
-57
-6
-6

query I rowsort
SELECT ALL - - 10 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING 32 IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <= ( NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1504
SELECT - 81 + CAST( NULL AS DECIMAL ) * - 16 AS col0 FROM tab1 WHERE ( col0 - + ( + ( - NULLIF ( col1, - col1 ) ) ) ) BETWEEN - 48 AND + 9 GROUP BY col0 HAVING NOT NULL NOT BETWEEN + 29 AND NULL
----

skipif mysql # not compatible
query I rowsort label-1504
SELECT - 81 + CAST ( NULL AS REAL ) * - 16 AS col0 FROM tab1 WHERE ( col0 - + ( + ( - NULLIF ( col1, - col1 ) ) ) ) BETWEEN - 48 AND + 9 GROUP BY col0 HAVING NOT NULL NOT BETWEEN + 29 AND NULL
----

query I rowsort
SELECT DISTINCT 29 FROM tab1 GROUP BY col2, col2
----
29

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL 3 * - 77 FROM tab0 GROUP BY col0 HAVING NOT col0 + COALESCE ( col0, - col0, + col0 ) IS NOT NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT 64 FROM tab0 GROUP BY col2
----
64
64
64

query I rowsort
SELECT + 88 FROM tab1 AS cor0 GROUP BY col2
----
88
88
88

query I rowsort
SELECT DISTINCT ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - 82 * - 42 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) BETWEEN + col0 AND ( NULL )
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT + ( + 13 ) AS col1 FROM tab0 GROUP BY col2
----
13
13
13

query I rowsort
SELECT DISTINCT - 73 + - col2 AS col0 FROM tab0 GROUP BY col2
----
-111
-152
-97

onlyif mysql # DIV for integer division: 
query I rowsort label-1516
SELECT DISTINCT col1 DIV ( col1 ) * + col1 + - col1 FROM tab1 GROUP BY col1, col1, col0
----
0

skipif mysql # not compatible
query I rowsort label-1516
SELECT DISTINCT col1 / ( col1 ) * + col1 + - col1 FROM tab1 GROUP BY col1, col1, col0
----
0

query I rowsort
SELECT - 20 FROM tab2 GROUP BY col0
----
-20
-20
-20

query I rowsort
SELECT ALL - AVG ( + 70 ) AS col2 FROM tab0 WHERE ( NULL ) = 19 GROUP BY col1
----

query I rowsort
SELECT + col1 - - col1 FROM tab1 cor0 GROUP BY col1, col0
----
114
12
88

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1520
SELECT DISTINCT - - CAST( NULL AS SIGNED ) * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT 83 * + 46 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1520
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT 83 * + 46 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1 HAVING 26 > NULL
----

query I rowsort
SELECT col2 + col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
158
48
76

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 WHERE NOT - 79 IS NOT NULL GROUP BY col0, col1 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT 1 FROM tab0 cor0 GROUP BY col0, col1
----
1

query II rowsort
SELECT ALL + 20, col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
20
24
20
38
20
79

query II rowsort
SELECT ALL + col0, col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
26
0
43
81
83
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - 61 * + ( - 99 ) AS col0 FROM tab0 GROUP BY col1
----
6039
6039

query II rowsort
SELECT - 67 + - + col1 + + - col1 AS col2, + col1 + - 23 FROM tab0 WHERE + col1 >= NULL GROUP BY col1, col1
----

query I rowsort
SELECT + col0 * + 34 FROM tab0 GROUP BY col2, col0
----
1462
2822
884

query I rowsort
SELECT DISTINCT + 52 FROM tab0 GROUP BY col1
----
52

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NULL > col2
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING col0 - + - col0 IS NOT NULL
----
15
91
92

query II rowsort
SELECT DISTINCT 55 - 19 AS col2, 19 FROM tab2 GROUP BY col0
----
36
19

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - col2 AS col0, + 5 col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
5
-71
5
-8
5

query I rowsort
SELECT ALL - + 76 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
3344
4332
456

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + + 77 + + + 81 <> col0
----
26
43
83

query I rowsort
SELECT DISTINCT 92 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
92

query I rowsort
SELECT + col0 * - + ( - col0 ) AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL 34 AS col1 FROM tab0 GROUP BY col0
----
34
34
34

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT col0 AS col0, col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
0
28
0
82
0

query I rowsort
SELECT DISTINCT - col1 + + ( col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT + 13 FROM tab0 AS cor0 GROUP BY col2, col2
----
13
13
13

query I rowsort
SELECT - + 58 * - + 93 FROM tab2 AS cor0 GROUP BY col0, col2
----
5394
5394
5394

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + 71 + + col0 / + col0 AS col2, ( col2 ) + - col2 col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2 HAVING NULL <> - col0
----

query I rowsort
SELECT col1 * 71 + 83 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
2994
4272
4414

query I rowsort
SELECT 82 + - 20 FROM tab0 GROUP BY col2, col1
----
62
62
62

query I rowsort
SELECT + col0 AS col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NULL BETWEEN + col1 AND NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING + + col1 < col2 + + 29
----
0
0

query I rowsort
SELECT - 44 * - - col0 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL IS NOT NULL )
----
-4004
-4048
-660

query I rowsort
SELECT 87 * col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
5046
6873
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 77 col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-77

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + 41 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 + - 16 + + col2 < NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT - ( + col1 ) <> - 14
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1561
SELECT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-1561
SELECT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1562
SELECT col2 + + col2 DIV + - col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-1562
SELECT col2 + + col2 / + - col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
57
78
86

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT 94 FROM tab2 GROUP BY col0
----
94

query I rowsort
SELECT 83 FROM tab2 GROUP BY col0, col2
----
83
83
83

query I rowsort
SELECT ALL col0 * + col0 FROM tab1 GROUP BY col2, col0 HAVING col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 16 col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col1
----
-16

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT ( col1 ) + + - col1 * - ( col1 ) * col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
205438
227042
68962

query I rowsort
SELECT - + 98 + - NULLIF ( + 32, + - 96 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-130
-130
-130

query I rowsort
SELECT ALL ( 66 ) + + + 86 FROM tab0 AS cor0 GROUP BY col1, col0
----
152
152
152

query I rowsort
SELECT ALL col0 * + - col0 * - - 34 + - col0 AS col0 FROM tab2 GROUP BY col0
----
-281645
-287868
-7665

query I rowsort
SELECT - - 11 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING + - 43 < NULL
----

query I rowsort
SELECT ALL 69 FROM tab2 GROUP BY col2, col0
----
69
69
69

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * - - 82 col1 FROM tab0 GROUP BY col1, col0, col2
----
0
0
6642

query I rowsort
SELECT ( col0 ) FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - 96 + - 94 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-190

query I rowsort
SELECT 66 FROM tab0 GROUP BY col1
----
66
66

query II rowsort
SELECT - + col2 * col2, col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING col2 IS NULL
----

query II rowsort
SELECT col2 AS col2, + 81 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
81
79
81
87
81

query I rowsort
SELECT DISTINCT + - 66 AS col1 FROM tab1 AS cor0 WHERE col0 IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1582
SELECT DISTINCT - - col1 - - col0 * + CAST( NULL AS SIGNED ) * col0, CASE - 55 WHEN + 36 THEN NULL WHEN - + col0 THEN NULL WHEN - 29 THEN - + col1 WHEN + 19 THEN NULL ELSE NULL END AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col1, col0
----
NULL
NULL

skipif mysql # not compatible
query II rowsort label-1582
SELECT DISTINCT - - col1 - - col0 * + CAST ( NULL AS INTEGER ) * col0, CASE - 55 WHEN + 36 THEN NULL WHEN - + col0 THEN NULL WHEN - 29 THEN - + col1 WHEN + 19 THEN NULL ELSE NULL END AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col1, col0
----
NULL
NULL

query I rowsort
SELECT ALL - col2 * - + 16 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL BETWEEN + 17 AND NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING col1 >= NULL
----

query I rowsort
SELECT DISTINCT - col1 + - - col1 AS col2 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT ( col1 ) + + col1 + 82 FROM tab0 GROUP BY col1, col0 HAVING NOT NULLIF ( + + 24, col1 ) IS NULL
----
244
82

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL col1 * + col1 * - col1 AS col1 FROM tab2 GROUP BY col1
----
-205379
-226981
-68921

query I rowsort
SELECT + 72 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
72
72

query I rowsort
SELECT DISTINCT + col1 * - 43 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1892
-2451
-258

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0 HAVING NULL > 49
----

query I rowsort
SELECT col1 * - ( col0 ) FROM tab1 GROUP BY col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT - 92 AS col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING col1 <> 90
----
-92
-92
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * - col0 - col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
462
6642
756

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( ( NULL ) IS NULL )
----
-41
-59
-61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1596
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 WHERE NULL > ( NULL ) GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-1596
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 WHERE NULL > ( NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT + 86 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
4988
6794
7482

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col1, col0 HAVING NOT + + ( col0 ) IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + + 13 - + col0 AS col1, col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
28
-69
82
-9
22

query I rowsort
SELECT DISTINCT - ( - 41 ) FROM tab1 GROUP BY col0, col2
----
41

query I rowsort
SELECT DISTINCT 88 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
112
126
167

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT 9 < + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1604
SELECT AVG ( ALL + - col2 ) - - + ( - CAST( NULL AS SIGNED ) ) AS col0 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1604
SELECT AVG ( ALL + - col2 ) - - + ( - CAST ( NULL AS INTEGER ) ) AS col0 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT + 73 + - 10 AS col1 FROM tab2 WHERE NOT - ( + + col2 ) + - - col1 - col2 IN ( - + 45 ) GROUP BY col2
----
63

query I rowsort
SELECT 33 AS col0 FROM tab0 cor0 GROUP BY col2
----
33
33
33

query I rowsort
SELECT DISTINCT - - 30 * + col0 + - - col0 + - col0 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
2821
2852
465

query II rowsort
SELECT ALL - col1, - ( - + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <> ( NULL )
----

query II rowsort
SELECT col2, col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
24
43
38
83
79
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 92 + col0 + + 4 col2 FROM tab2 AS cor0 WHERE ( NOT NULL IS NULL ) GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT + - 99 AS col2 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1614
SELECT DISTINCT + CAST( + 30 AS SIGNED ), col2 col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 <= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1614
SELECT DISTINCT + CAST ( + 30 AS INTEGER ), col2 col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 <= NULL
----

query II rowsort
SELECT - 0, col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + 44 + + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab1 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
1936
3249
36

query I rowsort
SELECT 50 FROM tab1 AS cor0 GROUP BY col1, col0
----
50
50
50

query II rowsort
SELECT ALL - + 51, col1 + + col1 AS col0 FROM tab0 WHERE NOT col0 * - + 72 + + + col0 IS NULL GROUP BY col1
----
-51
0
-51
162

query I rowsort
SELECT 63 FROM tab0 GROUP BY col2
----
63
63
63

query II rowsort
SELECT DISTINCT col0, - 60 FROM tab2 GROUP BY col1, col0 HAVING NOT ( + col1 * + - ( col1 ) + + - col0 ) IS NULL
----
15
-60
91
-60
92
-60

query I rowsort
SELECT + col2 * + col2 + 80 + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
152
2150
5192

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query II rowsort
SELECT + ( - + 15 ), col2 FROM tab1 GROUP BY col2
----
-15
45
-15
71
-15
8

query I rowsort
SELECT 53 AS col0 FROM tab2 GROUP BY col2
----
53
53
53

query I rowsort
SELECT DISTINCT 91 - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1627
SELECT DISTINCT CAST( NULL AS SIGNED ) * col1 AS col2 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1627
SELECT DISTINCT CAST ( NULL AS INTEGER ) * col1 AS col2 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ( - col0 ) FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab0 WHERE NULL <= ( - col2 ) GROUP BY col0, col1 HAVING ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 + - 60 * + ( - col2 ) FROM tab2 GROUP BY col2
----
3538
4819
5307

query I rowsort
SELECT 75 FROM tab1 GROUP BY col0, col1 HAVING + col0 + col0 = ( col0 * 8 + 66 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1632
SELECT ALL 65 + col0 DIV col0 col2 FROM tab2 GROUP BY col1, col0
----
66
66
66

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1632
SELECT ALL 65 + col0 / col0 col2 FROM tab2 GROUP BY col1, col0
----
66
66
66

onlyif mysql # DIV for integer division: 
query II rowsort label-1633
SELECT DISTINCT + - col1 AS col1, col1 + - col1 - - col1 DIV + 3 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
14
-57
19
-6
2

skipif mysql # not compatible
query II rowsort label-1633
SELECT DISTINCT + - col1 AS col1, col1 + - col1 - - col1 / + 3 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
14
-57
19
-6
2

query I rowsort
SELECT DISTINCT col2 * + col2 - 67 AS col2 FROM tab2 AS cor0 WHERE NOT - col1 * + - col1 * + col2 * 95 + + 46 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - - 94 * - 16 AS col0 FROM tab0 cor0 GROUP BY col1
----
-1504
-1504

query I rowsort
SELECT ALL + 3 FROM tab1 GROUP BY col0
----
3
3
3

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col0 HAVING NOT - - 48 IS NULL
----
15
91
92

query I rowsort
SELECT 60 AS col1 FROM tab1 GROUP BY col0, col1
----
60
60
60

query I rowsort
SELECT col1 / + col1 + - 46 AS col0 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT col1 > NULL
----

query I rowsort
SELECT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + - 86 / 88 + + 6 IS NULL
----
-24
-38
-79

query II rowsort
SELECT - col2 / + col2 AS col1, + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL 19 + + + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
43
57
98

query I rowsort
SELECT + 9 FROM tab2 AS cor0 GROUP BY col2
----
9
9
9

query I rowsort
SELECT ALL + col0 + + 37 FROM tab2 AS cor0 GROUP BY col0
----
128
129
52

query I rowsort
SELECT - 94 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT 65 * + col2 / - 94 = NULL
----

query I rowsort
SELECT + 22 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - + 10 IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING + 33 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1649
SELECT ALL + + col0 * - + CAST( 78 AS SIGNED ) + - 50 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-1766
-2234
-6446

skipif mysql # not compatible
query I rowsort label-1649
SELECT ALL + + col0 * - + CAST ( 78 AS INTEGER ) + - 50 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-1766
-2234
-6446

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col2, col0, col2 HAVING NOT ( 8 ) <= + 16 + + col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1651
SELECT ALL - col2 DIV - - 15 FROM tab0 GROUP BY col2, col1
----
-1
-2
-5

skipif mysql # not compatible
query I rowsort label-1651
SELECT ALL - col2 / - - 15 FROM tab0 GROUP BY col2, col1
----
-1
-2
-5

query I rowsort
SELECT DISTINCT - + col2 + + 4 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
-54
-75
-83

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( ( NULL ) IS NULL )
----

query I rowsort
SELECT - - col2 * col2 * - NULLIF ( 5, 82 ) * col2 + 11 * + col2 - - col2 FROM tab1 cor0 GROUP BY col2, col2
----
-1788703
-2464
-455085

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT - - 3 * + - 41 < NULL
----

query I rowsort
SELECT DISTINCT + col2 * + 64 AS col0 FROM tab1 GROUP BY col2
----
2880
4544
512

query I rowsort
SELECT 28 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
28
28
28

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query II rowsort
SELECT ALL - col2 AS col1, 16 * - + col2 FROM tab0 GROUP BY col0, col0, col2
----
-24
-384
-38
-608
-79
-1264

query II rowsort
SELECT ALL col1 AS col0, - col1 FROM tab2 AS cor0 WHERE col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT - 28 AS col0 FROM tab0 GROUP BY col1, col2
----
-28
-28
-28

query I rowsort
SELECT ALL - 43 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1663
SELECT ALL - + col0 * + col0 * - - CAST( NULL AS SIGNED ) * - 82 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1663
SELECT ALL - + col0 * + col0 * - - CAST ( NULL AS INTEGER ) * - 82 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1664
SELECT + 74 * - col2 * + CAST( NULL AS SIGNED ) * + AVG ( 67 ) * - col2 - - col2 AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1664
SELECT + 74 * - col2 * + CAST ( NULL AS INTEGER ) * + AVG ( 67 ) * - col2 - - col2 AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-1665
SELECT col2 DIV - 50 + + col2 * - - col2 col1 FROM tab1 GROUP BY col2
----
2025
5040
64

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1665
SELECT col2 / - 50 + + col2 * - - col2 col1 FROM tab1 GROUP BY col2
----
2025
5040
64

query I rowsort
SELECT 58 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1667
SELECT - CAST( NULL AS SIGNED ) * - + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1667
SELECT - CAST ( NULL AS INTEGER ) * - + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col2 * - + 50 AS col1 FROM tab1 GROUP BY col2
----
-2250
-3550
-400

query I rowsort
SELECT DISTINCT + 72 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
72

query I rowsort
SELECT - col1 + col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT DISTINCT - - 40 AS col2, col0 FROM tab2 cor0 WHERE - col0 IS NOT NULL GROUP BY col0 HAVING NOT + 48 IS NULL
----
40
15
40
91
40
92

query I rowsort
SELECT ALL + col1 - + ( + 6 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
-6
-6
75

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1673
SELECT DISTINCT col2 FROM tab1 GROUP BY col1, col2 HAVING NOT + CAST( NULL AS SIGNED ) * 16 + - 53 IS NOT NULL
----
45
71
8

skipif mysql # not compatible
query I rowsort label-1673
SELECT DISTINCT col2 FROM tab1 GROUP BY col1, col2 HAVING NOT + CAST ( NULL AS INTEGER ) * 16 + - 53 IS NOT NULL
----
45
71
8

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT NULL BETWEEN NULL AND - col1 )
----

query I rowsort
SELECT DISTINCT + 2 AS col1 FROM tab1 GROUP BY col0 HAVING ( ( col0 ) ) IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-1676
SELECT - col0, col0 - + + 86 + + col0 DIV + 69 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-64
-28
-58
-82
-3

skipif mysql # not compatible
query II rowsort label-1676
SELECT - col0, col0 - + + 86 + + col0 / + 69 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-64
-28
-58
-82
-3

query I rowsort
SELECT - 10 AS col1 FROM tab2 GROUP BY col0
----
-10
-10
-10

query I rowsort
SELECT 40 + + + 36 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT + - col2 AS col1, - 38 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-38
-38
-79
-38

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - - col2 * 78 * + + ( - col2 ) FROM tab1 cor0 GROUP BY col2, col0 HAVING col0 IS NOT NULL
----
-157950
-393198
-4992

query I rowsort
SELECT DISTINCT + ( - col0 ) FROM tab1 WHERE NULL IS NULL GROUP BY col1, col0, col2
----
-22
-28
-82

query I rowsort
SELECT - ( - 75 ) * 41 * - col2 * + col2 FROM tab0 AS cor0 WHERE - 94 * + col2 IS NULL GROUP BY col2 HAVING NOT ( NULL ) BETWEEN - 89 AND NULL
----

query I rowsort
SELECT - 31 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-31
-31
-31

query II rowsort
SELECT DISTINCT 28, col1 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NOT + 38 <= NULL
----

query II rowsort
SELECT - col2, - 45 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col2 * - col2 * + - 50 AS col0, 66 * 92 FROM tab1 GROUP BY col2
----
101250
6072
252050
6072
3200
6072

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + + 81 <> NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT ALL + 41 FROM tab2 GROUP BY col0
----
41
41
41

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-1691
SELECT DISTINCT + 85 col2, - col2 col0 FROM tab0 WHERE NOT - CAST( NULL AS DECIMAL ) + - CAST( + 91 AS DECIMAL ) = - - 81 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1691
SELECT DISTINCT + 85 col2, - col2 col0 FROM tab0 WHERE NOT - CAST ( NULL AS REAL ) + - CAST ( + 91 AS REAL ) = - - 81 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 WHERE NOT + col0 / - ( + + 61 ) + - 72 + - col2 > NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1693
SELECT DISTINCT - col2 * col1 * - col2, col1 * + - CAST( NULL AS SIGNED ) col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
115425
NULL
221804
NULL
384
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1693
SELECT DISTINCT - col2 * col1 * - col2, col1 * + - CAST ( NULL AS INTEGER ) col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
115425
NULL
221804
NULL
384
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1694
SELECT ALL + - ( + - col0 ) / + + col2 AS col2 FROM tab2 WHERE NOT - CAST( NULL AS SIGNED ) IN ( col1, - 39 * 94 + + col0, + col1 ) GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1694
SELECT ALL + - ( + - col0 ) / + + col2 AS col2 FROM tab2 WHERE NOT - CAST ( NULL AS INTEGER ) IN ( col1, - 39 * 94 + + col0, + col1 ) GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 85 FROM tab1 AS cor0 GROUP BY col1
----
85

query II rowsort
SELECT col0 AS col1, + col0 FROM tab1 cor0 GROUP BY col0
----
22
22
28
28
82
82

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1698
SELECT + - ( - 51 ) AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING col0 = + ( - ( - CASE col0 WHEN + col0 THEN - - 3 + col0 ELSE CAST( NULL AS DECIMAL ) END ) ) * 17
----

skipif mysql # not compatible
query I rowsort label-1698
SELECT + - ( - 51 ) AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING col0 = + ( - ( - CASE col0 WHEN + col0 THEN - - 3 + col0 ELSE CAST ( NULL AS REAL ) END ) ) * 17
----

query II rowsort
SELECT ALL - col1 AS col2, - col1 + + + col1 FROM tab2 GROUP BY col1
----
-41
0
-59
0
-61
0

query I rowsort
SELECT ALL - 27 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 + - 83 AS col1 FROM tab1 GROUP BY col2, col2 HAVING ( ( NOT ( NULL IS NULL ) ) )
----

query I rowsort
SELECT col0 + - + col0 AS col2 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col0 * 76 FROM tab0 GROUP BY col0, col0
----
1976
3268
6308

onlyif mysql # DIV for integer division: 
query I rowsort label-1704
SELECT ALL - col2 DIV - col2 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
23
29
83

skipif mysql # not compatible
query I rowsort label-1704
SELECT ALL - col2 / - col2 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
23
29
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 + + col2, + COALESCE ( - 59, ( - - 75 ) * - - col0 ) col0 FROM tab0 AS cor0 GROUP BY col2
----
0
-59
0
-59
0
-59

query I rowsort
SELECT ALL + 79 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
79
79
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1707
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT 53 = ( - + col2 ) OR NOT NULL NOT BETWEEN - 19 * - CAST( NULL AS SIGNED ) AND - col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-1707
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT 53 = ( - + col2 ) OR NOT NULL NOT BETWEEN - 19 * - CAST ( NULL AS INTEGER ) AND - col2
----
24
38
79

query II rowsort
SELECT + - 69 * 15 AS col1, col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-1035
24
-1035
38
-1035
79

query I rowsort
SELECT 32 FROM tab0 GROUP BY col0, col1
----
32
32
32

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1710
SELECT ALL + col1 * col2 / + + CAST( NULL AS DECIMAL ) - + 76 col2 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1710
SELECT ALL + col1 * col2 / + + CAST ( NULL AS REAL ) - + 76 col2 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 72 AS col2 FROM tab0 GROUP BY col1
----
-72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1712
SELECT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - + 16 + + + col2 - + CAST( NULL AS SIGNED ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1712
SELECT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - + 16 + + + col2 - + CAST ( NULL AS INTEGER ) ) IS NOT NULL
----

query I rowsort
SELECT - 18 AS col2 FROM tab0 cor0 GROUP BY col0
----
-18
-18
-18

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1715
SELECT DISTINCT - col2 DIV col0 + + 85 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
80
85

skipif mysql # not compatible
query I rowsort label-1715
SELECT DISTINCT - col2 / col0 + + 85 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
80
85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1717
SELECT - CAST( + 24 AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
-24
-24
-24

skipif mysql # not compatible
query I rowsort label-1717
SELECT - CAST ( + 24 AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
-24
-24
-24

query I rowsort
SELECT - 15 * - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
1365
1380
225

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1719
SELECT DISTINCT - col2 * + - CAST( NULL AS SIGNED ) * - col1 * + ( + + col1 ) * 92 AS col2 FROM tab1 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-1719
SELECT DISTINCT - col2 * + - CAST ( NULL AS INTEGER ) * - col1 * + ( + + col1 ) * 92 AS col2 FROM tab1 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT ALL col1 FROM tab2 cor0 WHERE NOT ( - 22 ) * 83 IS NULL GROUP BY col1, col0 HAVING col1 * 31 IS NULL
----

query I rowsort
SELECT + col1 * - ( 77 ) / - col1 + + 56 + col1 + col1 * 64 FROM tab0 GROUP BY col1 HAVING ( col1 + col1 ) IS NULL
----

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IN ( - col2 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1723
SELECT ALL + col2 DIV + col2 + + col2 FROM tab1 GROUP BY col2
----
46
72
9

skipif mysql # not compatible
query I rowsort label-1723
SELECT ALL + col2 / + col2 + + col2 FROM tab1 GROUP BY col2
----
46
72
9

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col1, col0 HAVING NOT ( + - col1 ) IS NULL
----
15
91
92

query I rowsort
SELECT + ( 81 ) FROM tab0 GROUP BY col0
----
81
81
81

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 + - col0 + - ( - col0 ) FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT 80 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
80
80
80

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 AS cor0 WHERE 86 * - ( 77 ) * + + col0 BETWEEN + col0 + 81 AND - ( col2 ) GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + 9 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
9

onlyif mysql # DIV for integer division: 
query I rowsort label-1731
SELECT DISTINCT 14 DIV - 87 + - col0 * col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

skipif mysql # not compatible
query I rowsort label-1731
SELECT DISTINCT 14 / - 87 + - col0 * col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT col1 + 3 FROM tab2 GROUP BY col1, col1
----
44
62
64

query I rowsort
SELECT ALL - col0 FROM tab2 WHERE col1 + col1 IN ( + col0 * col1 ) GROUP BY col2, col0
----

query I rowsort
SELECT ALL col0 FROM tab1 WHERE NOT - col2 * + col1 = 51 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT 97 * 46 FROM tab1 WHERE NOT NULL IN ( col0 ) GROUP BY col0
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT 72 + 39 = ( 49 )
----
-15
-91
-92

query I rowsort
SELECT ALL col1 * + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL NOT BETWEEN NULL AND ( - 81 )
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING + 50 > NULL
----

query I rowsort
SELECT - ( + col1 ) + col2 FROM tab2 GROUP BY col2, col2, col1
----
17
20
26

query I rowsort
SELECT DISTINCT 29 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL <= ( col2 )
----

query I rowsort
SELECT DISTINCT col1 + col1 * - col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING 48 + 59 IS NOT NULL
----
0
81

query I rowsort
SELECT - col2 - col1 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
-105
-38
-79

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT 71 <> NULL
----

query I rowsort
SELECT ALL 77 * + 26 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) >= col0 * 57
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 * - - COALESCE ( - 89, col1 * NULLIF ( ( 97 ), + col2 * - col2 ), - col2 + col1 ) AS col1 FROM tab0 GROUP BY col2
----
-2136
-3382
-7031

query I rowsort
SELECT DISTINCT 34 FROM tab2 WHERE NOT 29 * - + 53 + col0 NOT IN ( col0 ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * 82 col0 FROM tab0 GROUP BY col0
----
2132
3526
6806

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( - NULLIF ( + - col1, - - col2 ) ) + + ( col1 ) col1 FROM tab1 GROUP BY col2, col1
----
114
12
88

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1750
SELECT DISTINCT col1 col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) <= - ( + 5 ) GROUP BY col1, col1 HAVING NOT ( - CAST( NULL AS SIGNED ) ) NOT IN ( 57 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1750
SELECT DISTINCT col1 col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) <= - ( + 5 ) GROUP BY col1, col1 HAVING NOT ( - CAST ( NULL AS INTEGER ) ) NOT IN ( 57 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * 11 col0 FROM tab1 AS cor0 WHERE NOT NULL < ( NULL ) GROUP BY col0
----

query I rowsort
SELECT + ( col1 ) * - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1753
SELECT - CAST( + 3 AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 IN ( - 91 )
----

skipif mysql # not compatible
query I rowsort label-1753
SELECT - CAST ( + 3 AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 IN ( - 91 )
----

query I rowsort
SELECT ALL - + 13 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
-13
-13
-13

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 * + col0 - + col0 + + col0 + - 14 + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
492
22
6792
82
798
28

query I rowsort
SELECT - 66 - - col2 FROM tab0 AS cor0 GROUP BY col2
----
-28
-42
13

query I rowsort
SELECT + 27 FROM tab2 GROUP BY col1, col0
----
27
27
27

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT 53 FROM tab2 cor0 GROUP BY col2, col0
----
53
53
53

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING 53 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT 42 - + col2 FROM tab2 cor0 GROUP BY col2
----
-16
-37
-45

query II rowsort
SELECT ALL + + 17 AS col1, col0 FROM tab2 AS cor0 GROUP BY col0
----
17
15
17
91
17
92

query I rowsort
SELECT 57 + col0 FROM tab2 WHERE 26 IS NOT NULL GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-1764
SELECT col2 AS col0, + 69 DIV + 46 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
1
38
1
79
1

skipif mysql # not compatible
query II rowsort label-1764
SELECT col2 AS col0, + 69 / + 46 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
1
38
1
79
1

query I rowsort
SELECT DISTINCT 40 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
40

query I rowsort
SELECT + 20 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
20
20
20

query I rowsort
SELECT ALL + 22 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
22
22
22

query I rowsort
SELECT ALL col0 * col0 * - col0 + 50 FROM tab1 GROUP BY col0
----
-10598
-21902
-551318

query I rowsort
SELECT ALL + 91 + - col2 * col2 FROM tab2 AS cor0 GROUP BY col2
----
-3273
-6150
-7478

query I rowsort
SELECT ALL 7 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
7
7
7

query I rowsort
SELECT DISTINCT - 61 AS col1 FROM tab2 GROUP BY col0
----
-61

query II rowsort
SELECT ALL col0, - 94 * col1 FROM tab0 GROUP BY col1, col0
----
26
0
43
-7614
83
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + col0 * - col0 col2 FROM tab0 GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT + col1 AS col2 FROM tab0 cor0 WHERE NULL BETWEEN - col2 AND - + col2 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT + + 74 FROM tab0 AS cor0 WHERE NOT NULL <= col0 / + 60 * + col0 GROUP BY col2, col2, col2
----

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 AS cor0 WHERE NOT col2 * + + 55 + - - col0 < + + ( + + 40 ) GROUP BY col0
----
15
91
92

query I rowsort
SELECT 11 FROM tab1 cor0 GROUP BY col2
----
11
11
11

query I rowsort
SELECT + - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT DISTINCT + col0 * col2 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT DISTINCT + 35 FROM tab0 AS cor0 GROUP BY col1, col2
----
35

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - + 94 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + 68 FROM tab1 AS cor0 GROUP BY col0, col1
----
68

query I rowsort
SELECT ALL + - col0 + - 23 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-106
-49
-66

query I rowsort
SELECT - col0 * col2 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query II rowsort
SELECT - col2 * + 11, - col2 * + 65 AS col1 FROM tab0 GROUP BY col2, col2
----
-264
-1560
-418
-2470
-869
-5135

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1786
SELECT - 3 + col2 * + - col1 AS col0 FROM tab1 GROUP BY col0, col2, col1 HAVING NULL <= + - col0 * + col0 + CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
query I rowsort label-1786
SELECT - 3 + col2 * + - col1 AS col0 FROM tab1 GROUP BY col0, col2, col1 HAVING NULL <= + - col0 * + col0 + CAST ( NULL AS REAL )
----

query I rowsort
SELECT DISTINCT 3 * + + col2 FROM tab2 GROUP BY col2, col1
----
174
237
261

query I rowsort
SELECT - 41 * 86 + 60 AS col1 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1789
SELECT DISTINCT col2 DIV NULLIF ( - 2, ( - col2 ) ) AS col0 FROM tab1 GROUP BY col2
----
-22
-35
-4

skipif mysql # not compatible
query I rowsort label-1789
SELECT DISTINCT col2 / NULLIF ( - 2, ( - col2 ) ) AS col0 FROM tab1 GROUP BY col2
----
-22
-35
-4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1790
SELECT DISTINCT + + CAST( NULL AS SIGNED ) * + col2 - ( - + 19 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-1790
SELECT DISTINCT + + CAST ( NULL AS INTEGER ) * + col2 - ( - + 19 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

query II rowsort
SELECT + + col0 AS col0, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
15
91
91
92
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * col2 * - col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query II rowsort
SELECT ALL col2, + col2 FROM tab2 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT col0 * - col0 * + col0 + + col0 + - - col0 AS col1 FROM tab2 GROUP BY col0
----
-3345
-753389
-778504

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0, col0
----
-24
-38
-79

query I rowsort
SELECT - 18 FROM tab2 GROUP BY col0, col1, col2
----
-18
-18
-18

query I rowsort
SELECT ALL 23 FROM tab0 GROUP BY col1
----
23
23

query I rowsort
SELECT DISTINCT - + 86 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-86

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING - 43 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - 92 * 59 + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

query I rowsort
SELECT ALL col0 * - 43 - + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-4004
-4048
-660

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - - 91 col1 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + ( + + 98 ) * ( + + col0 ) FROM tab0 GROUP BY col0, col1
----
2548
4214
8134

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col0, col1, col2
----
45
71
8

query I rowsort
SELECT + + ( - col1 ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT + + col2 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT - col1 * 27 + - COALESCE ( - 6, - + ( col1 ) * + 14 ) = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 50 - ( + - col1 ) + + col1 col1 FROM tab0 GROUP BY col1
----
212
50

query I rowsort
SELECT ALL col0 * - col0 + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-462
-6642
-756

query I rowsort
SELECT ALL - 25 * - 39 * ( + 99 ) + 64 + - col0 FROM tab1 WHERE NOT - - col2 IS NULL GROUP BY col0
----
96507
96561
96567

query I rowsort
SELECT + + ( + col0 ) + + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
164
44
56

query I rowsort
SELECT + ( ( col2 ) ) + - col2 * col2 FROM tab0 cor0 GROUP BY col2
----
-1406
-552
-6162

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1816
SELECT ALL + col0 DIV - + 77 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-1816
SELECT ALL + col0 / - + 77 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1
0
0

query I rowsort
SELECT DISTINCT ( + + col0 ) AS col0 FROM tab2 AS cor0 WHERE NOT + col2 * + col0 IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col0 HAVING - + 91 IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - col2 / + 34 * - 30 + + 38 AS col0, - 43 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < 69 * col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1821
SELECT DISTINCT - CASE + - col2 WHEN ( - CAST( NULL AS SIGNED ) ) + - - 76 + + - 56 THEN 53 END AS col2, + col0 FROM tab2 GROUP BY col2, col0
----
NULL
15
NULL
91
NULL
92

skipif mysql # not compatible
query II rowsort label-1821
SELECT DISTINCT - CASE + - col2 WHEN ( - CAST ( NULL AS INTEGER ) ) + - - 76 + + - 56 THEN 53 END AS col2, + col0 FROM tab2 GROUP BY col2, col0
----
NULL
15
NULL
91
NULL
92

query I rowsort
SELECT DISTINCT - 40 AS col2 FROM tab2 GROUP BY col1, col1
----
-40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 88 + 59 col2 FROM tab0 GROUP BY col0, col1 HAVING NOT - - ( col2 ) * + - col1 = NULL
----

query I rowsort
SELECT ( - col1 ) AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-1825
SELECT DISTINCT - 58 + col2 DIV - col2 FROM tab0 AS cor0 GROUP BY col2
----
-59

skipif mysql # not compatible
query I rowsort label-1825
SELECT DISTINCT - 58 + col2 / - col2 FROM tab0 AS cor0 GROUP BY col2
----
-59

query I rowsort
SELECT - - 14 - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
-44
-65
-73

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 WHERE NOT - col1 <= ( - ( + - 6 ) ) GROUP BY col2
----

query I rowsort
SELECT - col1 * - 77 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 60 FROM tab0 AS cor0 GROUP BY col0, col0
----
60

query I rowsort
SELECT ALL col2 * col2 * - 82 * + - ( - col2 ) + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15999092
-40429107
-53997231

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 29 IS NULL
----
-15
-91
-92

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( 57 IS NULL )
----

query I rowsort
SELECT DISTINCT - 84 AS col1 FROM tab1 cor0 GROUP BY col0, col1
----
-84

query II rowsort
SELECT 63 * + 22, col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NULL >= - 55
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1835
SELECT ALL - AVG ( DISTINCT + - 45 ) FROM tab1 WHERE NULL IS NOT NULL AND NOT - col2 * ( - CAST( + 17 AS DECIMAL ) ) - col1 IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-1835
SELECT ALL - AVG ( DISTINCT + - 45 ) FROM tab1 WHERE NULL IS NOT NULL AND NOT - col2 * ( - CAST ( + 17 AS REAL ) ) - col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
41
59
61

query I rowsort
SELECT ALL ( col1 ) * col1 AS col1 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING - 98 IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - 54 - col1 FROM tab1 GROUP BY col1
----
-111
-60
-98

query I rowsort
SELECT 0 * - ( - col2 ) FROM tab1 AS cor0 GROUP BY col2, col2, col1 HAVING NULL = NULL
----

query II rowsort
SELECT + 4 * + col0, - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
104
-79
172
-24
332
-38

query I rowsort
SELECT + 56 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab0 WHERE NOT + col1 NOT BETWEEN NULL AND ( NULL ) GROUP BY col0, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1846
SELECT ALL - col0 FROM tab2 AS cor0 WHERE NOT ( CAST( 34 AS SIGNED ) ) IS NULL GROUP BY col2, col0, col0
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-1846
SELECT ALL - col0 FROM tab2 AS cor0 WHERE NOT ( CAST ( 34 AS INTEGER ) ) IS NULL GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + 54 + + 20 FROM tab1 AS cor0 GROUP BY col1, col2
----
74

query I rowsort
SELECT ALL col2 FROM tab1 WHERE 10 <= ( NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT - 14 + col0 FROM tab1 AS cor0 WHERE - col0 IS NULL GROUP BY col0, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1850
SELECT col0 AS col0 FROM tab1 cor0 WHERE - 77 * CASE - 48 WHEN + 37 * 86 THEN col0 + col1 / - CAST( NULL AS SIGNED ) ELSE NULL END IS NULL GROUP BY col0, col2
----
22
28
82

skipif mysql # not compatible
query I rowsort label-1850
SELECT col0 AS col0 FROM tab1 cor0 WHERE - 77 * CASE - 48 WHEN + 37 * 86 THEN col0 + col1 / - CAST ( NULL AS INTEGER ) ELSE NULL END IS NULL GROUP BY col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 26 col1 FROM tab1 cor0 GROUP BY col0
----
26

query I rowsort
SELECT ALL 63 * + - 99 * col2 AS col1 FROM tab0 GROUP BY col2
----
-149688
-237006
-492723

query I rowsort
SELECT DISTINCT 20 AS col1 FROM tab0 GROUP BY col2
----
20

query I rowsort
SELECT - 50 * + + col0 / 45 FROM tab2 GROUP BY col0, col1, col0 HAVING NOT NULL NOT BETWEEN ( + col0 ) + + col0 AND - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) NOT IN ( ( col0 ) )
----

query I rowsort
SELECT DISTINCT col1 + col1 AS col0 FROM tab0 GROUP BY col1
----
0
162

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1857
SELECT - col1 * + + CAST( - 42 AS SIGNED ) AS col0 FROM tab2 GROUP BY col1, col2, col2
----
1722
2478
2562

skipif mysql # not compatible
query I rowsort label-1857
SELECT - col1 * + + CAST ( - 42 AS INTEGER ) AS col0 FROM tab2 GROUP BY col1, col2, col2
----
1722
2478
2562

query I rowsort
SELECT ALL + col0 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
166
52
86

query I rowsort
SELECT - 70 + - ( + col2 ) FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
-108
-149
-94

query I rowsort
SELECT + + 35 + + col0 + + + 55 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
112
118
172

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab0 WHERE NOT - col0 NOT BETWEEN ( col1 ) AND + col2 GROUP BY col1, col2
----

query I rowsort
SELECT ALL - 41 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-41
-41
-41

query I rowsort
SELECT + - col1 * + 53 FROM tab0 AS cor0 GROUP BY col1
----
-4293
0

query I rowsort
SELECT ALL 39 FROM tab0 GROUP BY col0, col0
----
39
39
39

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 29 col2, - col0 * + 72 + - 77 * + col0 - - + col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1866
SELECT DISTINCT + - col2 DIV col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-1
0

skipif mysql # not compatible
query I rowsort label-1866
SELECT DISTINCT + - col2 / col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-1
0

query I rowsort
SELECT ALL 55 FROM tab2 AS cor0 GROUP BY col2
----
55
55
55

query I rowsort
SELECT + 26 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
26
26
26

query I rowsort
SELECT 15 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
15
15

query I rowsort
SELECT DISTINCT - 25 AS col2 FROM tab2 GROUP BY col1
----
-25

query I rowsort
SELECT 71 FROM tab1 GROUP BY col1, col0
----
71
71
71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL COALESCE ( + 91, 37 - + col0 ) + col0 col2 FROM tab1 GROUP BY col0
----
113
119
173

query I rowsort
SELECT 95 * ( - col1 * 15 ) FROM tab1 WHERE ( NULL ) < - col2 GROUP BY col1 HAVING NOT + col1 + 71 IN ( - 4 * - 92 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1874
SELECT + CAST( col2 AS SIGNED ) FROM tab2 WHERE NOT NULL <= 5 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-1874
SELECT + CAST ( col2 AS INTEGER ) FROM tab2 WHERE NOT NULL <= 5 GROUP BY col2
----

query I rowsort
SELECT - 94 * 66 AS col1 FROM tab1 GROUP BY col1, col1, col0 HAVING NOT ( NULL ) NOT BETWEEN 47 * + col0 AND NULL
----

query I rowsort
SELECT - 31 AS col0 FROM tab1 GROUP BY col2, col1, col1
----
-31
-31
-31

query I rowsort
SELECT DISTINCT + 80 FROM tab1 GROUP BY col0, col2
----
80

query I rowsort
SELECT ALL col2 * col2 AS col2 FROM tab0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 86 col2 FROM tab2 GROUP BY col0
----
86
86
86

query I rowsort
SELECT 65 FROM tab0 GROUP BY col0, col2, col0 HAVING NOT NULL IS NOT NULL
----
65
65
65

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col2 + - col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN 57 AND NULL
----

query I rowsort
SELECT - ( - - col0 ) AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL col0 * - - 10 + 89 * col0 FROM tab0 AS cor0 GROUP BY col0
----
2574
4257
8217

query I rowsort
SELECT DISTINCT + - 25 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-25

onlyif mysql # DIV for integer division: 
query I rowsort label-1886
SELECT + - 40 + - col0 DIV + 90 FROM tab0 AS cor0 GROUP BY col0
----
-40
-40
-40

skipif mysql # not compatible
query I rowsort label-1886
SELECT + - 40 + - col0 / + 90 FROM tab0 AS cor0 GROUP BY col0
----
-40
-40
-40

onlyif mysql # DIV for integer division: 
query I rowsort label-1887
SELECT ALL - 47 DIV - + 99 FROM tab0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-1887
SELECT ALL - 47 / - + 99 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2 HAVING + 51 + + 57 IS NOT NULL
----
24
38
79

query II rowsort
SELECT ALL - col1 + - col1, 60 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - col0 IS NOT NULL
----
-118
60
-122
60
-82
60

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 GROUP BY col0, col0 HAVING NULL = NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 21 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( col2 IS NOT NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL <= - col1 - - col1
----

query I rowsort
SELECT ALL + 58 * 8 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-1895
SELECT DISTINCT + - col1 AS col2, 74 DIV - - 8 FROM tab0 AS cor0 GROUP BY col1 HAVING 97 * + col1 IS NOT NULL
----
-81
9
0
9

skipif mysql # not compatible
query II rowsort label-1895
SELECT DISTINCT + - col1 AS col2, 74 / - - 8 FROM tab0 AS cor0 GROUP BY col1 HAVING 97 * + col1 IS NOT NULL
----
-81
9
0
9

query I rowsort
SELECT ALL - + col1 + + - 21 FROM tab1 cor0 GROUP BY col1
----
-27
-65
-78

query I rowsort
SELECT - 85 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-85
-85

query I rowsort
SELECT 37 + 73 FROM tab1 GROUP BY col0
----
110
110
110

query II rowsort
SELECT DISTINCT + col1 * - 7 AS col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-308
44
-399
57
-42
6

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col1 HAVING NOT 63 >= NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 WHERE NOT ( - ( col0 ) ) NOT BETWEEN NULL AND - col2 + - col0 GROUP BY col1
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING + + 50 IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL <= - + 55 + - 46
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1904
SELECT DISTINCT - col2 - - - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-1904
SELECT DISTINCT - col2 - - - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1905
SELECT col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + col0 - - CAST( + + col0 AS DECIMAL ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-1905
SELECT col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + col0 - - CAST ( + + col0 AS REAL ) <> NULL
----

query I rowsort
SELECT col2 * + col2 + col0 * + 14 AS col1 FROM tab0 GROUP BY col2, col0
----
1178
2606
6605

query I rowsort
SELECT DISTINCT 40 FROM tab1 GROUP BY col0, col1 HAVING ( col1 ) IS NOT NULL
----
40

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT + col1 >= NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col1, col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-1910
SELECT DISTINCT ( - CAST( - col0 AS SIGNED ) ) DIV + 55 AS col2 FROM tab0 GROUP BY col0
----
0
1

skipif mysql # not compatible
query I rowsort label-1910
SELECT DISTINCT ( - CAST ( - col0 AS INTEGER ) ) / + 55 AS col2 FROM tab0 GROUP BY col0
----
0
1

query I rowsort
SELECT DISTINCT - col2 * + - col1 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
115425
221804
384

query I rowsort
SELECT ALL 13 + 65 FROM tab0 AS cor0 GROUP BY col2, col1
----
78
78
78

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1913
SELECT DISTINCT col1 + col1 * + - 66 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN - col0 AND col1 / - col0 * - col2 + CAST( NULL AS SIGNED ) GROUP BY col1 HAVING NOT 47 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1913
SELECT DISTINCT col1 + col1 * + - 66 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN - col0 AND col1 / - col0 * - col2 + CAST ( NULL AS INTEGER ) GROUP BY col1 HAVING NOT 47 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 95 * - ( - 56 ) * + ( - + 69 ) FROM tab0 AS cor0 GROUP BY col1
----
-367080

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL ( - COALESCE ( + 57, - col0 * 81 * col1 ) ) FROM tab1 GROUP BY col1
----
-57
-57
-57

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 - col1 * COALESCE ( - + 86, - + col0 * - + col1 + col2, col2 ) - 55 * + - 11 AS col1 FROM tab2 AS cor0 WHERE col1 NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 + - + col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 * 16 AS col2 FROM tab1 GROUP BY col1, col1
----
102
748
969

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + - + col0 + + NULLIF ( - - 35, + col2 ) col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
35

query I rowsort
SELECT - - 39 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
39
39

query I rowsort
SELECT + col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT col1 + - - col1 * col1 FROM tab0 GROUP BY col1
----
0
6642

query I rowsort
SELECT - col1 * - col1 * - + col1 FROM tab1 GROUP BY col0, col1
----
-185193
-216
-85184

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1925
SELECT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING 84 + - AVG ( - col0 ) + - col0 + + + CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-1925
SELECT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING 84 + - AVG ( - col0 ) + - col0 + + + CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT col0 * 86 <= 11
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - - 3 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
3

query I rowsort
SELECT DISTINCT 77 FROM tab1 GROUP BY col0
----
77

onlyif mysql # DIV for integer division: 
query I rowsort label-1929
SELECT + col2 DIV + + col2 + col2 * + col2 * - + ( col2 ) FROM tab0 GROUP BY col2
----
-13823
-493038
-54871

skipif mysql # not compatible
query I rowsort label-1929
SELECT + col2 / + + col2 + col2 * + col2 * - + ( col2 ) FROM tab0 GROUP BY col2
----
-13823
-493038
-54871

query II rowsort
SELECT ALL col1 + - col1 AS col2, col1 FROM tab2 GROUP BY col1
----
0
41
0
59
0
61

query I rowsort
SELECT ALL + - 30 FROM tab1 AS cor0 GROUP BY col0
----
-30
-30
-30

query I rowsort
SELECT ALL + 87 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
87
87
87

query I rowsort
SELECT + 10 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col1 AS col1, - col1 FROM tab1 AS cor0 WHERE - col2 > NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + 92 FROM tab0 AS cor0 GROUP BY col2
----
92

query I rowsort
SELECT DISTINCT col1 * + 24 FROM tab0 AS cor0 GROUP BY col1
----
0
1944

query I rowsort
SELECT - col1 + + - ( + 13 ) + - - col1 + - - col1 FROM tab0 GROUP BY col1
----
-13
68

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col2, col0
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1939
SELECT - - col0 + - COALESCE ( + + 38, - + col0, + CAST( - + 25 AS SIGNED ) ) col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT - AVG ( + + col2 ) IN ( col0, 73 )
----
-10
-16
44

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1939
SELECT - - col0 + - COALESCE ( + + 38, - + col0, + CAST ( - + 25 AS INTEGER ) ) col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT - AVG ( + + col2 ) IN ( col0, 73 )
----
-10
-16
44

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - ( col0 ), - col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT ALL ( - col1 ) + - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT + - col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1942
SELECT - 92 * + CAST( NULL AS SIGNED ) * - ( - ( 66 ) ) * + + col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1942
SELECT - 92 * + CAST ( NULL AS INTEGER ) * - ( - ( 66 ) ) * + + col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 14 FROM tab1 GROUP BY col2
----
-14
-14
-14

query I rowsort
SELECT DISTINCT + col1 * + col1 * col1 * col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) <= + 83 GROUP BY col1
----

query I rowsort
SELECT + col1 + + col1 / col0 + + - 4 + + - 75 / + 5 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NULL IS NOT NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1946
SELECT + col1 * 89 - col1 + col1 DIV - - col0 - 42 FROM tab1 AS cor0 GROUP BY col0, col1
----
3830
486
4976

skipif mysql # not compatible
query I rowsort label-1946
SELECT + col1 * 89 - col1 + col1 / - - col0 - 42 FROM tab1 AS cor0 GROUP BY col0, col1
----
3830
486
4976

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - ( - col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING ( + col2 >= ( NULL ) )
----

query I rowsort
SELECT ALL 9 * - col2 AS col1 FROM tab0 GROUP BY col2
----
-216
-342
-711

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab2 WHERE NOT + - 5 IS NULL GROUP BY col1
----
41
59
61

query II rowsort
SELECT + ( - ( ( + col2 ) ) ) + + col2 + + col2 + - ( + col2 ) * - col2 AS col2, + col2 / + - col2 FROM tab2 WHERE NOT NULL >= NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1951
SELECT DISTINCT - + col1 + - 5 * - CAST( NULL AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-1951
SELECT DISTINCT - + col1 + - 5 * - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT + col0 * + - 62 * 0 + - col1 FROM tab0 WHERE + 92 + + - ( - NULLIF ( + col0, + 90 ) ) IS NULL GROUP BY col1, col0 HAVING NOT NULL BETWEEN 93 AND + NULLIF ( + 57, 22 ) * + col0
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + 63 FROM tab2 AS cor0 GROUP BY col1
----
63

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 WHERE NULL > NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL col0 + - 24 * 52 AS col2 FROM tab1 GROUP BY col0
----
-1166
-1220
-1226

onlyif mysql # DIV for integer division: 
query I rowsort label-1957
SELECT 33 DIV - + ( + + 48 ) FROM tab0 GROUP BY col1
----
0
0

skipif mysql # not compatible
query I rowsort label-1957
SELECT 33 / - + ( + + 48 ) FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col1 HAVING NOT + 80 - - - col0 < + col1 + - 49 * + + col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - 9 AS col1 FROM tab0 WHERE NULL IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 18 * - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-1476
-396
-504

query I rowsort
SELECT - 30 * col1 * - col1 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT - col0 + col0 * + ( + + AVG ( 11 ) ) AS col2 FROM tab0 GROUP BY col0 HAVING - - 38 < NULL
----

query I rowsort
SELECT - - ( 69 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN 44 AND + 26
----

query I rowsort
SELECT 90 AS col2 FROM tab0 AS cor0 WHERE NOT col2 BETWEEN 82 AND NULL GROUP BY col0, col1
----
90
90
90

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT 20 + ( - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-18
-4
-59

query I rowsort
SELECT ALL + 6 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL AND NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 AS cor0 WHERE ( NULL IS NOT NULL ) GROUP BY col0
----

query I rowsort
SELECT ALL + ( col2 ) FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query II rowsort
SELECT + col2, + col0 + + ( col0 ) + - col0 FROM tab2 GROUP BY col2, col0
----
58
92
79
91
87
15

query I rowsort
SELECT - col1 * ( - - col1 ) + + col1 FROM tab1 GROUP BY col1, col1
----
-1892
-30
-3192

query II rowsort
SELECT ALL + 38 * + - 29 + col0 AS col0, col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-1019
83
-1059
43
-1076
26

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT + col2 AS col1 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT + 94 * 9 + + col0 FROM tab0 GROUP BY col0, col1 HAVING NOT + 92 + col0 * + col0 IS NULL
----
872
889
929

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 - + col2 col0 FROM tab1 GROUP BY col0, col2
----
-17
11
14

query I rowsort
SELECT 68 - col0 FROM tab0 GROUP BY col0, col0
----
-15
25
42

query I rowsort
SELECT - col1 + - col1 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 WHERE NOT + CASE + 87 WHEN col1 THEN col1 ELSE NULL END NOT BETWEEN - col1 / + col1 AND NULL GROUP BY col1 HAVING NOT col1 * 75 IS NOT NULL
----

query I rowsort
SELECT ( - ( - col0 ) ) FROM tab0 GROUP BY col0 HAVING NULL IN ( 93 )
----

query I rowsort
SELECT DISTINCT 91 AS col1 FROM tab1 WHERE ( + 67 / - 38 ) IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) IN ( + 73 )
----

query I rowsort
SELECT 82 + - col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
11
37
74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col1, col2 HAVING 32 + ( col2 ) >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + + 8 col0, col1 + 8 * 91 + + 57 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT 63 * - col1 * + col1 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1988
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + 36 AND - CAST( NULL AS SIGNED ) + - - 75
----

skipif mysql # not compatible
query I rowsort label-1988
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + 36 AND - CAST ( NULL AS INTEGER ) + - - 75
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1989
SELECT + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 WHERE ( ( NOT NULL IS NOT NULL ) ) GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1989
SELECT + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 WHERE ( ( NOT NULL IS NOT NULL ) ) GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col0 + + - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL + - 10 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-10
-10
-10

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col0 FROM tab2 cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
-22
-28
-82

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1994
SELECT DISTINCT - CAST( NULL AS DECIMAL ) AS col1 FROM tab0 cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-1994
SELECT DISTINCT - CAST ( NULL AS REAL ) AS col1 FROM tab0 cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT DISTINCT 19 FROM tab1 GROUP BY col2, col2
----
19

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING NOT - 60 / - AVG ( + - col2 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1997
SELECT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-1997
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 20 * - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - + col1 = + + 70
----
0
1620

query II rowsort
SELECT + col0, + 82 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN 38 AND NULL
----

query I rowsort
SELECT + 78 + + + 57 FROM tab0 GROUP BY col2, col2, col0
----
135
135
135

query I rowsort
SELECT ALL - - 25 * - - col2 * 99 - + 78 - - col2 * - ( 10 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
142892
194657
214377

onlyif mysql # DIV for integer division: 
query II rowsort label-2002
SELECT - col2 DIV + - col2 - + - 11 + + 10, + 46 * + 79 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
22
3634
22
3634
22
3634

skipif mysql # not compatible
query II rowsort label-2002
SELECT - col2 / + - col2 - + - 11 + + 10, + 46 * + 79 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
22
3634
22
3634
22
3634

onlyif mysql # DIV for integer division: 
query II rowsort label-2003
SELECT col0, ( - 58 ) DIV - col2 AS col2 FROM tab2 GROUP BY col0, col2
----
15
0
91
0
92
1

skipif mysql # not compatible
query II rowsort label-2003
SELECT col0, ( - 58 ) / - col2 AS col2 FROM tab2 GROUP BY col0, col2
----
15
0
91
0
92
1

query I rowsort
SELECT 48 FROM tab2 AS cor0 GROUP BY col1
----
48
48
48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 98 * + col1 * 81 * + col1 col0 FROM tab1 GROUP BY col1
----
15367968
25790562
285768

query I rowsort
SELECT - 78 AS col1 FROM tab1 GROUP BY col0
----
-78
-78
-78

query I rowsort
SELECT ALL + 17 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
17
17
17

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 27 col1 FROM tab0 AS cor0 GROUP BY col2
----
-27
-27
-27

query I rowsort
SELECT - + 44 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-2508
-264

query I rowsort
SELECT ALL col2 * col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0, col2 HAVING NOT ( NOT - col2 / 64 IS NULL )
----

query I rowsort
SELECT DISTINCT + col1 * col2 FROM tab1 cor0 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT ALL - + col0 * + + ( + + col0 ) FROM tab1 AS cor0 WHERE NOT 73 IS NULL GROUP BY col0 HAVING NOT + 52 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + col1 + - col1 AS col1, - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - 0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query II rowsort label-2018
SELECT ALL + col2 * + - col2 + + + col2 * - col2 DIV + col2 + col2 AS col1, ( + 9 ) * + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
342
-576
216
-6241
711

skipif mysql # not compatible
query II rowsort label-2018
SELECT ALL + col2 * + - col2 + + + col2 * - col2 / + col2 + col2 AS col1, ( + 9 ) * + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
342
-576
216
-6241
711

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2019
SELECT ALL col2 * - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2019
SELECT ALL col2 * - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 44 col0 FROM tab1 GROUP BY col2
----
-44
-44
-44

query I rowsort
SELECT DISTINCT - - 92 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL 87 AS col2 FROM tab2 GROUP BY col1 HAVING - 32 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 + ( - col0 ) FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + 66 * - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
6006
6072
990

onlyif mysql # DIV for integer division: 
query I rowsort label-2026
SELECT DISTINCT 38 * - col2 DIV + col2 col1 FROM tab1 GROUP BY col2
----
-38

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2026
SELECT DISTINCT 38 * - col2 / + col2 col1 FROM tab1 GROUP BY col2
----
-38

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING + 16 + + - col2 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2028
SELECT col0 DIV - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2028
SELECT col0 / - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT 36 * 56 AS col1 FROM tab0 GROUP BY col2
----
2016

query I rowsort
SELECT - 96 FROM tab0 GROUP BY col1, col1
----
-96
-96

query I rowsort
SELECT col2 * col2 AS col1 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT ALL 79 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - 1 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + 20 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
20

query I rowsort
SELECT ALL col1 + 69 FROM tab2 GROUP BY col1
----
110
128
130

query I rowsort
SELECT ( col2 ) AS col2 FROM tab2 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col2, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - AVG ( + + col1 ) * col1 col2, col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
44
-3249
57
-36
6

query I rowsort
SELECT ALL + - 96 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-96
-96
-96

query I rowsort
SELECT ALL + ( - col0 ) AS col0 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL 90 AS col0 FROM tab0 GROUP BY col2, col1
----
90
90
90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2042
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-2042
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col2
----
NULL

query I rowsort
SELECT ALL + + 45 FROM tab1 AS cor0 GROUP BY col2
----
45
45
45

query II rowsort
SELECT ALL + col0 AS col1, col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 + + col0 AS col1 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT 42 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 84 col0 FROM tab2 GROUP BY col0
----
84

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2048
SELECT DISTINCT + NULLIF ( CAST( NULL AS DECIMAL ), + + 35 ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2048
SELECT DISTINCT + NULLIF ( CAST ( NULL AS REAL ), + + 35 ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2049
SELECT + CAST( 96 AS SIGNED ) * 57 AS col0, 87 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
5472
87
5472
87
5472
87

skipif mysql # not compatible
query II rowsort label-2049
SELECT + CAST ( 96 AS INTEGER ) * 57 AS col0, 87 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
5472
87
5472
87
5472
87

query I rowsort
SELECT 7 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 * - + 43 FROM tab2 GROUP BY col1
----
1763
2537
2623

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2052
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + - 63 + + col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2052
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + - 63 + + col1 IS NOT NULL
----

query I rowsort
SELECT 26 AS col2 FROM tab0 cor0 GROUP BY col1, col0
----
26
26
26

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2054
SELECT + col2 * + CAST( NULL AS DECIMAL ) col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2054
SELECT + col2 * + CAST ( NULL AS REAL ) col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 69 AS col1 FROM tab1 cor0 WHERE NOT ( NOT ( + 36 ) IS NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT - 36 FROM tab2 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query II rowsort
SELECT col1, 25 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
25
59
25
61
25

query I rowsort
SELECT 70 FROM tab0 AS cor0 GROUP BY col1, col0
----
70
70
70

query I rowsort
SELECT - 62 * + col2 AS col1 FROM tab2 AS cor0 WHERE NOT ( NOT ( 82 ) NOT IN ( ( + col2 ) ) ) GROUP BY col2
----
-3596
-4898
-5394

query I rowsort
SELECT + - col0 AS col0 FROM tab0 WHERE NOT + + col0 / 88 IS NULL GROUP BY col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( + col0 ) col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 12 IS NOT NULL
----

query I rowsort
SELECT + col2 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NULL IN ( + ( - - ( CASE WHEN 64 IN ( col0 * - col2 + + col1 ) THEN - 98 END ) ) * - 13 )
----

query I rowsort
SELECT ALL 34 FROM tab2 GROUP BY col0, col0
----
34
34
34

onlyif mysql # DIV for integer division: 
query I rowsort label-2064
SELECT ALL 76 DIV - col2 FROM tab0 GROUP BY col2
----
-2
-3
0

skipif mysql # not compatible
query I rowsort label-2064
SELECT ALL 76 / - col2 FROM tab0 GROUP BY col2
----
-2
-3
0

query I rowsort
SELECT ALL - 43 - - col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-43
38

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col2, col1, col1 HAVING NOT - col1 IS NULL
----
45
71
8

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NULL = + - 76 ) )
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 WHERE NOT NULL <= ( + col0 ) GROUP BY col1 HAVING NULL NOT IN ( + 99 )
----

query I rowsort
SELECT col1 + + col1 FROM tab1 cor0 GROUP BY col1 HAVING 68 IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2071
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - CAST( NULL AS DECIMAL ) > NULL
----

skipif mysql # not compatible
query I rowsort label-2071
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - CAST ( NULL AS REAL ) > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2072
SELECT + COALESCE ( - 48, - col0, col0 ) DIV col2 col1 FROM tab0 cor0 GROUP BY col2
----
-1
-2
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2072
SELECT + COALESCE ( - 48, - col0, col0 ) / col2 col1 FROM tab0 cor0 GROUP BY col2
----
-1
-2
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2073
SELECT - 18 FROM tab2 cor0 WHERE NOT col1 - + CAST( + 18 AS SIGNED ) IN ( 22 ) GROUP BY col0, col1 HAVING NOT 42 * 26 <= NULL
----

skipif mysql # not compatible
query I rowsort label-2073
SELECT - 18 FROM tab2 cor0 WHERE NOT col1 - + CAST ( + 18 AS INTEGER ) IN ( 22 ) GROUP BY col0, col1 HAVING NOT 42 * 26 <= NULL
----

query I rowsort
SELECT + 81 FROM tab0 WHERE NOT ( - col1 * - col1 ) = NULLIF ( + 31, ( col0 ) + + col1 ) - + 69 GROUP BY col2, col1
----
81
81
81

query I rowsort
SELECT DISTINCT col2 + - 62 + + 63 FROM tab2 GROUP BY col2
----
59
80
88

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col2, col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * 86 col0 FROM tab2 GROUP BY col0, col0, col2 HAVING NOT NULL > 15 * 50
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 37 col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-37
-37
-37

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL >= - col1 + ( col2 )
----

query I rowsort
SELECT + col2 * col2 FROM tab2 AS cor0 WHERE ( - 94 ) NOT BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT col2 + col2 > 18 + ( 19 )
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( NOT NULL = + col2 )
----

query I rowsort
SELECT DISTINCT - + ( col1 ) + AVG ( + 5 ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - ( + col2 ) + - 51 FROM tab1 AS cor0 GROUP BY col1, col2
----
-122
-59
-96

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 AS cor0 WHERE - NULLIF ( + 86, - 31 * - col0 - + 9 ) IS NULL GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL >= col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2086
SELECT DISTINCT - CAST( - 51 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
51

skipif mysql # not compatible
query I rowsort label-2086
SELECT DISTINCT - CAST ( - 51 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
51

query I rowsort
SELECT - 17 FROM tab2 GROUP BY col1
----
-17
-17
-17

query I rowsort
SELECT 97 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
97
97
97

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING - col2 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT IN ( + 41 )
----

query I rowsort
SELECT DISTINCT + col2 * - 1 * + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2093
SELECT - col1 * - - ( ( + + CAST( NULL AS SIGNED ) ) ), + 50 col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2093
SELECT - col1 * - - ( ( + + CAST ( NULL AS INTEGER ) ) ), + 50 col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - - 24 + + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 + + col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + 8 col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 * + col1, + col1 * col1 + + col1 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 59 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
59
59
59

query II rowsort
SELECT DISTINCT - col2 AS col1, - ( - col2 ) + - col2 - + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT 47 IS NULL
----
-24
-24
-38
-38
-79
-79

query I rowsort
SELECT + 56 + + col0 + - 6 FROM tab0 AS cor0 GROUP BY col0 HAVING - col0 >= NULL
----

query I rowsort
SELECT ALL + 13 FROM tab2 AS cor0 GROUP BY col0
----
13
13
13

query I rowsort
SELECT col2 * ( col2 ) FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + 83 * - + 2 FROM tab1 AS cor0 GROUP BY col2
----
-166
-166
-166

query I rowsort
SELECT DISTINCT + 92 FROM tab1 AS cor0 GROUP BY col2
----
92

query I rowsort
SELECT + 79 + - col2 FROM tab2 GROUP BY col2, col1
----
-8
0
21

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT ALL col2 + + col2 col0, col2 * col2 AS col2, 87 FROM tab2 GROUP BY col2
----
9 values hashing to 33cb52a23dd54bb82284e857c641ea18

query I rowsort
SELECT - 32 * - 19 FROM tab2 AS cor0 GROUP BY col1
----
608
608
608

query I rowsort
SELECT ALL + 4 FROM tab0 GROUP BY col1
----
4
4

query I rowsort
SELECT ALL + col1 + 47 * + col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1968
2832
2928

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2110
SELECT DISTINCT + - CAST( + + 18 AS SIGNED ) * + ( - - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT + col1 IS NULL
----
-1044
-1422
-1566

skipif mysql # not compatible
query I rowsort label-2110
SELECT DISTINCT + - CAST ( + + 18 AS INTEGER ) * + ( - - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT + col1 IS NULL
----
-1044
-1422
-1566

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE col1 >= 43 GROUP BY col1
----
-81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2112
SELECT - CAST( + col2 AS SIGNED ) FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-2112
SELECT - CAST ( + col2 AS INTEGER ) FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT + 90 * + - 53 + + 89 AS col2 FROM tab1 GROUP BY col0 HAVING NOT - 90 + - + col0 IS NULL
----
-4681
-4681
-4681

query I rowsort
SELECT DISTINCT + 52 * - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
2288
2964
312

query I rowsort
SELECT ALL 98 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
98
98
98

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2116
SELECT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0 HAVING + CAST( - col0 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-2116
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + CAST ( - col0 AS INTEGER ) IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 39 * - 65 / + col1 + col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col0 <= NULL
----

query II rowsort
SELECT DISTINCT col0, - col1 AS col1 FROM tab2 GROUP BY col0, col1
----
15
-61
91
-59
92
-41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2119
SELECT ALL + ( 51 ) * - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0, col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2119
SELECT ALL + ( 51 ) * - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0, col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT 1 AS col0 FROM tab0 GROUP BY col1
----
1
1

query I rowsort
SELECT ALL - col2 + - 41 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-112
-49
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query II rowsort
SELECT DISTINCT 66, + col0 - - + col1 / - CASE col0 WHEN + col1 THEN NULL WHEN - col1 + col0 / - 10 THEN + + col0 * + col1 - col0 + - col0 END AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
66
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2125
SELECT ALL col2 * - AVG ( ALL col2 ) - - col2 - + 70 AS col1 FROM tab2 cor0 WHERE NULL NOT BETWEEN ( NULL ) AND - + CAST( - 75 AS SIGNED ) + - - col2 GROUP BY col2, col2
----

skipif mysql # not compatible
query I rowsort label-2125
SELECT ALL col2 * - AVG ( ALL col2 ) - - col2 - + 70 AS col1 FROM tab2 cor0 WHERE NULL NOT BETWEEN ( NULL ) AND - + CAST ( - 75 AS INTEGER ) + - - col2 GROUP BY col2, col2
----

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + + ( - col2 ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT + col0 * col0 * 7 FROM tab0 GROUP BY col0, col0
----
12943
4732
48223

query I rowsort
SELECT 24 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + 56 AS col2 FROM tab2 GROUP BY col2, col0, col1
----
56
56
56

query I rowsort
SELECT ( + + 42 ) AS col0 FROM tab0 GROUP BY col2
----
42
42
42

query II rowsort
SELECT col1 AS col2, 56 FROM tab1 GROUP BY col1
----
44
56
57
56
6
56

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col0, col2
----
-41
-59
-61

query I rowsort
SELECT ALL - 78 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND - col1
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col2 HAVING ( NOT - 49 IS NULL )
----
58
79
87

query I rowsort
SELECT ALL col1 + - - 60 FROM tab1 GROUP BY col1, col2
----
104
117
66

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 65 col1 FROM tab2 AS cor0 GROUP BY col0
----
65

query I rowsort
SELECT ALL ( 34 ) * - 81 + - - 61 AS col1 FROM tab0 cor0 GROUP BY col2, col1
----
-2693
-2693
-2693

query II rowsort
SELECT ALL col1, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
38
0
79
81
24

query I rowsort
SELECT ( + col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL 88 FROM tab2 GROUP BY col1
----
88
88
88

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2143
SELECT - + col0 * CAST( NULL AS SIGNED ) * - - col0 * + ( 79 ) * + col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2143
SELECT - + col0 * CAST ( NULL AS INTEGER ) * - - col0 * + ( 79 ) * + col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2144
SELECT CASE col0 WHEN - - 90 THEN NULL ELSE - col0 * + CAST( NULL AS SIGNED ) END FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2144
SELECT CASE col0 WHEN - - 90 THEN NULL ELSE - col0 * + CAST ( NULL AS INTEGER ) END FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 34 + + + col2 FROM tab2 GROUP BY col2, col2 HAVING ( NULL ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT - 16 * 60 * - 50 BETWEEN ( NULL ) AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2147
SELECT ALL + CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2147
SELECT ALL + CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 30 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
30
30
30

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col2, 90 col1 FROM tab1 GROUP BY col0, col0
----
22
90
28
90
82
90

query I rowsort
SELECT ALL + 14 AS col2 FROM tab2 GROUP BY col1, col2
----
14
14
14

query I rowsort
SELECT ALL + 23 AS col2 FROM tab1 GROUP BY col0, col2
----
23
23
23

query I rowsort
SELECT + col2 + 58 / - col2 AS col1 FROM tab1 cor0 WHERE col2 * + + col0 * ( - col2 ) - + 25 BETWEEN COALESCE ( - + 43, - col1, - - col1 * + 19 ) AND col0 + + 67 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col2, + col2 - - 58 + + 4 + - - col2 * + 91 * - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING NOT ( NOT col2 <= NULL )
----

query I rowsort
SELECT ALL + col0 + - + 92 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-1
-77
0

query I rowsort
SELECT + ( + 40 ) FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - 41 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2158
SELECT ALL CAST( NULL AS SIGNED ), col0 AS col1 FROM tab1 GROUP BY col0, col2
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-2158
SELECT ALL CAST ( NULL AS INTEGER ), col0 AS col1 FROM tab1 GROUP BY col0, col2
----
NULL
22
NULL
28
NULL
82

query I rowsort
SELECT col2 + - 59 FROM tab0 GROUP BY col2
----
-21
-35
20

query I rowsort
SELECT col1 + 1 * 1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
1
82

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-22
-28
-82

query I rowsort
SELECT col0 + col0 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) < ( NULL ) GROUP BY col0
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT ( + 82 ) NOT BETWEEN + 19 AND NULL
----

query I rowsort
SELECT col0 * - col0 * - col0 FROM tab0 GROUP BY col0
----
17576
571787
79507

query I rowsort
SELECT ALL 60 FROM tab1 GROUP BY col0
----
60
60
60

query I rowsort
SELECT ALL + 94 FROM tab2 GROUP BY col1 HAVING NOT + col1 BETWEEN NULL AND 68
----

query II rowsort
SELECT - ( ( - col0 ) ) + - 81 AS col2, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT + 78 IS NULL
----
-38
43
-55
26
2
83

query I rowsort
SELECT ( + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL - 96 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * col0 * - - 25 * + - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-14294675
-1987675
-439400

onlyif mysql # DIV for integer division: 
query I rowsort label-2172
SELECT - col2 * + - col2 + + + 40 DIV - col2 + + col1 + - + 89 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING NULL IS NULL
----
-1799
-4783
6295

skipif mysql # not compatible
query I rowsort label-2172
SELECT - col2 * + - col2 + + + 40 / - col2 + + col1 + - + 89 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING NULL IS NULL
----
-1799
-4783
6295

query I rowsort
SELECT - 76 + + col0 * - + 66 * - 28 FROM tab0 AS cor0 GROUP BY col1, col0
----
153308
47972
79388

query I rowsort
SELECT + 37 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
37
37
37

query I rowsort
SELECT + - col0 AS col2 FROM tab1 cor0 WHERE NULL >= col0 GROUP BY col0
----

query I rowsort
SELECT - 8 * - col1 FROM tab2 GROUP BY col1
----
328
472
488

query I rowsort
SELECT DISTINCT ( - 41 ) AS col2 FROM tab2 GROUP BY col2
----
-41

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 7 FROM tab1 GROUP BY col0, col2 HAVING NOT 86 IS NULL
----
-7
-7
-7

query I rowsort
SELECT DISTINCT + col0 * col0 AS col2 FROM tab0 WHERE ( col2 ) IS NOT NULL GROUP BY col0 HAVING - 62 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + col1 col1 FROM tab2 GROUP BY col1 HAVING 41 IS NOT NULL
----
1681
3481
3721

query I rowsort
SELECT 70 * + 9 AS col1 FROM tab1 WHERE NOT + CASE 72 WHEN + col1 THEN - col0 + + 20 / col2 END = NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT 32 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
32
32
32

query I rowsort
SELECT + col1 * + 53 AS col1 FROM tab1 GROUP BY col1, col1
----
2332
3021
318

query I rowsort
SELECT col0 * - 31 AS col0 FROM tab1 GROUP BY col0
----
-2542
-682
-868

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2, col1 HAVING ( + 61 ) < ( 71 )
----
24
38
79

query I rowsort
SELECT ALL ( 8 ) + col1 FROM tab1 GROUP BY col1, col1
----
14
52
65

query I rowsort
SELECT 65 * - col1 FROM tab2 GROUP BY col1
----
-2665
-3835
-3965

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2190
SELECT 9 * ( + col1 ) AS col0 FROM tab0 WHERE ( + CAST( col0 AS SIGNED ) ) IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

skipif mysql # not compatible
query I rowsort label-2190
SELECT 9 * ( + col1 ) AS col0 FROM tab0 WHERE ( + CAST ( col0 AS INTEGER ) ) IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT 14 FROM tab2 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NOT NULL
----
14
14
14

query I rowsort
SELECT DISTINCT - 31 FROM tab0 GROUP BY col1
----
-31

query I rowsort
SELECT DISTINCT col0 + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
182
184
30

query I rowsort
SELECT - NULLIF ( - 45, + 66 ) + ( col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0
----
127
67
73

query I rowsort
SELECT ALL 67 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
110
150
93

query I rowsort
SELECT + col0 - + 62 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL ( 19 ) FROM tab2 GROUP BY col1
----
19
19
19

query I rowsort
SELECT col1 + + col1 AS col2 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 GROUP BY col2, col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 23 AS col2 FROM tab0 GROUP BY col0
----
23
23
23

query I rowsort
SELECT DISTINCT - - 40 FROM tab2 AS cor0 GROUP BY col0, col1
----
40

query I rowsort
SELECT + 69 FROM tab0 AS cor0 WHERE NOT + col2 / col2 + 28 NOT BETWEEN + col1 AND NULL GROUP BY col0 HAVING NOT ( col0 ) IS NULL
----

query I rowsort
SELECT ALL - ( 40 ) + + 14 * 97 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING + AVG ( 66 ) / col0 IS NULL
----

query I rowsort
SELECT DISTINCT + ( + col1 ) * - 50 * + col1 + 45 * col1 FROM tab0 AS cor0 GROUP BY col1
----
-324405
0

query I rowsort
SELECT ALL + 60 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IN ( - - col2 )
----

query I rowsort
SELECT DISTINCT 2 - + col1 - - - 20 FROM tab0 AS cor0 GROUP BY col1
----
-18
-99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2207
SELECT DISTINCT - ( + CASE + - 34 WHEN - ( + - col1 ) THEN NULL ELSE + - CAST( + ( + + 34 ) AS SIGNED ) END ) FROM tab1 cor0 GROUP BY col2, col1 HAVING NULL > 92
----

skipif mysql # not compatible
query I rowsort label-2207
SELECT DISTINCT - ( + CASE + - 34 WHEN - ( + - col1 ) THEN NULL ELSE + - CAST ( + ( + + 34 ) AS INTEGER ) END ) FROM tab1 cor0 GROUP BY col2, col1 HAVING NULL > 92
----

query I rowsort
SELECT + col1 * 18 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
1458

query I rowsort
SELECT col2 * + 65 * + col2 * - - 56 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
12244960
22717240
27551160

query I rowsort
SELECT + 76 * - 88 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-6688
-6688
-6688

query II rowsort
SELECT col0 AS col2, + col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query II rowsort
SELECT - 52 AS col0, - 28 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col1 * - col1 AS col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT + 42 FROM tab2 GROUP BY col1, col1
----
42
42
42

query II rowsort
SELECT ALL col1 + - col0, - 93 * + CASE - col0 WHEN - - 38 + - col0 - col0 THEN col2 WHEN col1 - ( - col0 ) THEN + COALESCE ( col2, + col1 ) * - 86 + 38 WHEN + col0 THEN NULL END FROM tab1 GROUP BY col2, col0, col1 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 * col1 col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT 38 IS NULL
----
-6561
0

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col0, col1
----
-58
-79
-87

query I rowsort
SELECT + 12 * + col1 * col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
23232
38988
432

query I rowsort
SELECT + 58 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
2552
3306
348

query I rowsort
SELECT + 64 AS col2 FROM tab1 AS cor0 WHERE NOT col1 <> NULL GROUP BY col2 HAVING NOT + + ( + - col2 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-2221
SELECT DISTINCT 43 DIV - - ( - CAST( - col0 AS SIGNED ) ) col2, - 59 * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
-5278
0
-5336
2
-870

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2221
SELECT DISTINCT 43 / - - ( - CAST ( - col0 AS INTEGER ) ) col2, - 59 * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
-5278
0
-5336
2
-870

query I rowsort
SELECT ( + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + - col2 * + col0 * + - col1 FROM tab0 AS cor0 WHERE NULL BETWEEN + + 5 AND ( NULL ) AND + - col1 IS NOT NULL GROUP BY col0, col2, col1
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 WHERE NOT col2 NOT IN ( + + col2 ) GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1 HAVING NOT + - 36 * col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col2 + + + col2 * + 26 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL + 65 AS col0, col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( col2, col2 * + + 24 + - ( col2 ), + 11 * + + col1 ) GROUP BY col1, col2 HAVING NULL NOT BETWEEN ( - col0 + 81 ) AND col0
----

query II rowsort
SELECT col2 AS col2, + 62 AS col0 FROM tab1 GROUP BY col2
----
45
62
71
62
8
62

onlyif mysql # DIV for integer division: 
query I rowsort label-2229
SELECT ALL + col0 DIV - - ( 97 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2229
SELECT ALL + col0 / - - ( 97 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT 32 + - - col2 FROM tab1 GROUP BY col2, col2
----
103
40
77

query I rowsort
SELECT DISTINCT col2 * - 86 AS col2 FROM tab1 GROUP BY col1, col2, col0 HAVING ( 83 BETWEEN - - 38 AND 56 )
----

query I rowsort
SELECT DISTINCT 72 + + - col0 FROM tab0 GROUP BY col1, col0
----
-11
29
46

query I rowsort
SELECT - ( - col0 ) AS col2 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT 46 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col2 + + - 70, col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-115
45
-141
71
-78
8

query I rowsort
SELECT NULLIF ( + 85, - col2 ) + + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
109
123
164

query I rowsort
SELECT 61 FROM tab0 AS cor0 GROUP BY col2, col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
61
61
61

query I rowsort
SELECT 16 FROM tab0 GROUP BY col1, col0
----
16
16
16

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 WHERE NOT + - col2 = NULL GROUP BY col2 HAVING - - col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2240
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2240
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col1, col1
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-2242
SELECT - 51 DIV 1 - - col0 FROM tab2 GROUP BY col0
----
-36
40
41

skipif mysql # not compatible
query I rowsort label-2242
SELECT - 51 / 1 - - col0 FROM tab2 GROUP BY col0
----
-36
40
41

query I rowsort
SELECT ALL - 85 * col1 AS col0 FROM tab0 GROUP BY col1, col1
----
-6885
0

query I rowsort
SELECT ALL - 35 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-35
-35
-35

query I rowsort
SELECT DISTINCT - ( + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT + col0 IS NOT NULL
----

query II rowsort
SELECT 99 AS col2, + col1 + + 12 FROM tab2 GROUP BY col1, col0
----
99
53
99
71
99
73

query I rowsort
SELECT ALL - + 81 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-81
-81
-81

query I rowsort
SELECT DISTINCT + 66 + - 19 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-36
21
4

query I rowsort
SELECT - + 44 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-44
-44
-44

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT - ( + - 80 ) / + 14 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 59 FROM tab2 GROUP BY col1, col0
----
59

query I rowsort
SELECT ALL + 57 + 68 FROM tab0 GROUP BY col1, col0 HAVING + 66 * - + AVG ( - col1 ) IS NOT NULL
----
125
125
125

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT + col2 - - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col2 + + col2 * col2 + + + col2 - 80 - + col2 FROM tab2 AS cor0 GROUP BY col2
----
3226
6082
7402

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2258
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT 5 <= + + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-2258
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT 5 <= + + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT DISTINCT + 51 AS col1 FROM tab1 GROUP BY col0, col0
----
51

query I rowsort
SELECT ALL - - 50 FROM tab0 AS cor0 GROUP BY col2, col2
----
50
50
50

query I rowsort
SELECT ALL + - 74 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-74
-74
-74

query II rowsort
SELECT DISTINCT col1 + + col2, - col1 + + ( + + col1 ) AS col2 FROM tab2 GROUP BY col1, col1, col2 HAVING - ( - 86 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2263
SELECT - - col0 AS col0 FROM tab0 AS cor0 WHERE NOT COALESCE ( CAST( NULL AS SIGNED ), + 22, col1 + + 85 ) * + col1 <= CAST( NULL AS SIGNED ) * 24 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-2263
SELECT - - col0 AS col0 FROM tab0 AS cor0 WHERE NOT COALESCE ( CAST ( NULL AS INTEGER ), + 22, col1 + + 85 ) * + col1 <= CAST ( NULL AS INTEGER ) * 24 GROUP BY col0
----

query II rowsort
SELECT col2 + + col2, - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
116
-58
158
-79
174
-87

query I rowsort
SELECT - + col0 * 80 FROM tab0 cor0 GROUP BY col0
----
-2080
-3440
-6640

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2266
SELECT - - col2 AS col1, - col2 * + + 59 + - - CAST( NULL AS SIGNED ) FROM tab0 WHERE + 29 + + col0 = - + ( - col0 ) GROUP BY col1, col2
----

skipif mysql # not compatible
query II rowsort label-2266
SELECT - - col2 AS col1, - col2 * + + 59 + - - CAST ( NULL AS INTEGER ) FROM tab0 WHERE + 29 + + col0 = - + ( - col0 ) GROUP BY col1, col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - AVG ( - col1 ) * 60 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= ( - col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2268
SELECT DISTINCT - CAST( + + 34 AS SIGNED ) col2 FROM tab1 AS cor0 GROUP BY col2
----
-34

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2268
SELECT DISTINCT - CAST ( + + 34 AS INTEGER ) col2 FROM tab1 AS cor0 GROUP BY col2
----
-34

onlyif mysql # DIV for integer division: 
query I rowsort label-2269
SELECT + col1 DIV - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2269
SELECT + col1 / - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + ( col2 ) col0 FROM tab2 WHERE 84 > col0 * 48 GROUP BY col2
----

query I rowsort
SELECT 54 + - 0 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NOT NULL
----
54
54
54

query I rowsort
SELECT DISTINCT col2 * ( - ( - col2 ) ) FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col2 HAVING NOT 18 * + col2 < + 41 - 47
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST( NULL AS SIGNED ) / col1 - 6
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST ( NULL AS INTEGER ) / col1 - 6
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( + 49 ) IS NULL
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-2276
SELECT 26 DIV col1 FROM tab2 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2276
SELECT 26 / col1 FROM tab2 GROUP BY col1
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2277
SELECT DISTINCT 67 DIV - col2 FROM tab0 GROUP BY col2
----
-1
-2
0

skipif mysql # not compatible
query I rowsort label-2277
SELECT DISTINCT 67 / - col2 FROM tab0 GROUP BY col2
----
-1
-2
0

query I rowsort
SELECT - 57 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-57
-57
-57

query I rowsort
SELECT ALL ( + 29 ) * - 95 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 13 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IN ( 68 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 GROUP BY col0, col0 HAVING NOT ( + col0 + col1 ) >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2282
SELECT DISTINCT - col0 * col2 FROM tab0 WHERE NOT NULL BETWEEN + col0 AND - CAST( NULL AS SIGNED ) GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-2282
SELECT DISTINCT - col0 * col2 FROM tab0 WHERE NOT NULL BETWEEN + col0 AND - CAST ( NULL AS INTEGER ) GROUP BY col0, col2
----

query I rowsort
SELECT 97 * col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
3977
5723
5917

query I rowsort
SELECT col1 + - 3 * - 60 AS col0 FROM tab0 WHERE + col2 + col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col1 + col1 * col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
0
6642

query I rowsort
SELECT + 65 - + col1 FROM tab0 GROUP BY col1
----
-16
65

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 83 + col0 col1 FROM tab1 GROUP BY col0 HAVING NOT ( col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT 7 + col1 FROM tab1 GROUP BY col1
----
13
51
64

onlyif mysql # DIV for integer division: 
query I rowsort label-2289
SELECT col0 + + + 29 DIV - 46 FROM tab0 GROUP BY col1, col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-2289
SELECT col0 + + + 29 / - 46 FROM tab0 GROUP BY col1, col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2290
SELECT ALL 72 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( - col0 ) IN ( + ( CAST( NULL AS SIGNED ) ) )
----

skipif mysql # not compatible
query I rowsort label-2290
SELECT ALL 72 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( - col0 ) IN ( + ( CAST ( NULL AS INTEGER ) ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( col0 ) * + 63 col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT col0 + + 42 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2292
SELECT ALL + CAST( NULL AS SIGNED ) * col0 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2292
SELECT ALL + CAST ( NULL AS INTEGER ) * col0 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col0 + - 41 AS col2 FROM tab1 AS cor0 WHERE col2 BETWEEN NULL AND 52 + + col1 GROUP BY col2, col0 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL = ( col2 ) * ( - col2 )
----

query I rowsort
SELECT ( - 92 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL < ( 97 )
----

query I rowsort
SELECT NULLIF ( col0, + 67 + + 55 ) FROM tab0 GROUP BY col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) BETWEEN NULL AND + col2
----

query II rowsort
SELECT ALL + col0, col0 FROM tab1 cor0 GROUP BY col0 HAVING + 37 <= AVG ( + 87 ) * 40
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 91 AS col2, col2 - 72 col2 FROM tab1 GROUP BY col2 HAVING NULL >= 4 * 95
----

query I rowsort
SELECT ALL col2 + + - ( - col2 ) * 83 FROM tab2 GROUP BY col2
----
4872
6636
7308

query I rowsort
SELECT DISTINCT - - ( + + col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL + col2 * + 9 - col2 - col2 AS col0, 30 * - ( col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <= 98
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 WHERE col0 - + + 55 IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2305
SELECT - CAST( - 98 AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
98
98

skipif mysql # not compatible
query I rowsort label-2305
SELECT - CAST ( - 98 AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
98
98

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2306
SELECT col1 col0 FROM tab2 GROUP BY col1 HAVING + CAST( NULL AS DECIMAL ) + - 9 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2306
SELECT col1 col0 FROM tab2 GROUP BY col1 HAVING + CAST ( NULL AS REAL ) + - 9 IS NOT NULL
----

query I rowsort
SELECT - - 78 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
78
78
78

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
15
91
92

query II rowsort
SELECT 97 AS col1, - col2 FROM tab1 GROUP BY col0, col2
----
97
-45
97
-71
97
-8

query I rowsort
SELECT + - 5 + + - 97 * + col2 + + - ( + 11 ) FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
-5642
-7679
-8455

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2311
SELECT CAST( NULL AS DECIMAL ) + + ( - + col2 ) FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-2311
SELECT CAST ( NULL AS REAL ) + + ( - + col2 ) FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + 51 FROM tab0 AS cor0 GROUP BY col0, col1
----
51

onlyif mysql # DIV for integer division: 
query I rowsort label-2313
SELECT ALL 95 * 43 DIV - + col0 + - - 85 FROM tab2 AS cor0 GROUP BY col0
----
-187
41
41

skipif mysql # not compatible
query I rowsort label-2313
SELECT ALL 95 * 43 / - + col0 + - - 85 FROM tab2 AS cor0 GROUP BY col0
----
-187
41
41

query I rowsort
SELECT DISTINCT ( + - col0 ) * - col0 AS col1 FROM tab1 GROUP BY col0 HAVING - 79 - - 13 IS NOT NULL
----
484
6724
784

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + - 89 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-89

query I rowsort
SELECT - 74 - 32 FROM tab0 GROUP BY col2
----
-106
-106
-106

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2318
SELECT + CAST( - col1 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-2318
SELECT + CAST ( - col1 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col1 * + col1 * - 34 + - + col1 + ( + col1 ) AS col0 FROM tab0 WHERE - col0 IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2320
SELECT - 78 / - col1 * - 70 * + ( col1 ) * + CAST( NULL AS SIGNED ) / 40 + + 28 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col1 HAVING NULL BETWEEN NULL AND + 29 / + col1 * NULLIF ( col0, + 83 ) + + col1
----

skipif mysql # not compatible
query I rowsort label-2320
SELECT - 78 / - col1 * - 70 * + ( col1 ) * + CAST ( NULL AS INTEGER ) / 40 + + 28 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col1 HAVING NULL BETWEEN NULL AND + 29 / + col1 * NULLIF ( col0, + 83 ) + + col1
----

query I rowsort
SELECT - 35 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - col1 = NULL
----

query I rowsort
SELECT + 33 FROM tab0 GROUP BY col0
----
33
33
33

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NOT - 11 IS NULL GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT 22 * - 42 * 81 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL BETWEEN 66 * col1 AND - 96
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2325
SELECT DISTINCT + 6 AS col0, + 86 * + col1 + - + CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2, col1
----
6
NULL

skipif mysql # not compatible
query II rowsort label-2325
SELECT DISTINCT + 6 AS col0, + 86 * + col1 + - + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col2, col1
----
6
NULL

query I rowsort
SELECT DISTINCT ( + col2 ) AS col1 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + ( col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col1 * - 68 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col1 + - 77 AS col0 FROM tab2 GROUP BY col1
----
-16
-18
-36

query I rowsort
SELECT 23 + col0 AS col2 FROM tab2 GROUP BY col0
----
114
115
38

query I rowsort
SELECT - col2 * - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + 35 FROM tab1 AS cor0 GROUP BY col2, col0
----
35
35
35

query I rowsort
SELECT DISTINCT col0 * + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
0
3483

query I rowsort
SELECT - col1 + + col1 + - col1 FROM tab2 GROUP BY col1, col1, col1 HAVING NOT + 42 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 72 FROM tab1 GROUP BY col0, col2
----
72

query I rowsort
SELECT 92 - + col1 AS col2 FROM tab2 GROUP BY col1
----
31
33
51

query I rowsort
SELECT - col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
484
6724
784

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2338
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2338
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 FROM tab1 WHERE NOT NULL > NULL GROUP BY col1, col0, col2 HAVING NOT ( NOT - col1 IS NOT NULL ) OR NOT NULL = - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2340
SELECT col1 * + 92 / + CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2340
SELECT col1 * + 92 / + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( - + col2 ) col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - - col2 FROM tab1 cor0 WHERE ( ( NULL >= - col1 ) ) GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2343
SELECT + ( - ( - CAST( 9 AS SIGNED ) ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
9
9
9

skipif mysql # not compatible
query I rowsort label-2343
SELECT + ( - ( - CAST ( 9 AS INTEGER ) ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
9
9
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 36 col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 - - 27 + col0 col2 FROM tab2 AS cor0 WHERE + ( + 49 ) * - - col1 <= col1 GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - 94 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-94

query I rowsort
SELECT - 80 FROM tab0 AS cor0 GROUP BY col1
----
-80
-80

query I rowsort
SELECT 22 FROM tab2 GROUP BY col1 HAVING NOT + + col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2350
SELECT + col1 * CAST( + 86 AS SIGNED ) FROM tab0 GROUP BY col1
----
0
6966

skipif mysql # not compatible
query I rowsort label-2350
SELECT + col1 * CAST ( + 86 AS INTEGER ) FROM tab0 GROUP BY col1
----
0
6966

query I rowsort
SELECT - 8 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-8
-8
-8

query II rowsort
SELECT - 7 * + ( 52 ), col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-364
22
-364
28
-364
82

query I rowsort
SELECT + ( + col0 ) FROM tab0 GROUP BY col1, col1, col0
----
26
43
83

query I rowsort
SELECT + 98 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING 82 = - col2
----

query II rowsort
SELECT + col0 AS col1, - 42 FROM tab0 cor0 GROUP BY col0, col0
----
26
-42
43
-42
83
-42

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col0 * + col2 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - + 13 AS col0 FROM tab0 WHERE NOT NULLIF ( + col2, 22 * + ( - ( + 37 ) ) + col1 ) IS NOT NULL OR NOT - 51 BETWEEN col0 AND - - col2 GROUP BY col2
----
-13
-13
-13

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2358
SELECT 9 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2, col2 HAVING - 20 = - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-2358
SELECT 9 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2, col2 HAVING - 20 = - CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT + 85 FROM tab1 GROUP BY col0
----
85
85
85

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2360
SELECT DISTINCT CAST( NULL AS SIGNED ) + - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + + 53 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2360
SELECT DISTINCT CAST ( NULL AS INTEGER ) + - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + + 53 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 - - - col1 FROM tab0 GROUP BY col1
----
-162
0

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL > NULL
----

query II rowsort
SELECT col2 * - 69 * + col2 AS col2, + 50 FROM tab2 AS cor0 GROUP BY col2
----
-232116
50
-430629
50
-522261
50

query I rowsort
SELECT ALL - NULLIF ( - 69, AVG ( + + col0 ) + col0 ) FROM tab1 AS cor0 WHERE NOT 44 IS NULL GROUP BY col1, col0
----
69
69
69

query I rowsort
SELECT DISTINCT - col1 + - 9 FROM tab0 cor0 GROUP BY col1
----
-9
-90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2366
SELECT - AVG ( - CASE - 81 WHEN col2 - - col0 + 26 * 10 + col1 * - + col0 + + CASE col0 WHEN - + col0 THEN - CAST( NULL AS SIGNED ) + - 99 END * - 21 * - col1 THEN 65 WHEN - col1 THEN NULL WHEN col1 + col1 THEN - 64 / 15 + - col2 * 67 ELSE NULL END ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2366
SELECT - AVG ( - CASE - 81 WHEN col2 - - col0 + 26 * 10 + col1 * - + col0 + + CASE col0 WHEN - + col0 THEN - CAST ( NULL AS INTEGER ) + - 99 END * - 21 * - col1 THEN 65 WHEN - col1 THEN NULL WHEN col1 + col1 THEN - 64 / 15 + - col2 * 67 ELSE NULL END ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT col1, + col1 AS col2 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL - + col1 * 90 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
-7290
0
0

query I rowsort
SELECT ALL 54 * 66 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= ( col2 * - 16 )
----

query I rowsort
SELECT + 12 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ( + col1 ) * - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT + - 22 IS NULL
----
-1681
-3481
-3721

query I rowsort
SELECT 8 AS col2 FROM tab1 cor0 GROUP BY col0
----
8
8
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + COALESCE ( - + col2, - 48 ) col1 FROM tab1 GROUP BY col2 HAVING + 90 < NULL
----

query I rowsort
SELECT DISTINCT ( + ( + + ( + col1 ) ) ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 * + + 90 FROM tab0 AS cor0 GROUP BY col2
----
2160
3420
7110

query I rowsort
SELECT ALL + 15 * - 13 AS col1 FROM tab0 GROUP BY col2
----
-195
-195
-195

query I rowsort
SELECT ( + col2 ) FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL 69 AS col2 FROM tab1 GROUP BY col0, col1, col0 HAVING NOT + 60 * + - col1 * + col0 * ( + + COALESCE ( + col1, - + col0 ) ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2379
SELECT col0 DIV + col0 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-2379
SELECT col0 / + col0 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

query I rowsort
SELECT - 61 FROM tab1 AS cor0 WHERE NOT - ( - col2 ) * ( 76 ) >= - - col2 GROUP BY col2
----

query I rowsort
SELECT ALL - - 22 FROM tab1 AS cor0 GROUP BY col1
----
22
22
22

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab0 GROUP BY col2, col1 HAVING ( NULL <= ( col1 ) )
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT - 10 / col2 AS col0 FROM tab0 cor0 WHERE + col2 + - col2 BETWEEN NULL AND col2 GROUP BY col0, col2, col2 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT - ( - col0 ) * - col0 * + 25 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + col0 BETWEEN NULL AND - 65
----
-16900
-172225
-46225

query I rowsort
SELECT 87 * - - col2 FROM tab0 GROUP BY col0, col2 HAVING NOT 22 IS NULL
----
2088
3306
6873

query I rowsort
SELECT ALL + - col2 * - 5 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
144
228
474

query I rowsort
SELECT - 77 * + 58 + col0 FROM tab0 AS cor0 GROUP BY col0
----
-4383
-4423
-4440

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2389
SELECT + - CAST( - 41 AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
41
41

skipif mysql # not compatible
query I rowsort label-2389
SELECT + - CAST ( - 41 AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
41
41

query I rowsort
SELECT DISTINCT - col1 + col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 WHERE NOT NULL > NULL GROUP BY col2, col2
----

query I rowsort
SELECT 67 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING NOT ( - col1 ) IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT + 69 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING - 69 + col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT 24 + - col1 + + 64 / 68 IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1, col2
----
22
28
82

query I rowsort
SELECT - + 23 + + col2 * - col2 AS col2 FROM tab0 WHERE + col0 IS NOT NULL GROUP BY col2, col2, col0 HAVING NOT NULL NOT BETWEEN ( - col2 ) AND col0
----

query II rowsort
SELECT - col1 AS col2, col1 + - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
82
-59
118
-61
122

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2400
SELECT DISTINCT + col2 * - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-2400
SELECT DISTINCT + col2 * - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab1 WHERE col1 IS NOT NULL GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - ( + + 51 ) AS col0 FROM tab1 GROUP BY col1
----
-51

query I rowsort
SELECT DISTINCT col2 - - col0 + - - 49 FROM tab2 AS cor0 GROUP BY col2, col0
----
151
199
219

query I rowsort
SELECT ALL ( + 8 ) AS col1 FROM tab2 AS cor0 WHERE ( NOT ( + + 68 * + col0 ) <> NULL ) GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2405
SELECT + col0 + + col0 + - 38 * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( CAST( CAST( NULL AS SIGNED ) AS SIGNED ) ) < NULL
----

skipif mysql # not compatible
query I rowsort label-2405
SELECT + col0 + + col0 + - 38 * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( CAST ( CAST ( NULL AS INTEGER ) AS INTEGER ) ) < NULL
----

query I rowsort
SELECT 70 - - col2 + + 82 + col2 FROM tab1 GROUP BY col2
----
168
242
294

query I rowsort
SELECT ALL 32 AS col2 FROM tab2 GROUP BY col0
----
32
32
32

query I rowsort
SELECT ( - col1 ) * + ( 62 ) AS col0 FROM tab0 GROUP BY col1
----
-5022
0

query I rowsort
SELECT + 63 - - ( + - col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
2
22
4

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-2410
SELECT DISTINCT - - CAST( NULL AS SIGNED ) FROM tab2 WHERE col2 * - - ( - 53 ) * CAST( NULL AS DECIMAL ) + + + col0 IS NULL GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2410
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) FROM tab2 WHERE col2 * - - ( - 53 ) * CAST ( NULL AS REAL ) + + + col0 IS NULL GROUP BY col0, col1
----
NULL

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT 86 + - + col1 AS col1 FROM tab0 GROUP BY col1
----
5
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2414
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT 73 / - CAST( NULL AS SIGNED ) NOT BETWEEN + - col2 AND col0
----

skipif mysql # not compatible
query I rowsort label-2414
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT 73 / - CAST ( NULL AS INTEGER ) NOT BETWEEN + - col2 AND col0
----

query I rowsort
SELECT ALL + 85 FROM tab1 cor0 GROUP BY col2, col0, col0 HAVING NOT col2 IN ( - col2, - 28 )
----
85
85
85

query II rowsort
SELECT 13, col2 AS col2 FROM tab0 GROUP BY col2, col0
----
13
24
13
38
13
79

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
24
38
79

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT 11 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT - col2 / - 61 + + col2 + - col2 + - 7 NOT BETWEEN 75 AND + col2
----

query I rowsort
SELECT - 32 AS col2 FROM tab0 GROUP BY col0, col1
----
-32
-32
-32

query I rowsort
SELECT ALL - col1 + - 19 + + col0 - + + ( - 31 ) + col1 * + col0 + - col1 FROM tab1 cor0 GROUP BY col1, col0
----
1522
154
3614

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2422
SELECT - CAST( NULL AS SIGNED ) / 52 + - col0 * - col0 * 79 / - 87 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2422
SELECT - CAST ( NULL AS INTEGER ) / 52 + - col0 * - col0 * 79 / - 87 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 65 AS col2 FROM tab0 GROUP BY col0 HAVING NOT - 42 IS NULL
----
65
65
65

query I rowsort
SELECT ( col2 ) * + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - - col1 * col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
1722
3540
3782

query I rowsort
SELECT ALL - - 88 + + + 65 * - 24 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-1472
-1472
-1472

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING - + 42 IS NULL
----

query I rowsort
SELECT - - col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2429
SELECT col1 * 58 + + CAST( NULL AS SIGNED ) * - 64 - - col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2429
SELECT col1 * 58 + + CAST ( NULL AS INTEGER ) * - 64 - - col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-2430
SELECT ALL 23 DIV + 91 - col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-2430
SELECT ALL 23 / + 91 - col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2431
SELECT col2 + CAST( + col2 AS SIGNED ) AS col0 FROM tab0 GROUP BY col2
----
158
48
76

skipif mysql # not compatible
query I rowsort label-2431
SELECT col2 + CAST ( + col2 AS INTEGER ) AS col0 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL - col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT - 97 FROM tab1 AS cor0 WHERE + 83 * + + col0 * ( - + col1 ) < NULL GROUP BY col1
----

query I rowsort
SELECT 32 + - + 31 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IN ( - col1 )
----

query I rowsort
SELECT - ( - 6 ) AS col0 FROM tab1 GROUP BY col1, col2
----
6
6
6

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL NOT BETWEEN - 55 * - 68 + + - col0 AND NULL
----

query I rowsort
SELECT ( - col1 ) FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
-81
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2438
SELECT ALL CAST( NULL AS SIGNED ) AS col0, + col2 - - - col2 FROM tab1 AS cor0 GROUP BY col2
----
NULL
0
NULL
0
NULL
0

skipif mysql # not compatible
query II rowsort label-2438
SELECT ALL CAST ( NULL AS INTEGER ) AS col0, + col2 - - - col2 FROM tab1 AS cor0 GROUP BY col2
----
NULL
0
NULL
0
NULL
0

query I rowsort
SELECT DISTINCT + col2 - - col1 FROM tab1 GROUP BY col2, col1
----
102
115
14

query I rowsort
SELECT col0 AS col1 FROM tab2 WHERE + - col2 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT 25 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT 44 - - + 78 + + - col2 * + col2 + - col2 AS col2 FROM tab0 WHERE NOT 56 IS NOT NULL GROUP BY col0, col0, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2444
SELECT DISTINCT - 44 DIV col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
0

skipif mysql # not compatible
query I rowsort label-2444
SELECT DISTINCT - 44 / col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
0

query I rowsort
SELECT - + 0 FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 97 FROM tab2 GROUP BY col1, col2 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 WHERE NOT + col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + 76 + - - 93 FROM tab2 GROUP BY col1
----
169
169
169

query I rowsort
SELECT ALL col0 + - col0 * - 32 FROM tab2 GROUP BY col0, col2
----
3003
3036
495

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2450
SELECT + col1 * + col1 * col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 37 + + CAST( - 10 AS SIGNED ) * CAST( NULL AS SIGNED ) / col1 / col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-2450
SELECT + col1 * + col1 * col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 37 + + CAST ( - 10 AS INTEGER ) * CAST ( NULL AS INTEGER ) / col1 / col1 IS NULL
----

query I rowsort
SELECT DISTINCT 14 AS col2 FROM tab1 GROUP BY col1
----
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2452
SELECT ALL - - col1 + - - col0 - + - 7 * + - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( + 12 IS NOT NULL )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2452
SELECT ALL - - col1 + - - col0 - + - 7 * + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( + 12 IS NOT NULL )
----
NULL
NULL
NULL

query I rowsort
SELECT - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2454
SELECT DISTINCT + 88 * - 12 col2 FROM tab2 WHERE NOT + col1 + + - col1 + - CAST( + col1 AS SIGNED ) <= + col2 GROUP BY col0, col1, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2454
SELECT DISTINCT + 88 * - 12 col2 FROM tab2 WHERE NOT + col1 + + - col1 + - CAST ( + col1 AS INTEGER ) <= + col2 GROUP BY col0, col1, col2
----

query II rowsort
SELECT ALL col2, - col2 AS col2 FROM tab2 AS cor0 WHERE NOT + col2 IS NULL GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT - 69 AS col0 FROM tab0 GROUP BY col0, col2
----
-69

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2457
SELECT DISTINCT - col2 + col0 + - ( - CAST( ( - - 55 ) AS SIGNED ) ) AS col0 FROM tab2 GROUP BY col0, col2
----
-17
67
89

skipif mysql # not compatible
query I rowsort label-2457
SELECT DISTINCT - col2 + col0 + - ( - CAST ( ( - - 55 ) AS INTEGER ) ) AS col0 FROM tab2 GROUP BY col0, col2
----
-17
67
89

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col0, col2 HAVING NOT - + col2 IS NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-2459
SELECT ALL - col0 + - + col2 DIV + 29 FROM tab2 GROUP BY col2, col0, col0
----
-18
-93
-94

skipif mysql # not compatible
query I rowsort label-2459
SELECT ALL - col0 + - + col2 / + 29 FROM tab2 GROUP BY col2, col0, col0
----
-18
-93
-94

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 * - + ( - 8 ) FROM tab2 GROUP BY col1, col2
----
58
464
79
632
87
696

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING 56 + - 39 < col2
----
-45
-71

query I rowsort
SELECT + 54 * col0 * + col0 * + col0 FROM tab1 GROUP BY col0
----
1185408
29773872
574992

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT + 80 IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * - col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2465
SELECT ALL - col2 + + CAST( + 3 AS SIGNED ) + col1 * - 76 * - COALESCE ( + col1, 82 ) AS col2 FROM tab1 GROUP BY col2, col1
----
147068
246882
2731

skipif mysql # not compatible
query I rowsort label-2465
SELECT ALL - col2 + + CAST ( + 3 AS INTEGER ) + col1 * - 76 * - COALESCE ( + col1, 82 ) AS col2 FROM tab1 GROUP BY col2, col1
----
147068
246882
2731

query I rowsort
SELECT ALL - 98 * col2 + + 16 + + col2 FROM tab0 GROUP BY col2, col0
----
-2312
-3670
-7647

query I rowsort
SELECT ALL 67 * col1 - - 26 AS col2 FROM tab1 GROUP BY col1
----
2974
3845
428

query I rowsort
SELECT ALL - 64 * - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING 57 / 80 IS NOT NULL
----
0
5184

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT - col1 IS NULL
----
0
0
81

query I rowsort
SELECT ALL + 99 * + - col0 AS col1 FROM tab0 GROUP BY col0
----
-2574
-4257
-8217

query I rowsort
SELECT + col1 * col1 + - 18 AS col1 FROM tab0 GROUP BY col1
----
-18
6543

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2472
SELECT + - col0 / - - CAST( NULL AS DECIMAL ) AS col2 FROM tab0 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2472
SELECT + - col0 / - - CAST ( NULL AS REAL ) AS col2 FROM tab0 cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-2473
SELECT + - ( - + 6 ) DIV 37 AS col0 FROM tab1 AS cor0 WHERE NOT col0 DIV - NULLIF ( + NULLIF ( + + CAST( NULL AS SIGNED ), 82 ), col1 ) IS NOT NULL GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2473
SELECT + - ( - + 6 ) / 37 AS col0 FROM tab1 AS cor0 WHERE NOT col0 / - NULLIF ( + NULLIF ( + + CAST ( NULL AS INTEGER ), 82 ), col1 ) IS NOT NULL GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
45
71
8

query I rowsort
SELECT 73 * - - 3 AS col0 FROM tab0 GROUP BY col2, col2
----
219
219
219

query I rowsort
SELECT DISTINCT - 21 FROM tab0 WHERE col0 NOT BETWEEN NULL AND ( NULL ) GROUP BY col1, col2
----

query I rowsort
SELECT ALL col0 * - + col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - - CASE 66 WHEN + col1 THEN + 45 WHEN 13 THEN - 63 END AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col1 + - col1 + - - col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + 21 FROM tab2 GROUP BY col1
----
21

query I rowsort
SELECT DISTINCT + 52 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
52

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2482
SELECT - + col0 + CAST( NULL AS DECIMAL ) + 48 * - col1 * - + col1 FROM tab0 cor0 WHERE NOT col0 IS NOT NULL GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-2482
SELECT - + col0 + CAST ( NULL AS REAL ) + 48 * - col1 * - + col1 FROM tab0 cor0 WHERE NOT col0 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL + 96 AS col0 FROM tab0 GROUP BY col2
----
96
96
96

query I rowsort
SELECT ALL col0 + - col0 + col0 AS col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col0 FROM tab2 cor0 WHERE col1 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col2 * + 66 AS col2 FROM tab0 GROUP BY col2
----
1584
2508
5214

query I rowsort
SELECT col2 * - 53 + + ( + 7 ) AS col0 FROM tab2 GROUP BY col2
----
-3067
-4180
-4604

query I rowsort
SELECT ALL 91 * - - col0 + + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
2024
2576
7544

onlyif mysql # DIV for integer division: 
query I rowsort label-2489
SELECT DISTINCT + - 90 * + col0 + - 6 DIV 55 + - 63 + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-1398
-8162
-8251

skipif mysql # not compatible
query I rowsort label-2489
SELECT DISTINCT + - 90 * + col0 + - 6 / 55 + - 63 + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-1398
-8162
-8251

query I rowsort
SELECT + col2 AS col2 FROM tab2 WHERE NOT + + col2 / col2 * col2 / 9 + col0 <= NULL GROUP BY col0, col2
----

query II rowsort
SELECT ALL col0 * + col0 + - 19, + col0 FROM tab1 GROUP BY col0
----
465
22
6705
82
765
28

query I rowsort
SELECT ALL 61 * col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT - 85 IS NULL
----
1342
1708
5002

query I rowsort
SELECT DISTINCT + 1 + + 1 FROM tab1 GROUP BY col2
----
2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2494
SELECT + - col2 + - CAST( NULL AS SIGNED ) + - col2 + 29 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2494
SELECT + - col2 + - CAST ( NULL AS INTEGER ) + - col2 + 29 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 35 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
35

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + - ( - col0 ) + - 44 FROM tab2 AS cor0 GROUP BY col0, col2
----
-29
47
48

query I rowsort
SELECT DISTINCT + 58 + - col0 AS col2 FROM tab1 WHERE NOT + + col0 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-24
30
36

query I rowsort
SELECT DISTINCT 15 AS col0 FROM tab1 GROUP BY col0
----
15

query II rowsort
SELECT - col2, - col2 * - + col2 + col2 AS col2 FROM tab1 GROUP BY col2
----
-45
2070
-71
5112
-8
72

query I rowsort
SELECT ALL 32 FROM tab0 GROUP BY col0 HAVING NOT - + col0 + - - col0 * - col0 IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NULL BETWEEN NULL AND ( NULL ) AND NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 + 70 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL AND + - col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - 40 <= - 21 * col1
----

query I rowsort
SELECT - 15 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( + ( - ( 59 ) ) ) < + 21
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2 HAVING - 94 * - col1 = ( NULL )
----

query I rowsort
SELECT + 18 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 * - 18 FROM tab0 AS cor0 WHERE + col1 / - ( - + 54 ) + - col2 + - ( + col2 ) * - 45 + + col2 * 5 NOT BETWEEN - col1 + + col0 AND 45 * col2 + col1 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT - 88 AS col2 FROM tab1 GROUP BY col0
----
-88

query I rowsort
SELECT DISTINCT + - 78 * 35 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IN ( 24 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 41 col0 FROM tab2 AS cor0 WHERE col1 NOT BETWEEN + - col0 AND ( col1 ) GROUP BY col0, col1, col1
----

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( - 86 )
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col2, col2, col0 HAVING + 55 BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL 34 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT col2 IS NULL
----
34
34
34

query I rowsort
SELECT + col1 FROM tab1 WHERE NOT NULL NOT BETWEEN NULL AND col0 * + col0 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND ( col2 )
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT 84 FROM tab1 GROUP BY col0
----
84
84
84

query I rowsort
SELECT DISTINCT 84 * - col0 AS col1 FROM tab0 GROUP BY col0, col2
----
-2184
-3612
-6972

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 WHERE NOT ( col0 ) IN ( - col2 ) GROUP BY col2, col0 HAVING ( 57 ) IS NOT NULL
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2521
SELECT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2521
SELECT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL > - col1
----

query I rowsort
SELECT DISTINCT 82 FROM tab1 cor0 GROUP BY col2, col1
----
82

query I rowsort
SELECT DISTINCT ( 92 ) - col1 * col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-1589
-3389
-3629

query I rowsort
SELECT + 26 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 + - col0 IS NOT NULL
----

query I rowsort
SELECT ALL 37 + + + 57 * - 84 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT col2 < ( NULL )
----

query I rowsort
SELECT DISTINCT + ( - - col1 ) FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL 82 + col2 + - 69 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0 HAVING ( - col0 + col0 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0 HAVING NULL <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2532
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 DIV 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 DIV + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2532
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 / 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 / + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT ( + - col1 ) IS NOT NULL
----

query I rowsort
SELECT - NULLIF ( - - 85, + 5 ) FROM tab1 GROUP BY col1, col1
----
-85
-85
-85

query I rowsort
SELECT ALL - ( - + col1 ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT ( - col1 + 88 ) < NULL
----

query I rowsort
SELECT DISTINCT - col0 * + - col0 - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
1806
650
6806

query I rowsort
SELECT col0 + 79 + - 59 AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
102
42
48

query I rowsort
SELECT DISTINCT + 40 AS col1 FROM tab0 AS cor0 WHERE NOT - ( + - col2 ) >= col2 GROUP BY col1 HAVING ( NULL ) BETWEEN + 54 AND 5
----

query I rowsort
SELECT - col1 + - - 76 FROM tab0 AS cor0 GROUP BY col1
----
-5
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * + 29 col2 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + 59 IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col1 HAVING NOT + 82 IS NOT NULL
----

query I rowsort
SELECT 61 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
61
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2544
SELECT DISTINCT col1 * + 97 + - + col2 * - AVG ( - NULLIF ( + col2, - col2 + - col2 ) ) - col1 * - 19 - - col1 + - col2 + - ( + 64 ) + + CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-2544
SELECT DISTINCT col1 * + 97 + - + col2 * - AVG ( - NULLIF ( + col2, - col2 + - col2 ) ) - col1 * - 19 - - col1 + - col2 + - ( + 64 ) + + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL

query I rowsort
SELECT - col0 + + - ( + col0 ) FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-182
-184
-30

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - COALESCE ( - 44, - - 95 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( - col0 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2548
SELECT - col0 + col1 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col1 HAVING NOT + + COALESCE ( - ( col0 ), - 59, + + ( + CAST( + col1 AS SIGNED ) ) * + 55 * - - col0 ) > - 82
----
-32
-51

skipif mysql # not compatible
query I rowsort label-2548
SELECT - col0 + col1 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col1 HAVING NOT + + COALESCE ( - ( col0 ), - 59, + + ( + CAST ( + col1 AS INTEGER ) ) * + 55 * - - col0 ) > - 82
----
-32
-51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( - col2 ) col0 FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT col1 * - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + col1 + - col1 * + col1 FROM tab1 WHERE NOT + col0 BETWEEN - 29 - 82 AND NULL GROUP BY col1 HAVING NOT col1 = ( NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2552
SELECT - CAST( NULL AS DECIMAL ) AS col0 FROM tab1 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2552
SELECT - CAST ( NULL AS REAL ) AS col0 FROM tab1 GROUP BY col1, col2
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT col1, + ( + - col1 ) FROM tab1 GROUP BY col1
----
44
-44
57
-57
6
-6

query II rowsort
SELECT DISTINCT + - col2 AS col0, - col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-24
-38
-38
-79
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2555
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING 81 * + + ( + CAST( 96 AS SIGNED ) ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-2555
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING 81 * + + ( + CAST ( 96 AS INTEGER ) ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + 83 FROM tab0 AS cor0 GROUP BY col0
----
83
83
83

onlyif mysql # DIV for integer division: 
query I rowsort label-2558
SELECT DISTINCT - col0 DIV + - col0 + - ( + + col0 ) + + + 39 * + + 71 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
2688
2742
2748

skipif mysql # not compatible
query I rowsort label-2558
SELECT DISTINCT - col0 / + - col0 + - ( + + col0 ) + + + 39 * + + 71 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
2688
2742
2748

query I rowsort
SELECT + 3 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
3
3
3

query I rowsort
SELECT + 23 FROM tab1 GROUP BY col0
----
23
23
23

onlyif mysql # DIV for integer division: 
query I rowsort label-2561
SELECT + 39 DIV + 5 FROM tab2 GROUP BY col1
----
7
7
7

skipif mysql # not compatible
query I rowsort label-2561
SELECT + 39 / + 5 FROM tab2 GROUP BY col1
----
7
7
7

query I rowsort
SELECT - 15 FROM tab1 AS cor0 GROUP BY col0, col0
----
-15
-15
-15

onlyif mysql # DIV for integer division: 
query I rowsort label-2563
SELECT DISTINCT col2 DIV col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-2563
SELECT DISTINCT col2 / col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT ( 24 ) col1, - col2 * - col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( - col2 IS NULL )
----
-58
-79
-87

query I rowsort
SELECT - 29 FROM tab2 GROUP BY col1
----
-29
-29
-29

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + + col0 AS col2, - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN col2 AND NULL
----

query II rowsort
SELECT - 8 AS col1, + col0 FROM tab1 GROUP BY col1, col0, col0
----
-8
22
-8
28
-8
82

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2569
SELECT + col0, + col0 * col0 + + + col0 * CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) / + NULLIF ( + col1, + + col0 * + col0 ) AS col2 FROM tab1 GROUP BY col1, col0
----
22
NULL
28
NULL
82
NULL

skipif mysql # not compatible
query II rowsort label-2569
SELECT + col0, + col0 * col0 + + + col0 * CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER ) / + NULLIF ( + col1, + + col0 * + col0 ) AS col2 FROM tab1 GROUP BY col1, col0
----
22
NULL
28
NULL
82
NULL

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-41
-59
-61

query I rowsort
SELECT - + 56 AS col0 FROM tab0 cor0 GROUP BY col1
----
-56
-56

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING col2 = - 32
----

query I rowsort
SELECT DISTINCT - ( + col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL > - + col2
----

query I rowsort
SELECT DISTINCT - 39 FROM tab0 AS cor0 GROUP BY col1
----
-39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2575
SELECT - AVG ( ALL + CAST( NULL AS SIGNED ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2575
SELECT - AVG ( ALL + CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 22 col1, + 2 * ( col1 ) FROM tab0 AS cor0 WHERE 89 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 - + 52 col2 FROM tab1 GROUP BY col0
----
-134
-74
-80

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 WHERE NULL > col0 GROUP BY col2, col1 HAVING + col1 >= - - 53
----

query I rowsort
SELECT DISTINCT - 23 + 23 AS col0 FROM tab2 WHERE NULL IN ( 1, 76 + - - col0 ) GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING - col1 NOT BETWEEN NULL AND + col1
----

query I rowsort
SELECT 95 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - 47 AS col1 FROM tab1 GROUP BY col0
----
-47

query I rowsort
SELECT + ( ( - 41 ) ) * + 43 AS col2 FROM tab2 GROUP BY col1
----
-1763
-1763
-1763

query I rowsort
SELECT ALL + - col2 + col2 FROM tab0 cor0 GROUP BY col1, col1, col2
----
0
0
0

query I rowsort
SELECT ALL - - col1 * + 83 + - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
3608
4674
492

query II rowsort
SELECT + - 86 AS col0, - 59 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL > + col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 69 col2 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
69

query II rowsort
SELECT col2 AS col1, + 82 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
82
79
82
87
82

query I rowsort
SELECT - ( 57 ) + col2 * + - col0 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1046
-2085
-3128

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0, col2, col1
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-2592
SELECT DISTINCT 90 DIV 38 - - 56 + + col0 * + col0 AS col0 FROM tab0 GROUP BY col0
----
1907
6947
734

skipif mysql # not compatible
query I rowsort label-2592
SELECT DISTINCT 90 / 38 - - 56 + + col0 * + col0 AS col0 FROM tab0 GROUP BY col0
----
1907
6947
734

query I rowsort
SELECT + col1 / + col0 * - 25 AS col0 FROM tab2 AS cor0 WHERE NOT + col1 NOT IN ( + col2, col0 / + 62, 2 * - 45 * + + col0, + 84, - col1 * - col1 ) GROUP BY col1, col0 HAVING NOT NULL >= + ( - 36 )
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING 50 BETWEEN ( NULL ) AND 22
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - ( 60 ) - - col2 + + col2 * col2 col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
1542
6380
660

query I rowsort
SELECT DISTINCT + 94 FROM tab2 AS cor0 GROUP BY col1, col1
----
94

query I rowsort
SELECT DISTINCT 90 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( + + ( - col1 ) ) IS NOT NULL
----
90

query I rowsort
SELECT - 96 * + col0 AS col0 FROM tab2 GROUP BY col0
----
-1440
-8736
-8832

query I rowsort
SELECT 81 * + - 55 AS col1 FROM tab1 GROUP BY col0
----
-4455
-4455
-4455

query I rowsort
SELECT DISTINCT + 30 FROM tab1 GROUP BY col1
----
30

query I rowsort
SELECT DISTINCT + - col0 * + 73 * + ( + ( + - col0 ) ) FROM tab1 AS cor0 GROUP BY col0
----
35332
490852
57232

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST( NULL AS DECIMAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST ( NULL AS REAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

query I rowsort
SELECT ALL col1 + + col0 FROM tab2 GROUP BY col0, col1 HAVING - 6 IS NOT NULL
----
133
150
76

query II rowsort
SELECT + col2 AS col2, - col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
-41
79
-59
87
-61

query I rowsort
SELECT DISTINCT 52 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
52

query I rowsort
SELECT ( + AVG ( + 17 ) ) * + col2 / col1 * + col2 AS col0 FROM tab0 GROUP BY col1, col1, col2 HAVING NOT ( NULL ) NOT IN ( 51 )
----

query I rowsort
SELECT 24 * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT + ( col0 ) IS NOT NULL
----

query I rowsort
SELECT + + col2 AS col2 FROM tab1 AS cor0 WHERE NOT col1 * - - 98 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT - - 21 - col0 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-204
-8260
-8443

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT col1 + + col0 IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT 37 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
37

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL <= ( - 94 )
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT ( + col0 ) FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col1 * - col1 + + col0 FROM tab1 GROUP BY col0, col1
----
-14
-1854
-3221

query I rowsort
SELECT 42 / - col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1, col0, col2
----
0
0
81

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2620
SELECT ALL col1 + + col2 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) <> ( - col1 + + CAST( NULL AS DECIMAL ) * - 19 )
----

skipif mysql # not compatible
query I rowsort label-2620
SELECT ALL col1 + + col2 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) <> ( - col1 + + CAST ( NULL AS REAL ) * - 19 )
----

query I rowsort
SELECT DISTINCT 33 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0 HAVING ( - 33 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 GROUP BY col2 HAVING - + col2 IS NULL
----

query I rowsort
SELECT DISTINCT 37 AS col1 FROM tab2 GROUP BY col1 HAVING - + AVG ( 15 ) <> + col1
----
37

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( + 1 ) col0 FROM tab0 GROUP BY col0
----
1

onlyif mysql # DIV for integer division: 
query I rowsort label-2625
SELECT DISTINCT + - 54 * - 79 * + col2 * col2 + + 82 DIV + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
21504907
273034
8638651

skipif mysql # not compatible
query I rowsort label-2625
SELECT DISTINCT + - 54 * - 79 * + col2 * col2 + + 82 / + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
21504907
273034
8638651

query I rowsort
SELECT DISTINCT 59 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
59

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col2 * col1 * - + col1 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
2304
6579225
9759376

query I rowsort
SELECT + + 43 * 2 FROM tab2 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT ( + 12 ) AS col0 FROM tab0 WHERE ( + col2 ) <> NULL GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2631
SELECT ALL CAST( NULL AS SIGNED ) * - - col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2631
SELECT ALL CAST ( NULL AS INTEGER ) * - - col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - ( - - col0 ) FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT + col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + col1 + col0 * - col1 col0 FROM tab1 AS cor0 WHERE ( 57 ) NOT IN ( 36 + + 25 + col1 * 75 ) GROUP BY col0, col1
----
-168
-4845
-5544

query I rowsort
SELECT DISTINCT - - 15 FROM tab0 AS cor0 GROUP BY col2, col2
----
15

query I rowsort
SELECT DISTINCT col1 + + col1 AS col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1 HAVING - 7 + + 41 NOT IN ( - 63 )
----
114
12
88

query I rowsort
SELECT DISTINCT + 10 FROM tab2 cor0 GROUP BY col0, col1
----
10

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT - 1 AS col1 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL col2 / + - 52 + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 1 FROM tab1 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT ( + col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT + col2 - 50 FROM tab0 GROUP BY col2
----
-12
-26
29

query I rowsort
SELECT - + 24 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-24
-24
-24

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL + col0 / col0 + col0 AS col1 FROM tab1 GROUP BY col0, col0, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL 84 * col1 + + 98 FROM tab2 GROUP BY col1, col1 HAVING 15 IS NULL
----

query I rowsort
SELECT DISTINCT 89 - col2 AS col1 FROM tab0 GROUP BY col2
----
10
51
65

query I rowsort
SELECT DISTINCT 36 FROM tab1 WHERE NOT ( NULL ) > ( - ( - col2 ) ) GROUP BY col1
----

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE + col2 IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 91 IS NOT NULL
----

query II rowsort
SELECT - col2, 64 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
40
-38
26
-79
-15

query I rowsort
SELECT - 65 FROM tab2 GROUP BY col2
----
-65
-65
-65

query II rowsort
SELECT DISTINCT - col2, - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT DISTINCT col2 + 53 AS col2 FROM tab0 cor0 GROUP BY col2
----
132
77
91

query I rowsort
SELECT col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 cor0 WHERE NOT NULL NOT IN ( col2 + col0 ) GROUP BY col1 HAVING NOT 20 <> NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 IS NULL
----
41
59
61

query I rowsort
SELECT + NULLIF ( - col1, + + ( 7 ) + + col2 ) * col1 FROM tab0 AS cor0 WHERE - col0 = - 77 GROUP BY col1, col2 HAVING NOT + - col1 IS NULL
----

query I rowsort
SELECT - + 63 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-63
-63
-63

query I rowsort
SELECT DISTINCT 12 + - 45 + 45 FROM tab1 AS cor0 GROUP BY col2
----
12

query I rowsort
SELECT + 45 FROM tab2 GROUP BY col2
----
45
45
45

query II rowsort
SELECT col2, col2 * - col2 FROM tab2 GROUP BY col2, col1
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT - COALESCE ( NULLIF ( - col2, - 38 * col2 ), + 95 ) FROM tab0 GROUP BY col2 HAVING NOT - + col2 IS NULL
----
24
38
79

query I rowsort
SELECT ALL col2 * - col2 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT + + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT 37 <> NULL
----

query I rowsort
SELECT - 83 + - col0 - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL + col1 + + col1 * - 82 FROM tab2 AS cor0 GROUP BY col1
----
-3321
-4779
-4941

query I rowsort
SELECT DISTINCT 42 - - - col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 42 + + + 68 col0 FROM tab1 AS cor0 GROUP BY col2
----
26

query II rowsort
SELECT + NULLIF ( + - col2, - col2 ), ( - + 80 ) AS col0 FROM tab2 GROUP BY col2
----
NULL
-80
NULL
-80
NULL
-80

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - 87 * + - col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + 27 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
27

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + 20 - + col2 col0, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-107
87
-78
58
-99
79

query I rowsort
SELECT ALL + + col1 + col1 AS col2 FROM tab1 AS cor0 WHERE col0 + - col1 + - col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + 6 + 17 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + ( + 10 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2679
SELECT CAST( NULL AS SIGNED ) + - AVG ( DISTINCT + - 14 ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2679
SELECT CAST ( NULL AS INTEGER ) + - AVG ( DISTINCT + - 14 ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING col1 IS NOT NULL
----
41
59
61

query I rowsort
SELECT - 86 + + col1 FROM tab1 GROUP BY col2, col1
----
-29
-42
-80

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col2, col0
----
26
43
83

query I rowsort
SELECT + 22 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
1254
132
968

query I rowsort
SELECT 61 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
61
61
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2685
SELECT DISTINCT CAST( NULL AS SIGNED ) col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2685
SELECT DISTINCT CAST ( NULL AS INTEGER ) col2 FROM tab1 GROUP BY col1
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + 40 AS col2, col0 + + col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
40
164
40
44
40
56

onlyif mysql # DIV for integer division: 
query I rowsort label-2687
SELECT - col0 + + - col0 + - col0 DIV col0 * + - 71 FROM tab2 AS cor0 GROUP BY col0, col0
----
-111
-113
41

skipif mysql # not compatible
query I rowsort label-2687
SELECT - col0 + + - col0 + - col0 / col0 * + - 71 FROM tab2 AS cor0 GROUP BY col0, col0
----
-111
-113
41

query II rowsort
SELECT ALL - + col1 AS col2, 39 FROM tab1 AS cor0 GROUP BY col1 HAVING + 53 * + + 27 IS NOT NULL
----
-44
39
-57
39
-6
39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2689
SELECT - col2 * - - CAST( ( + 38 ) AS SIGNED ) * - col2 FROM tab1 AS cor0 GROUP BY col2
----
191558
2432
76950

skipif mysql # not compatible
query I rowsort label-2689
SELECT - col2 * - - CAST ( ( + 38 ) AS INTEGER ) * - col2 FROM tab1 AS cor0 GROUP BY col2
----
191558
2432
76950

query I rowsort
SELECT DISTINCT 19 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
19

query I rowsort
SELECT ALL 91 FROM tab0 GROUP BY col1
----
91
91

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2692
SELECT - + col1 * - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2692
SELECT - + col1 * - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query III rowsort label-2693
SELECT DISTINCT + 22 DIV ( + col1 ) * - 58 - + col0 AS col2, col2 DIV ( NULLIF ( - col0, - col1 ) ), - col2 AS col0 FROM tab2 AS cor0 WHERE ( - COALESCE ( - col0, - + CAST( 68 AS SIGNED ) * - - col0 ) ) IS NOT NULL GROUP BY col1, col0, col2
----
9 values hashing to c2c669fef455f9edfd68bf7fbea429fe

skipif mysql # not compatible
query III rowsort label-2693
SELECT DISTINCT + 22 / ( + col1 ) * - 58 - + col0 AS col2, col2 / ( NULLIF ( - col0, - col1 ) ), - col2 AS col0 FROM tab2 AS cor0 WHERE ( - COALESCE ( - col0, - + CAST ( 68 AS INTEGER ) * - - col0 ) ) IS NOT NULL GROUP BY col1, col0, col2
----
9 values hashing to c2c669fef455f9edfd68bf7fbea429fe

query I rowsort
SELECT DISTINCT + col0 - 29 + - col0 AS col1 FROM tab0 GROUP BY col0, col1
----
-29

query I rowsort
SELECT DISTINCT + 87 - + + col1 AS col0 FROM tab1 GROUP BY col0, col1
----
30
43
81

query I rowsort
SELECT ALL COALESCE ( + 97, 67 ) FROM tab1 GROUP BY col2
----
97
97
97

query II rowsort
SELECT + col0 AS col2, + 6 * - col0 FROM tab2 GROUP BY col0
----
15
-90
91
-546
92
-552

query I rowsort
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + 66 FROM tab0 AS cor0 GROUP BY col2
----
66
66
66

query I rowsort
SELECT + + ( ( - col1 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT 10 FROM tab1 GROUP BY col2, col2 HAVING NOT ( - 55 ) IS NOT NULL
----

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL 46 * - - 43 * - col1 FROM tab2 GROUP BY col1
----
-116702
-120658
-81098

query I rowsort
SELECT DISTINCT + + 85 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + - 11 IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT - + col2 AS col2 FROM tab0 WHERE NULL <= NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 WHERE - 22 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL ( + col0 ) * - + 93 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1395
-8463
-8556

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 WHERE NOT - col0 IN ( - 65, ( + - 76 ) ) GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col2 + + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

query II rowsort
SELECT + 63 * col2, col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
1512
24
2394
38
4977
79

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 WHERE NOT - + col2 IS NOT NULL GROUP BY col2
----

query II rowsort
SELECT DISTINCT col0, 61 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT + 94 FROM tab0 GROUP BY col1, col2
----
94
94
94

query I rowsort
SELECT - 83 * - col1 FROM tab0 GROUP BY col1
----
0
6723

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST( + 28 AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST ( + 28 AS INTEGER )
----

query I rowsort
SELECT 90 FROM tab0 GROUP BY col0
----
90
90
90

query II rowsort
SELECT DISTINCT col0 AS col1, col0 + - col0 + col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
15
91
91
92
92

query I rowsort
SELECT ALL 37 AS col2 FROM tab1 GROUP BY col0, col0
----
37
37
37

query I rowsort
SELECT ALL + - 43 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-43
-43
-43

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT 29 * - 58 FROM tab1 GROUP BY col2, col2
----
-1682

query II rowsort
SELECT DISTINCT + col2, col2 AS col0 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2724
SELECT ALL + col2 * 63 AS col1 FROM tab0 WHERE NOT ( NOT - NULLIF ( + col0, - col1 ) * + COALESCE ( CAST( col0 AS SIGNED ), + col2 / 59 + + col1 * + col2 ) < 21 ) GROUP BY col2, col2, col0
----
1512
2394
4977

skipif mysql # not compatible
query I rowsort label-2724
SELECT ALL + col2 * 63 AS col1 FROM tab0 WHERE NOT ( NOT - NULLIF ( + col0, - col1 ) * + COALESCE ( CAST ( col0 AS INTEGER ), + col2 / 59 + + col1 * + col2 ) < 21 ) GROUP BY col2, col2, col0
----
1512
2394
4977

query I rowsort
SELECT DISTINCT - col1 - - col1 * + 67 + + col1 * - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1025
305
413

query I rowsort
SELECT ALL - - 42 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT ( - + 49 ) IS NOT NULL
----

query I rowsort
SELECT ( + col2 ) AS col0 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 * - + 62 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT ( - + col1 ) IS NULL
----
3596
4898
5394

query I rowsort
SELECT + + col2 * ( - 23 ) + - 55 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-3510
-5538
-624

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - 83 col2 FROM tab1 WHERE + col2 * + col0 * col0 * - col1 BETWEEN ( col1 ) AND + col0 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 43 col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING + - col0 * - col1 >= ( NULL )
----

query II rowsort
SELECT col2 + - col2 + - col2 AS col1, - col2 * - 82 FROM tab0 GROUP BY col2
----
-24
1968
-38
3116
-79
6478

query I rowsort
SELECT 9 + + col2 + - 13 AS col1 FROM tab2 GROUP BY col2 HAVING 32 IS NOT NULL
----
54
75
83

query I rowsort
SELECT col2 + + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
116
158
174

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2735
SELECT - 38 * CAST( - col2 AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 8 IS NULL
----
2204
3002
3306

skipif mysql # not compatible
query I rowsort label-2735
SELECT - 38 * CAST ( - col2 AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 8 IS NULL
----
2204
3002
3306

query I rowsort
SELECT - + 46 FROM tab2 AS cor0 GROUP BY col0
----
-46
-46
-46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2737
SELECT + AVG ( ALL + - col0 ) col1 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN ( - col2 / + + 50 + + + 62 / - - CAST( NULL AS SIGNED ) - col1 ) AND 96 * 18 + col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2737
SELECT + AVG ( ALL + - col0 ) col1 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN ( - col2 / + + 50 + + + 62 / - - CAST ( NULL AS INTEGER ) - col1 ) AND 96 * 18 + col1
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

query I rowsort
SELECT 58 FROM tab1 GROUP BY col1, col1, col0
----
58
58
58

query I rowsort
SELECT - col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT + + col2 - 15 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
43
64
72

query I rowsort
SELECT 14 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
14
14
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2743
SELECT - CAST( NULL AS SIGNED ) / - col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2743
SELECT - CAST ( NULL AS INTEGER ) / - col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 0 FROM tab2 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col2 + + col0 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
153
30
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2746
SELECT DISTINCT CAST( NULL AS SIGNED ) - - - col0 * - 74 + - col0 * - 15 * 79 - + 3 + - 76 AS col2 FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-2746
SELECT DISTINCT CAST ( NULL AS INTEGER ) - - - col0 * - 74 + - col0 * - 15 * 79 - + 3 + - 76 AS col2 FROM tab0 GROUP BY col0
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2747
SELECT + CAST( - col0 AS SIGNED ) AS col0 FROM tab2 WHERE + col0 NOT IN ( - - 84, col2, - + CAST( NULL AS SIGNED ), col2, + col1 * - col0 ) GROUP BY col0, col0
----

skipif mysql # not compatible
query I rowsort label-2747
SELECT + CAST ( - col0 AS INTEGER ) AS col0 FROM tab2 WHERE + col0 NOT IN ( - - 84, col2, - + CAST ( NULL AS INTEGER ), col2, + col1 * - col0 ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT - + 19 + + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2 HAVING NULL IS NULL
----
-11
26
52

query I rowsort
SELECT - col2 * + - 5 FROM tab0 AS cor0 WHERE NULL BETWEEN col1 AND NULL GROUP BY col1, col2, col1
----

query I rowsort
SELECT DISTINCT 4 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
4

query I rowsort
SELECT DISTINCT - ( col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2752
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING CAST( NULL AS SIGNED ) IS NULL
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-2752
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING CAST ( NULL AS INTEGER ) IS NULL
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query II rowsort label-2753
SELECT + col2 AS col0, - 91 DIV 31 col1 FROM tab1 GROUP BY col2
----
45
-2
71
-2
8
-2

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2753
SELECT + col2 AS col0, - 91 / 31 col1 FROM tab1 GROUP BY col2
----
45
-2
71
-2
8
-2

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-2754
SELECT + col0 * col1 + - 91 AS col1, + 20 AS col1, + col1 * col1 * AVG ( CAST( NULL AS SIGNED ) ) + + col0 + - col0 * col0 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
9 values hashing to 35b165a283933a9b9e1f395fe13b274e

skipif mysql # not compatible
query III rowsort label-2754
SELECT + col0 * col1 + - 91 AS col1, + 20 AS col1, + col1 * col1 * AVG ( CAST ( NULL AS INTEGER ) ) + + col0 + - col0 * col0 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
9 values hashing to 35b165a283933a9b9e1f395fe13b274e

query I rowsort
SELECT - col0 * 34 FROM tab1 AS cor0 GROUP BY col0, col0
----
-2788
-748
-952

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2756
SELECT 93 * CAST( NULL AS SIGNED ) - + - col2 FROM tab0 WHERE - - COALESCE ( + col2, + col1 + + ( + col0 ), - col0 ) IS NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-2756
SELECT 93 * CAST ( NULL AS INTEGER ) - + - col2 FROM tab0 WHERE - - COALESCE ( + col2, + col1 + + ( + col0 ), - col0 ) IS NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab0 WHERE + - col2 IS NULL GROUP BY col2, col0, col1
----

query II rowsort
SELECT ALL 10, col2 AS col2 FROM tab0 GROUP BY col2
----
10
24
10
38
10
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT 20 IS NULL
----
-81
0
0

query II rowsort
SELECT ALL + col0, - col0 + - 55 + - - 68 * + - col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) <= 32 + - col0
----

query I rowsort
SELECT - 55 + + col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-43
33
59

query I rowsort
SELECT ALL + 40 * col1 * - col1 * + 50 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + - col1 / - ( + 93 ) BETWEEN - + 33 AND NULL
----

query I rowsort
SELECT + 99 * + col0 AS col1 FROM tab0 WHERE - 75 IS NOT NULL GROUP BY col0
----
2574
4257
8217

query II rowsort
SELECT col1 AS col0, ( - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
0
0
81
-81

query I rowsort
SELECT ALL - col2 + + 82 FROM tab0 GROUP BY col2
----
3
44
58

query I rowsort
SELECT - 66 + - NULLIF ( - 98, + + col0 ) AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
32
32
32

query I rowsort
SELECT ALL + col2 - + 48 + - 19 FROM tab2 GROUP BY col2
----
-9
12
20

query I rowsort
SELECT 55 * + col0 + + 62 + + col0 * + col0 AS col2 FROM tab2 GROUP BY col0
----
1112
13348
13586

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2770
SELECT - CAST( + ( - col0 ) AS SIGNED ) FROM tab2 GROUP BY col2, col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-2770
SELECT - CAST ( + ( - col0 ) AS INTEGER ) FROM tab2 GROUP BY col2, col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2771
SELECT ALL - - 94 - + - CAST( col2 AS SIGNED ) FROM tab2 cor0 GROUP BY col2
----
152
173
181

skipif mysql # not compatible
query I rowsort label-2771
SELECT ALL - - 94 - + - CAST ( col2 AS INTEGER ) FROM tab2 cor0 GROUP BY col2
----
152
173
181

query II rowsort
SELECT - col2 AS col0, - col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT - 64 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-64
-64
-64

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col0, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2775
SELECT DISTINCT 18 DIV + col2 FROM tab1 GROUP BY col2
----
0
2

skipif mysql # not compatible
query I rowsort label-2775
SELECT DISTINCT 18 / + col2 FROM tab1 GROUP BY col2
----
0
2

query I rowsort
SELECT col0 * ( col0 ) AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

query II rowsort
SELECT 77 + - col2 + + 58 AS col2, col2 * - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
48
7569
56
6241
77
3364

query I rowsort
SELECT ALL + - 39 FROM tab0 AS cor0 GROUP BY col2, col2
----
-39
-39
-39

query I rowsort
SELECT ALL - 71 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
-10
-12
-30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2780
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2780
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT + - col1 * - 83 + - - 78 + - col1 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
3686
4752
570

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL < col1
----

query II rowsort
SELECT ( - 22 ), 43 * - col0 + + col1 AS col0 FROM tab0 AS cor0 WHERE 44 IS NULL GROUP BY col0, col1, col0
----

query I rowsort
SELECT + ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2785
SELECT ALL + CAST( NULL AS SIGNED ) * + ( + col2 ) FROM tab1 GROUP BY col2 HAVING + 72 IS NULL
----

skipif mysql # not compatible
query I rowsort label-2785
SELECT ALL + CAST ( NULL AS INTEGER ) * + ( + col2 ) FROM tab1 GROUP BY col2 HAVING + 72 IS NULL
----

query I rowsort
SELECT DISTINCT col1 - 93 FROM tab0 GROUP BY col1, col1
----
-12
-93

query I rowsort
SELECT ALL 13 * + ( - col1 ) FROM tab1 GROUP BY col1, col0
----
-572
-741
-78

query I rowsort
SELECT ( 8 ) + 75 * - col1 FROM tab0 GROUP BY col1, col1
----
-6067
8

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col0 HAVING ( + 6 IS NULL )
----

query I rowsort
SELECT 52 * - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 72 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
72
72

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2792
SELECT DISTINCT + ( - CAST( NULL AS DECIMAL ) ) * col1 * - 85 FROM tab0 GROUP BY col2, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2792
SELECT DISTINCT + ( - CAST ( NULL AS REAL ) ) * col1 * - 85 FROM tab0 GROUP BY col2, col1
----
NULL

query I rowsort
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - 58 IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * col1 * + col1 col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 + - col0 + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
81

query II rowsort
SELECT ALL - col0 AS col0, - col0 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT DISTINCT + 18 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT - col2 IS NULL
----
18

query II rowsort
SELECT 92, + 35 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - 62 FROM tab2 GROUP BY col1
----
-62
-62
-62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2800
SELECT - CAST( 39 AS SIGNED ) AS col0 FROM tab2 GROUP BY col1
----
-39
-39
-39

skipif mysql # not compatible
query I rowsort label-2800
SELECT - CAST ( 39 AS INTEGER ) AS col0 FROM tab2 GROUP BY col1
----
-39
-39
-39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2801
SELECT ALL + 82 * col1 * - - 25 * + 36 * 16 AS col0 FROM tab0 GROUP BY col1 HAVING NOT CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-2801
SELECT ALL + 82 * col1 * - - 25 * + 36 * 16 AS col0 FROM tab0 GROUP BY col1 HAVING NOT CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT ALL 34 * + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
1530
2414
272

onlyif mysql # DIV for integer division: 
query I rowsort label-2803
SELECT ALL + NULLIF ( + - 27, - col0 + + + col2 * - col0 DIV + + col0 + + COALESCE ( - ( col0 ), col0 ) ) DIV - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
0
0
1

skipif mysql # not compatible
query I rowsort label-2803
SELECT ALL + NULLIF ( + - 27, - col0 + + + col2 * - col0 / + + col0 + + COALESCE ( - ( col0 ), col0 ) ) / - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
0
0
1

query I rowsort
SELECT 78 FROM tab1 cor0 GROUP BY col1
----
78
78
78

query I rowsort
SELECT ALL 37 FROM tab2 cor0 GROUP BY col0, col1
----
37
37
37

query I rowsort
SELECT DISTINCT - col2 * + col2 + ( col2 ) FROM tab0 GROUP BY col2 HAVING NULL BETWEEN - 57 AND 97
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 87 col0 FROM tab2 GROUP BY col1, col0
----
87

query I rowsort
SELECT DISTINCT + 30 FROM tab0 GROUP BY col0
----
30

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col1 AS col0, + col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL + 55 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
55
55
55

onlyif mysql # DIV for integer division: 
query I rowsort label-2812
SELECT + - ( - col1 ) - - - ( + + col1 ) DIV col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
56
6

skipif mysql # not compatible
query I rowsort label-2812
SELECT + - ( - col1 ) - - - ( + + col1 ) / col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
56
6

query I rowsort
SELECT - 89 + + - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT ( 50 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT 11 FROM tab2 GROUP BY col0 HAVING + + 21 > NULL
----

query I rowsort
SELECT DISTINCT + + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query II rowsort
SELECT DISTINCT + 69, col1 * - - col1 AS col1 FROM tab2 AS cor0 WHERE NOT 46 IS NULL GROUP BY col1
----
69
1681
69
3481
69
3721

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2817
SELECT DISTINCT + col1 * + + col0 / + - col1 - + + ( - CAST( NULL AS SIGNED ) ) * + + col0 AS col1 FROM tab2 GROUP BY col0, col1, col0 HAVING NULL IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-2817
SELECT DISTINCT + col1 * + + col0 / + - col1 - + + ( - CAST ( NULL AS INTEGER ) ) * + + col0 AS col1 FROM tab2 GROUP BY col0, col1, col0 HAVING NULL IS NULL
----
NULL

query I rowsort
SELECT DISTINCT + 28 FROM tab0 WHERE NOT NULL > - CASE col2 WHEN + ( - - col2 ) THEN + - 76 END * + - 92 GROUP BY col1
----

query II rowsort
SELECT ALL - 76 AS col1, col1 FROM tab1 cor0 WHERE col1 < + 40 GROUP BY col1, col0 HAVING ( ( NULL ) NOT BETWEEN ( - col0 ) AND col0 * 27 )
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT 67 FROM tab0 AS cor0 GROUP BY col1
----
67
67

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE - 41 IS NOT NULL GROUP BY col0, col1, col0
----
15
91
92

query I rowsort
SELECT - col0 + 8 AS col0 FROM tab2 AS cor0 WHERE 44 NOT IN ( col2 * + ( - col0 ) ) GROUP BY col0
----
-7
-83
-84

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - 10 + col1 = ( col1 )
----
-41
-59
-61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2825
SELECT DISTINCT col2 + - CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-2825
SELECT DISTINCT col2 + - CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * - col1 + 11 col1 FROM tab2 GROUP BY col1
----
-1670
-3470
-3710

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IN ( - 60 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 89 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= col2 / col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col1 HAVING ( NULL ) IN ( - col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - - col0 col0 FROM tab2 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT ALL - 81 AS col1 FROM tab1 WHERE ( col2 * + - col1 * - col1 ) NOT IN ( 11 * - 59 + - 5 ) GROUP BY col2 HAVING + 61 + + 48 <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2833
SELECT ALL - col1 + - col0 DIV - col1 - + col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - AVG ( ALL - 0 ) DIV + col0 IS NULL
----
-114
-87
-9

skipif mysql # not compatible
query I rowsort label-2833
SELECT ALL - col1 + - col0 / - col1 - + col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - AVG ( ALL - 0 ) / + col0 IS NULL
----
-114
-87
-9

query I rowsort
SELECT ALL + - ( col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col1 * col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) NOT BETWEEN col1 + - 49 AND ( NULL )
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NULL >= + col2 / 65 GROUP BY col1, col1
----

query I rowsort
SELECT ( + col1 ) - - col1 FROM tab2 GROUP BY col2, col1 HAVING NOT col1 IN ( + col2 + col1 )
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - 93 col0 FROM tab1 GROUP BY col0
----
-11
-65
-71

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - 86 AS col1 FROM tab0 AS cor0 WHERE NOT - 61 IS NOT NULL GROUP BY col1, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2842
SELECT ALL CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN NULL AND - ( + col0 ) * CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-2842
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN NULL AND - ( + col0 ) * CAST ( NULL AS INTEGER )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2843
SELECT col0 DIV col0 - col0 - - + col0 + - 16 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-15
-15

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2843
SELECT col0 / col0 - col0 - - + col0 + - 16 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-15
-15

query I rowsort
SELECT ALL 98 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT IN ( - AVG ( 25 ) )
----

query I rowsort
SELECT + col2 + + col1 FROM tab1 GROUP BY col2, col1 HAVING col2 * col2 <> ( NULL )
----

query I rowsort
SELECT - col0 * ( col0 ) - - col0 FROM tab2 WHERE col2 NOT BETWEEN NULL AND - - 37 AND + 74 IS NOT NULL GROUP BY col0
----
-210
-8190
-8372

query I rowsort
SELECT DISTINCT ( - 76 ) FROM tab0 GROUP BY col0, col1
----
-76

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT ( col0 + ( col2 ) ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2849
SELECT DISTINCT - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) NOT IN ( - CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-2849
SELECT DISTINCT - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) NOT IN ( - CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT - col0 + - 60 FROM tab0 GROUP BY col0
----
-103
-143
-86

query I rowsort
SELECT DISTINCT NULLIF ( + + 88, 27 ) * - col1 AS col0 FROM tab2 AS cor0 WHERE 33 * + col0 IS NULL GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING - 72 + - 25 NOT IN ( - col2 )
----
-24
-38
-79

query I rowsort
SELECT 91 FROM tab1 GROUP BY col2
----
91
91
91

query I rowsort
SELECT + 53 * + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1378
2279
4399

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT + 29 + + - ( - col2 ) FROM tab2 GROUP BY col2
----
108
116
87

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE NOT + col2 > NULL GROUP BY col2
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL = col2
----

query I rowsort
SELECT DISTINCT + 39 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT + col2 / col1 >= NULL
----

query I rowsort
SELECT + 30 AS col1 FROM tab1 WHERE NOT + 31 < NULL GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 58 / + col2 col1 FROM tab2 GROUP BY col1, col2, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 WHERE NOT ( 22 + - 59 ) = - col0 + + col0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT 96 + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
154
175
183

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 GROUP BY col0, col2, col1 HAVING NOT + 37 / col1 + - 54 BETWEEN NULL AND ( + col2 )
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0 HAVING - 58 IS NULL
----

query I rowsort
SELECT DISTINCT - 88 FROM tab1 GROUP BY col2
----
-88

query I rowsort
SELECT col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col0 - 14 FROM tab1 GROUP BY col0
----
14
68
8

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NULL NOT BETWEEN NULL AND - 44
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2870
SELECT DISTINCT - col1 DIV 1 + - col1 FROM tab1 GROUP BY col2, col1
----
-114
-12
-88

skipif mysql # not compatible
query I rowsort label-2870
SELECT DISTINCT - col1 / 1 + - col1 FROM tab1 GROUP BY col2, col1
----
-114
-12
-88

query I rowsort
SELECT - ( + + 2 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
-2
-2
-2

query I rowsort
SELECT 2 * + 86 AS col0 FROM tab1 GROUP BY col2
----
172
172
172

query I rowsort
SELECT + ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - ( col0 ), col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT BETWEEN + col0 AND AVG ( DISTINCT + col1 ) + - col1
----

query I rowsort
SELECT DISTINCT + col0 * + col0 * + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 / + - 63 - col1 + + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - 34 - + 26 * - col1 IS NOT NULL
----

query II rowsort
SELECT col1, 65 FROM tab2 AS cor0 GROUP BY col1
----
41
65
59
65
61
65

query I rowsort
SELECT DISTINCT 35 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT + + 15 IS NULL
----
35

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2879
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2879
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2880
SELECT col2 + + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2880
SELECT col2 + + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING 3 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2882
SELECT DISTINCT - + ( + CAST( NULL AS SIGNED ) ) FROM tab1 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-2882
SELECT DISTINCT - + ( + CAST ( NULL AS INTEGER ) ) FROM tab1 AS cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT 93 * + col0 AS col2 FROM tab2 GROUP BY col0, col2
----
1395
8463
8556

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-2884
SELECT col0 AS col0, + 74 AS col2 FROM tab0 GROUP BY col0 HAVING - ( + CAST( - 6 AS DECIMAL ) ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-2884
SELECT col0 AS col0, + 74 AS col2 FROM tab0 GROUP BY col0 HAVING - ( + CAST ( - 6 AS REAL ) ) IS NULL
----

query I rowsort
SELECT + ( - col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT + + 0 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT - 39 * + + 21 * + col0 + - col0 + - + col0 + + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-18084
-23016
-67404

query I rowsort
SELECT DISTINCT - 66 AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
-66

query I rowsort
SELECT col1 * + 35 * + + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
113715
1260
67760

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2890
SELECT + 73 * CAST( NULL AS SIGNED ) * + ( + col2 ) AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT - - 91 <> + 37
----

skipif mysql # not compatible
query I rowsort label-2890
SELECT + 73 * CAST ( NULL AS INTEGER ) * + ( + col2 ) AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT - - 91 <> + 37
----

query I rowsort
SELECT DISTINCT + + 87 FROM tab2 cor0 GROUP BY col0, col0
----
87

query I rowsort
SELECT + 92 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING - + 91 IS NULL
----

query I rowsort
SELECT ALL + col1 * - + 90 FROM tab1 GROUP BY col1
----
-3960
-5130
-540

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - 31 * 9 AS col0 FROM tab0 GROUP BY col1, col2, col1
----
-279
-279
-279

query I rowsort
SELECT ALL 99 FROM tab2 AS cor0 WHERE ( NOT + col0 IS NOT NULL ) GROUP BY col0
----

query I rowsort
SELECT ( + 26 ) AS col1 FROM tab0 GROUP BY col0, col1
----
26
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2899
SELECT DISTINCT + + CAST( NULL AS SIGNED ) * - 59 FROM tab2 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-2899
SELECT DISTINCT + + CAST ( NULL AS INTEGER ) * - 59 FROM tab2 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE NOT COALESCE ( + 7, + 64 * - col0 + + col2 ) + + col0 + - col1 / + col1 IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 58 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
58
58
58

query I rowsort
SELECT ALL + col1 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 40 FROM tab1 GROUP BY col2, col2
----
40
40
40

onlyif mysql # DIV for integer division: 
query I rowsort label-2904
SELECT col0 DIV - col1 - col1 col2 FROM tab1 GROUP BY col1, col2, col0 HAVING + + col2 + - 93 IS NOT NULL
----
-45
-57
-9

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2904
SELECT col0 / - col1 - col1 col2 FROM tab1 GROUP BY col1, col2, col0 HAVING + + col2 + - 93 IS NOT NULL
----
-45
-57
-9

query I rowsort
SELECT + 18 * col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
1476
396
504

query I rowsort
SELECT ( - col1 ) FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - 9 * - 38 + - + col0 FROM tab0 GROUP BY col0, col0
----
259
299
316

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2908
SELECT ALL col2 AS col0, + 83 FROM tab2 GROUP BY col2, col2 HAVING NOT CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-2908
SELECT ALL col2 AS col0, + 83 FROM tab2 GROUP BY col2, col2 HAVING NOT CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT - 90 FROM tab0 AS cor0 GROUP BY col2
----
-90
-90
-90

query I rowsort
SELECT DISTINCT + - ( - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + 49 + col1 + + col1 FROM tab0 GROUP BY col0, col1 HAVING - 53 IS NULL
----

query I rowsort
SELECT DISTINCT 52 FROM tab0 AS cor0 WHERE + col0 * - - col1 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL < 94
----

query II rowsort
SELECT - col0 + - col0, + col0 FROM tab0 GROUP BY col0, col0
----
-166
83
-52
26
-86
43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2915
SELECT DISTINCT - col0 / CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - 61 IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-2915
SELECT DISTINCT - col0 / CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - 61 IS NULL
----
NULL

query I rowsort
SELECT + + 51 FROM tab0 AS cor0 GROUP BY col1, col2
----
51
51
51

query I rowsort
SELECT 65 + - col0 FROM tab2 WHERE 1 + col2 NOT BETWEEN ( - + NULLIF ( + NULLIF ( - col2, - col0 ), - 63 ) + + 62 ) AND NULL GROUP BY col0
----
-26
-27
50

query I rowsort
SELECT ALL + col2 + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( ( ( - 97 ) IS NULL ) )
----
142
16
90

query I rowsort
SELECT DISTINCT 18 AS col0 FROM tab1 GROUP BY col2
----
18

query I rowsort
SELECT DISTINCT + col0 * + 49 AS col0 FROM tab1 GROUP BY col0
----
1078
1372
4018

onlyif mysql # DIV for integer division: 
query II rowsort label-2921
SELECT ALL - col0 AS col2, - col0 DIV + col0 - - - col0 AS col0 FROM tab2 GROUP BY col0
----
-15
-16
-91
-92
-92
-93

skipif mysql # not compatible
query II rowsort label-2921
SELECT ALL - col0 AS col2, - col0 / + col0 - - - col0 AS col0 FROM tab2 GROUP BY col0
----
-15
-16
-91
-92
-92
-93

query I rowsort
SELECT DISTINCT + 84 AS col1 FROM tab1 GROUP BY col0
----
84

query I rowsort
SELECT ALL col0 * + - 28 * col0 + - 75 + - 96 + - col0 * - col0 FROM tab0 GROUP BY col0
----
-18423
-186174
-50094

onlyif mysql # DIV for integer division: 
query I rowsort label-2924
SELECT + 35 * + col0 DIV + - col0 FROM tab1 cor0 GROUP BY col0
----
-35
-35
-35

skipif mysql # not compatible
query I rowsort label-2924
SELECT + 35 * + col0 / + - col0 FROM tab1 cor0 GROUP BY col0
----
-35
-35
-35

onlyif mysql # DIV for integer division: 
query I rowsort label-2925
SELECT + + col2 DIV col2 * 99 FROM tab1 AS cor0 GROUP BY col2
----
99
99
99

skipif mysql # not compatible
query I rowsort label-2925
SELECT + + col2 / col2 * 99 FROM tab1 AS cor0 GROUP BY col2
----
99
99
99

query II rowsort
SELECT NULLIF ( col1, - 83 ) + col1 AS col2, + col1 FROM tab2 GROUP BY col1 HAVING + 66 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2927
SELECT ALL - 67 DIV - 62 - - + col2 * + ( col2 ) FROM tab2 AS cor0 GROUP BY col2, col2
----
3365
6242
7570

skipif mysql # not compatible
query I rowsort label-2927
SELECT ALL - 67 / - 62 - - + col2 * + ( col2 ) FROM tab2 AS cor0 GROUP BY col2, col2
----
3365
6242
7570

query I rowsort
SELECT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT col1 * + 72 AS col2 FROM tab2 GROUP BY col0, col1, col0 HAVING NULL IS NULL
----
2952
4248
4392

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 7 IS NULL
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 30 * 85 + - col2 - 18 col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
2445
2453
2474

query I rowsort
SELECT DISTINCT - + 67 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - 36 ) IS NULL
----
-67

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) >= + col2 + + col1 * + 71
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 77 col2 FROM tab2 AS cor0 GROUP BY col0
----
77
77
77

query I rowsort
SELECT ALL + col0 + - ( - col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2936
SELECT - - 47 * + col2 / - col2 + - CAST( NULL AS DECIMAL ) + col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2936
SELECT - - 47 * + col2 / - col2 + - CAST ( NULL AS REAL ) + col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab2 AS cor0 WHERE ( col2 ) < col0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN 73 AND NULL
----

query I rowsort
SELECT + 98 FROM tab2 WHERE NOT ( - col0 * + col0 + + 13 ) = 48 + - CASE - col0 + col1 WHEN 56 * col2 + 2 THEN + col0 ELSE col0 END GROUP BY col1, col0
----
98
98
98

query I rowsort
SELECT 52 * col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= - 76 * - 70
----

query I rowsort
SELECT col1 - - - 31 FROM tab1 GROUP BY col1, col2
----
-25
13
26

query I rowsort
SELECT ( + + 46 ) AS col2 FROM tab1 GROUP BY col0, col0
----
46
46
46

query I rowsort
SELECT + ( - - col1 ) * + col1 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NOT 1 - AVG ( ALL 41 ) >= + NULLIF ( col2, - ( col2 ) ) / ( - col2 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2943
SELECT CAST( NULL AS SIGNED ) FROM tab2 WHERE NULL = ( + col1 - - col2 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-2943
SELECT CAST ( NULL AS INTEGER ) FROM tab2 WHERE NULL = ( + col1 - - col2 ) GROUP BY col2
----

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT 41 * + col1 IS NOT NULL
----

query II rowsort
SELECT + col1, + col1 * + - col1 * 9 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
-17424
57
-29241
6
-324

query I rowsort
SELECT col0 * - + col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) < - 23 + 8
----

query I rowsort
SELECT ALL col1 * - col1 FROM tab0 GROUP BY col1
----
-6561
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2948
SELECT + col2 + - col2 * + CAST( + - ( + CAST( NULL AS SIGNED ) ) AS SIGNED ) + - col2 FROM tab2 cor0 WHERE NOT col2 IS NULL GROUP BY col2 HAVING NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-2948
SELECT + col2 + - col2 * + CAST ( + - ( + CAST ( NULL AS INTEGER ) ) AS INTEGER ) + - col2 FROM tab2 cor0 WHERE NOT col2 IS NULL GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT 37 * - col1 * - + col1 AS col2 FROM tab2 GROUP BY col1
----
128797
137677
62197

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 WHERE 70 NOT BETWEEN - - ( - col1 ) AND NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ( - 68 ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN - col1 + + 8 AND NULL
----

query I rowsort
SELECT + 31 + + col1 * - - col1 + + + col1 AS col1 FROM tab0 GROUP BY col1
----
31
6673

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
0
0
81

query I rowsort
SELECT + col1 * - col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT DISTINCT + + 10 + ( - col1 ) * + + col1 * - col1 * - col1 FROM tab0 AS cor0 WHERE NOT 36 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT - + 95 FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2958
SELECT + ( - CAST( NULL AS SIGNED ) ) / col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( col1 ) <= ( + col1 + - 11 )
----

skipif mysql # not compatible
query I rowsort label-2958
SELECT + ( - CAST ( NULL AS INTEGER ) ) / col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( col1 ) <= ( + col1 + - 11 )
----

query I rowsort
SELECT 29 FROM tab1 GROUP BY col2 HAVING NULL = ( 27 * 97 )
----

query I rowsort
SELECT ALL - col1 + col1 FROM tab2 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + 4 + col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT 59 IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2962
SELECT + col2 AS col0 FROM tab2 WHERE NOT NULL BETWEEN CAST( + 5 AS DECIMAL ) AND NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-2962
SELECT + col2 AS col0 FROM tab2 WHERE NOT NULL BETWEEN CAST ( + 5 AS REAL ) AND NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 WHERE NOT NULL > ( col0 ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2965
SELECT col1 - + CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2965
SELECT col1 - + CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 68 AS col0 FROM tab0 GROUP BY col0
----
68

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN + col0 AND NULL
----

query II rowsort
SELECT - + 24, + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-24
58
-24
79
-24
87

query I rowsort
SELECT ALL - 32 FROM tab2 GROUP BY col1, col2 HAVING ( col1 ) BETWEEN ( + 61 ) AND + AVG ( ALL col0 )
----

query I rowsort
SELECT DISTINCT + col0 / - col1 - col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING + col0 = NULL
----

query I rowsort
SELECT ALL + 74 + col0 AS col1 FROM tab1 cor0 GROUP BY col0, col1 HAVING ( 98 ) IS NOT NULL
----
102
156
96

query I rowsort
SELECT - col0 * col0 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT 34 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + ( col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN 67 + col0 * + col1 AND + col0
----

query I rowsort
SELECT ( 18 ) + + col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 42 col1 FROM tab2 WHERE NULL BETWEEN NULL AND ( + col0 * - col1 + col1 ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + col1 ) col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col0 * - + col0 * NULLIF ( 79, 7 ) FROM tab2 GROUP BY col0, col0, col1
----
-17775
-654199
-668656

query I rowsort
SELECT + col0 * 2 FROM tab1 AS cor0 GROUP BY col0, col1, col0 HAVING NOT + col1 IN ( - col0 )
----
164
44
56

query I rowsort
SELECT ALL + 98 + + col2 AS col2 FROM tab1 AS cor0 WHERE col2 * + 32 <> - CASE col1 WHEN 58 THEN NULL ELSE - col1 END GROUP BY col2 HAVING NOT 71 >= NULL
----

query I rowsort
SELECT 32 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
32
32
32

query I rowsort
SELECT DISTINCT - ( 11 ) * col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT 49 IS NULL
----
-451
-649
-671

query I rowsort
SELECT ALL + NULLIF ( - col1, - ( - 26 ) ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING 89 IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2984
SELECT col0 col2 FROM tab1 GROUP BY col0 HAVING NULL = CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2984
SELECT col0 col2 FROM tab1 GROUP BY col0 HAVING NULL = CAST ( NULL AS REAL )
----

query I rowsort
SELECT DISTINCT + 39 AS col2 FROM tab2 GROUP BY col1, col1
----
39

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + col1 + + col1 col1 FROM tab2 GROUP BY col1
----
1722
3540
3782

query II rowsort
SELECT - col0 * + col0 + - + 52 + 59 AS col0, + 1 AS col0 FROM tab2 AS cor0 WHERE NULL = + col0 GROUP BY col0 HAVING ( AVG ( DISTINCT - col2 ) ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 1 * + col0 * - 62 - + 71 - + 71 col1 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
-1072
-5784
-5846

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2989
SELECT ALL CAST( - col0 AS SIGNED ) AS col2, ( + col0 ) AS col0 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

skipif mysql # not compatible
query II rowsort label-2989
SELECT ALL CAST ( - col0 AS INTEGER ) AS col2, ( + col0 ) AS col0 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT + col1 * - 9 FROM tab2 GROUP BY col1
----
-369
-531
-549

query I rowsort
SELECT ALL 8 FROM tab1 cor0 WHERE NOT ( - col1 * 70 ) IS NOT NULL GROUP BY col2, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2992
SELECT + col2 DIV - 57 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-2992
SELECT + col2 / - 57 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
0
0

query II rowsort
SELECT DISTINCT - + col1, + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2994
SELECT DISTINCT - CAST( NULL AS DECIMAL ) * - col1 * - - col1 / col1 AS col1 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2994
SELECT DISTINCT - CAST ( NULL AS REAL ) * - col1 * - - col1 / col1 AS col1 FROM tab1 GROUP BY col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2995
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT - COALESCE ( - 90, - + CAST( NULL AS SIGNED ) ) <= 51
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-2995
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT - COALESCE ( - 90, - + CAST ( NULL AS INTEGER ) ) <= 51
----
-41
-59
-61

query I rowsort
SELECT ALL col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT - col1 * + 35 FROM tab0 AS cor0 GROUP BY col1
----
-2835
0

query I rowsort
SELECT - col0 + - col2 + - col2 * - ( - col2 ) AS col1 FROM tab1 cor0 GROUP BY col0, col2, col0
----
-2098
-5194
-94

query I rowsort
SELECT DISTINCT + 9 FROM tab2 cor0 GROUP BY col2, col1
----
9

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL <= - + col1
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT 17 FROM tab2 GROUP BY col2
----
17

query II rowsort
SELECT + + 16 * - col1, + col1 * 33 * ( col1 ) * - 76 FROM tab1 AS cor0 WHERE NOT + 46 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL col0 + - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 92 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
92
92
92

onlyif mysql # DIV for integer division: 
query I rowsort label-3007
SELECT DISTINCT 82 + 80 DIV - - 57 + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
124
142
144

skipif mysql # not compatible
query I rowsort label-3007
SELECT DISTINCT 82 + 80 / - - 57 + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
124
142
144

query I rowsort
SELECT DISTINCT COALESCE ( 20, + 58 ) AS col0 FROM tab1 GROUP BY col0
----
20

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3009
SELECT ALL + CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3009
SELECT ALL + CAST ( NULL AS REAL ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 96 FROM tab1 GROUP BY col0 HAVING NULL <> - 80
----

query I rowsort
SELECT + + col2 AS col1 FROM tab0 WHERE NOT - col0 NOT IN ( - col1, - col0, + - 30, + col2 * col0, - col2 ) GROUP BY col1, col2 HAVING NOT + - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 * col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL >= - col2
----

query I rowsort
SELECT DISTINCT + 20 + + col1 AS col0 FROM tab2 GROUP BY col1, col1
----
61
79
81

query I rowsort
SELECT + 66 AS col1 FROM tab1 GROUP BY col1, col0
----
66
66
66

query I rowsort
SELECT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NOT NULL
----

query I rowsort
SELECT + 7 + - col0 FROM tab2 GROUP BY col0, col2, col2
----
-8
-84
-85

query I rowsort
SELECT ALL - 8 FROM tab0 AS cor0 WHERE ( col1 ) BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT - + ( - col2 ) IS NULL
----
-58
-79
-87

query I rowsort
SELECT - 39 FROM tab0 AS cor0 GROUP BY col2
----
-39
-39
-39

query I rowsort
SELECT ALL - - col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( - - 93 ) col0 FROM tab0 GROUP BY col2, col2
----
93
93
93

query I rowsort
SELECT ALL + col0 * - - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3023
SELECT - + 74 + NULLIF ( - 46, col1 ) + 88 + + col2 FROM tab1 WHERE + + CAST( NULL AS SIGNED ) <> + - col2 GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-3023
SELECT - + 74 + NULLIF ( - 46, col1 ) + 88 + + col2 FROM tab1 WHERE + + CAST ( NULL AS INTEGER ) <> + - col2 GROUP BY col1, col2
----

query I rowsort
SELECT ALL - 27 FROM tab1 GROUP BY col2, col1 HAVING NOT - - 66 IS NOT NULL
----

query II rowsort
SELECT + 53, col0 AS col0 FROM tab2 GROUP BY col0
----
53
15
53
91
53
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3026
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT col0 / 13 + - + CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3026
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT col0 / 13 + - + CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT 12 AS col1 FROM tab1 GROUP BY col2
----
12
12
12

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL + col0 - + - ( + + 30 ) FROM tab2 GROUP BY col0
----
121
122
45

query II rowsort
SELECT ALL col1, col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1, - COALESCE ( 52, - col0 * - + col0 + - + col2 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 91 / + 60 IS NULL
----
41
-52
59
-52
61
-52

query I rowsort
SELECT - col2 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 + + 67 FROM tab2 AS cor0 GROUP BY col2
----
125
146
154

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT 2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
2
2
2

query II rowsort
SELECT ALL col2, - col2 + + col2 FROM tab0 GROUP BY col2 HAVING NOT - 87 + + 71 IS NULL
----
24
0
38
0
79
0

query I rowsort
SELECT DISTINCT 73 FROM tab1 GROUP BY col2, col0
----
73

query I rowsort
SELECT ALL 78 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
78
78
78

query I rowsort
SELECT DISTINCT + ( - ( col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col2 HAVING NOT ( + ( + ( - 76 ) ) + + col0 * - - 46 ) IS NULL
----
-15
-91
-92

query I rowsort
SELECT NULLIF ( + 38, + 52 ) FROM tab0 AS cor0 GROUP BY col1
----
38
38

query I rowsort
SELECT DISTINCT + col0 * + + col0 AS col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT - + col2 * 72 * - 23 AS col0 FROM tab1 cor0 WHERE NOT ( - col2 ) IN ( - col0 * col2 * - - 13 / + col0, + col1, col1 - + 50 ) GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - col0 + - col0 + - col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT ALL + ( - - col2 ) FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING + 46 IS NULL
----

query I rowsort
SELECT DISTINCT col1 - + 57 AS col2 FROM tab2 GROUP BY col1 HAVING - col1 <= 95 * + col1
----
-16
2
4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3048
SELECT ALL + col1 + + + CAST( AVG ( DISTINCT - - col1 ) AS SIGNED ) AS col0 FROM tab1 GROUP BY col1
----
114
12
88

skipif mysql # not compatible
query I rowsort label-3048
SELECT ALL + col1 + + + CAST ( AVG ( DISTINCT - - col1 ) AS INTEGER ) AS col0 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT ALL 25 FROM tab0 AS cor0 GROUP BY col0, col1
----
25
25
25

query I rowsort
SELECT + 24 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
24
24

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3051
SELECT ALL + CAST( NULL AS SIGNED ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-3051
SELECT ALL + CAST ( NULL AS INTEGER ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

query I rowsort
SELECT DISTINCT ( + col0 ) * + + 19 AS col2 FROM tab1 GROUP BY col0
----
1558
418
532

onlyif mysql # DIV for integer division: 
query I rowsort label-3053
SELECT ALL + col2 DIV col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3053
SELECT ALL + col2 / col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1
1
1

query I rowsort
SELECT ALL - col2 + col2 * col2 AS col2 FROM tab1 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT + 97 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING + col1 + + 68 IS NOT NULL
----
97
97
97

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 21, 98 col2 FROM tab1 cor0 GROUP BY col2, col1
----
21
98
21
98
21
98

onlyif mysql # DIV for integer division: 
query II rowsort label-3057
SELECT col0 * + col0 AS col1, - 33 DIV - col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
484
1
6724
0
784
1

skipif mysql # not compatible
query II rowsort label-3057
SELECT col0 * + col0 AS col1, - 33 / - col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
484
1
6724
0
784
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3058
SELECT DISTINCT - CAST( NULL AS SIGNED ) / - col0 AS col1 FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-3058
SELECT DISTINCT - CAST ( NULL AS INTEGER ) / - col0 AS col1 FROM tab0 GROUP BY col0
----
NULL

query I rowsort
SELECT + + 42 * col0 - - col0 FROM tab2 AS cor0 WHERE 22 BETWEEN col0 AND NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT - 97 + + col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-85
-9
17

query II rowsort
SELECT DISTINCT - ( - col0 ) * + 48 + 99, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
4467
91
4515
92
819
15

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3064
SELECT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col0, col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3064
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col0, col2, col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 AS col2, col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) = NULL
----

query II rowsort
SELECT ALL 15, + col0 FROM tab0 GROUP BY col0
----
15
26
15
43
15
83

query I rowsort
SELECT ALL col1 + 11 AS col2 FROM tab0 GROUP BY col1, col1
----
11
92

query I rowsort
SELECT + col1 + + 51 AS col1 FROM tab2 GROUP BY col1, col2
----
110
112
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 12 + - col0 col1 FROM tab2 GROUP BY col2, col0
----
-3
-79
-80

query II rowsort
SELECT - 69 AS col2, ( - 92 ) FROM tab1 GROUP BY col1
----
-69
-92
-69
-92
-69
-92

query I rowsort
SELECT ALL col2 + - - col2 * - col2 FROM tab1 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT 33 * - 26 FROM tab0 AS cor0 GROUP BY col0
----
-858
-858
-858

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL ( + col2 ), col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
58
79
79
87
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1 HAVING NULL < col0 + ( + 38 )
----

query II rowsort
SELECT DISTINCT - 12 AS col1, 4 / col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 80 FROM tab1 cor0 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
-80
-80
-80

query I rowsort
SELECT ALL - ( + - col2 ) + ( 78 ) FROM tab2 GROUP BY col2
----
136
157
165

query I rowsort
SELECT ALL 58 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
58
58

query I rowsort
SELECT ALL NULLIF ( + col2, + 3 ) FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT - 75 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
-75
-75
-75

query I rowsort
SELECT 5 FROM tab0 cor0 GROUP BY col2, col2
----
5
5
5

query I rowsort
SELECT 17 AS col0 FROM tab2 GROUP BY col1
----
17
17
17

query I rowsort
SELECT ALL ( - col0 ) FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 WHERE NULL IN ( + col2, NULLIF ( + ( - col1 ), + + col0 / - col0 ), + 97 ) GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3086
SELECT ALL + col2 * - + col2 + - col2 + - col2 + + 51 + + - col2, + 42 + + CAST( NULL AS SIGNED ) col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-3487
NULL
-6427
NULL
-7779
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3086
SELECT ALL + col2 * - + col2 + - col2 + - col2 + + 51 + + - col2, + 42 + + CAST ( NULL AS INTEGER ) col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-3487
NULL
-6427
NULL
-7779
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3087
SELECT - col0 AS col0 FROM tab0 cor0 WHERE NOT - CAST( NULL AS SIGNED ) < NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3087
SELECT - col0 AS col0 FROM tab0 cor0 WHERE NOT - CAST ( NULL AS INTEGER ) < NULL GROUP BY col0
----

query I rowsort
SELECT ALL - - 8 FROM tab2 AS cor0 GROUP BY col1, col0
----
8
8
8

query I rowsort
SELECT ( - 92 ) AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT 95 * 0 AS col2 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + + col2 FROM tab2 WHERE ( - col0 * col2 - - col0 IS NULL ) GROUP BY col2
----

query I rowsort
SELECT + ( - col1 ) * + col1 AS col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL COALESCE ( + - ( col1 ), - col0 ) + 99 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
42
55
93

query I rowsort
SELECT ALL 89 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
18
44
81

query I rowsort
SELECT + 80 FROM tab1 AS cor0 WHERE NOT + col1 = ( - + col2 ) GROUP BY col2, col1
----
80
80
80

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3098
SELECT col1 * CAST( NULL AS SIGNED ) col0 FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3098
SELECT col1 * CAST ( NULL AS INTEGER ) col0 FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

query II rowsort
SELECT ALL col2 AS col2, - col2 FROM tab0 GROUP BY col2, col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT - 3 FROM tab2 GROUP BY col2, col0
----
-3
-3
-3

query I rowsort
SELECT 38 FROM tab0 GROUP BY col0, col0
----
38
38
38

query I rowsort
SELECT ALL col0 * - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE NOT col0 * - 96 = - 0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT 51 FROM tab1 GROUP BY col0, col2, col2
----
51
51
51

query I rowsort
SELECT + col2 * + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query II rowsort
SELECT + col2 * - col2 * + + 96 - col2 AS col0, - col0 + + - 57 AS col2 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col2, col2, col0
----

query I rowsort
SELECT - col0 + + + ( + col0 ) - - 0 / col0 AS col1 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0 HAVING NOT NULL <= - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * - col1 + + col1 - - col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6723

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3109
SELECT + - CAST( NULL AS SIGNED ) * col0 * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - 41 / + + 23, ( + - 45 ), CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-3109
SELECT + - CAST ( NULL AS INTEGER ) * col0 * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - 41 / + + 23, ( + - 45 ), CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT DISTINCT 69 FROM tab2 GROUP BY col0, col0
----
69

query II rowsort
SELECT - 1, col2 FROM tab2 WHERE + col0 * - col0 + - col2 + - 47 IS NULL GROUP BY col1, col2, col2, col0
----

query I rowsort
SELECT 89 * - - 73 + + + col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 78 col1 FROM tab1 GROUP BY col0, col2
----
78

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING 69 IS NULL
----

query I rowsort
SELECT - 97 AS col1 FROM tab1 GROUP BY col2
----
-97
-97
-97

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3116
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3116
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 89 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 / + 26 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3118
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3118
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3119
SELECT ALL 33 + + - 89 AS col2 FROM tab2 GROUP BY col1 HAVING - CAST( NULL AS SIGNED ) IS NULL
----
-56
-56
-56

skipif mysql # not compatible
query I rowsort label-3119
SELECT ALL 33 + + - 89 AS col2 FROM tab2 GROUP BY col1 HAVING - CAST ( NULL AS INTEGER ) IS NULL
----
-56
-56
-56

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-3120
SELECT + 13 AS col2, + ( COALESCE ( col2, + 2 - - + CAST( NULL AS SIGNED ) + - col1 DIV + CAST( NULL AS SIGNED ), 96 ) ) FROM tab2 AS cor0 GROUP BY col2, col1
----
13
58
13
79
13
87

skipif mysql # not compatible
query II rowsort label-3120
SELECT + 13 AS col2, + ( COALESCE ( col2, + 2 - - + CAST ( NULL AS INTEGER ) + - col1 / + CAST ( NULL AS INTEGER ), 96 ) ) FROM tab2 AS cor0 GROUP BY col2, col1
----
13
58
13
79
13
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3121
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 WHERE 10 * + 93 * + col0 * + 57 * + - ( + col0 ) = + CAST( - 0 AS SIGNED ) GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3121
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 WHERE 10 * + 93 * + col0 * + 57 * + - ( + col0 ) = + CAST ( - 0 AS INTEGER ) GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND + CAST ( NULL AS INTEGER )
----

query II rowsort
SELECT - col2 AS col2, + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
81
-38
0
-79
0

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3123
SELECT + 37 / + col2, + col2 FROM tab2 GROUP BY col2 HAVING CAST( col2 AS DECIMAL ) < NULL
----

skipif mysql # not compatible
query II rowsort label-3123
SELECT + 37 / + col2, + col2 FROM tab2 GROUP BY col2 HAVING CAST ( col2 AS REAL ) < NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL + - col2 FROM tab2 WHERE NOT NULL = - - 26 + + - col2 GROUP BY col2
----

query II rowsort
SELECT ALL - + col0, 85 / - 7 FROM tab1 AS cor0 GROUP BY col0, col0, col2 HAVING ( NOT NULL BETWEEN - + COALESCE ( + col2, + col0 * - - 0 ) * col2 AND + col0 )
----

query I rowsort
SELECT DISTINCT + + col2 * col2 + + 23 FROM tab1 AS cor0 GROUP BY col2, col0
----
2048
5064
87

query I rowsort
SELECT ALL + 72 FROM tab2 GROUP BY col2, col2
----
72
72
72

query I rowsort
SELECT 0 * col0 * + + 59 FROM tab0 GROUP BY col0, col2 HAVING 64 <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3130
SELECT ALL + col1 * - col1 DIV - col1 + - + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-3130
SELECT ALL + col1 * - col1 / - col1 + - + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query II rowsort
SELECT ALL 53 * + col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
1166
22
1484
28
4346
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - 74 - - 47 + + - 82 col2, col0 FROM tab0 AS cor0 WHERE NOT - col1 IS NULL GROUP BY col1, col0 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 34 + + 62 * - + col1 col0 FROM tab2 GROUP BY col1
----
-2508
-3624
-3748

query I rowsort
SELECT DISTINCT 54 * 76 AS col2 FROM tab2 GROUP BY col1, col1
----
4104

query I rowsort
SELECT ALL - 40 + + 22 * + col1 * + col1 * 32 AS col1 FROM tab2 GROUP BY col1, col0, col2 HAVING 36 * + 12 IS NOT NULL
----
1183384
2450584
2619544

query I rowsort
SELECT + 54 AS col0 FROM tab1 GROUP BY col2 HAVING ( - + 23 ) < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3138
SELECT ALL + CAST( - col0 AS SIGNED ) FROM tab1 GROUP BY col1, col0 HAVING NULL = 10
----

skipif mysql # not compatible
query I rowsort label-3138
SELECT ALL + CAST ( - col0 AS INTEGER ) FROM tab1 GROUP BY col1, col0 HAVING NULL = 10
----

query I rowsort
SELECT AVG ( ALL + + 35 ) * col1 AS col2 FROM tab2 WHERE NULL <> ( NULL ) GROUP BY col1, col0 HAVING 64 IS NULL
----

query I rowsort
SELECT DISTINCT ( ( - + ( 49 ) ) ) FROM tab2 GROUP BY col0, col0
----
-49

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( 94 * 22 ) IS NOT NULL
----

query II rowsort
SELECT DISTINCT col0, - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
-15
91
-91
92
-92

query I rowsort
SELECT DISTINCT - 34 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-34

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT - col0 IS NULL
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3145
SELECT + + CAST( NULL AS SIGNED ) col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT ( - col1 ) IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3145
SELECT + + CAST ( NULL AS INTEGER ) col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT ( - col1 ) IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col1 - + 29 * + - ( - COALESCE ( col1, + ( - 69 ) ) ) FROM tab0 GROUP BY col1 HAVING NOT NULL IN ( 58 * ( 61 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - - 7 col1 FROM tab1 cor0 GROUP BY col0 HAVING + - col1 >= NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 WHERE ( col1 NOT BETWEEN NULL AND + col0 + - col0 ) GROUP BY col0 HAVING NOT NULL = 2 / - 83
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3149
SELECT ALL col0 FROM tab2 GROUP BY col2, col0, col2 HAVING NOT + + CAST( col2 AS SIGNED ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-3149
SELECT ALL col0 FROM tab2 GROUP BY col2, col0, col2 HAVING NOT + + CAST ( col2 AS INTEGER ) <> NULL
----

query I rowsort
SELECT col1 * col1 * col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
185193
216
85184

query II rowsort
SELECT col0, - col0 * + + 40 * - col0 FROM tab1 GROUP BY col2, col0
----
22
19360
28
31360
82
268960

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) NOT IN ( - col2 * - col0 + + col1 + - col0 / - 44 ) GROUP BY col2 HAVING NOT + col2 IN ( 96 * - col2 )
----

query I rowsort
SELECT - - ( + + col0 ) FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + + 62 - - + col0 * - ( + col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-422
-6662
-722

query I rowsort
SELECT - + 88 AS col0 FROM tab2 cor0 GROUP BY col1
----
-88
-88
-88

query I rowsort
SELECT ALL ( col2 ) AS col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT 29 - 29 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING - col2 IS NULL
----

query I rowsort
SELECT - 88 * + col2 + + col2 AS col1 FROM tab0 GROUP BY col2
----
-2088
-3306
-6873

query I rowsort
SELECT DISTINCT - col0 + - col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + ( + col1 ) AS col1 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col0 + - col2 FROM tab0 WHERE NOT + col1 * + col1 IN ( ( - 26 ) * NULLIF ( col0 + + col0, + 57 ) ) GROUP BY col1, col0, col2 HAVING - 12 <> NULL
----

query I rowsort
SELECT DISTINCT + col1 * + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col0 HAVING 86 IS NOT NULL
----
-6561
0

query I rowsort
SELECT + col0 + + col0 * + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
506
6806
812

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 * - 92 + AVG ( + col0 ) AS col2 FROM tab0 GROUP BY col0 HAVING ( NULL ) <= col2
----

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
142
16
90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3169
SELECT + CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1, col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3169
SELECT + CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1, col2, col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3170
SELECT DISTINCT col1 - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-3170
SELECT DISTINCT col1 - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1
----
NULL

query I rowsort
SELECT + 65 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 74 IS NULL
----
65
65
65

query I rowsort
SELECT - col1 + + col0 AS col2 FROM tab2 AS cor0 WHERE NOT + CASE 20 WHEN + 8 THEN - col1 WHEN - 81 THEN + col2 + - NULLIF ( + 53, - 96 ) ELSE + col1 END IN ( - col0 * + 8 ) GROUP BY col1, col0, col2
----
-46
32
51

query I rowsort
SELECT ALL 42 * col0 FROM tab1 AS cor0 WHERE NOT 64 - col1 = NULL GROUP BY col0 HAVING NOT ( col0 ) IS NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE NOT col1 - 86 IS NULL GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col2 * - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - 6 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-6

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND + + ( + + col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3178
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3178
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col1 + + + col1 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3181
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3181
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ( - 26 ) AS col1 FROM tab2 GROUP BY col0 HAVING NOT col0 / 1 + + col0 * col0 IS NULL
----
-26
-26
-26

query I rowsort
SELECT 86 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NULL
----
86
86
86

query II rowsort
SELECT ALL col0, + ( - - col0 ) FROM tab1 GROUP BY col2, col2, col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL col2 + - col2 + 59 FROM tab0 AS cor0 GROUP BY col2
----
59
59
59

query II rowsort
SELECT - - col0 + - - ( + - 66 ) * - - col0 AS col0, + col0 + - - 13 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 = NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3187
SELECT + col0 FROM tab2 WHERE + + CAST( NULL AS DECIMAL ) + + - CAST( + col2 AS DECIMAL ) IS NULL GROUP BY col0, col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-3187
SELECT + col0 FROM tab2 WHERE + + CAST ( NULL AS REAL ) + + - CAST ( + col2 AS REAL ) IS NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - - 84 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 12 IS NOT NULL
----

query I rowsort
SELECT + ( + col0 ) + 41 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <= NULL GROUP BY col0, col0
----

query I rowsort
SELECT 66 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL > - - col2
----

query I rowsort
SELECT + col0 + 3 * - 78 AS col2 FROM tab1 cor0 GROUP BY col1, col0
----
-152
-206
-212

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + col2 col2 FROM tab0 WHERE + ( - col1 ) IS NOT NULL GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT ALL + ( - - col0 ) AS col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query II rowsort
SELECT - col0, col2 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
102
-91
170
-92
150

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3196
SELECT DISTINCT - - CAST( NULL AS SIGNED ) / - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-3196
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) / - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL

query I rowsort
SELECT DISTINCT - 84 FROM tab0 AS cor0 WHERE NOT + 96 / + col1 <= NULL GROUP BY col1, col0
----

query I rowsort
SELECT + + 41 FROM tab0 AS cor0 GROUP BY col0, col0
----
41
41
41

query I rowsort
SELECT - col1 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULLIF ( - - 73, col2 ) + - AVG ( + - col0 ) * - 52 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT 20 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
20
20
20

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 AS cor0 WHERE + col0 + - - 37 IS NULL GROUP BY col0, col0, col1
----

query I rowsort
SELECT DISTINCT 77 FROM tab0 AS cor0 GROUP BY col0, col1
----
77

query I rowsort
SELECT DISTINCT + 45 * + + 40 - + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
1718
1772
1778

query I rowsort
SELECT DISTINCT + col2 * - ( + + col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT + col2 IS NULL GROUP BY col2
----
-2025
-5041
-64

query II rowsort
SELECT DISTINCT + col1, col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
44
57
57
6
6

query I rowsort
SELECT col1 * - 98 * + 42 FROM tab0 GROUP BY col1 HAVING + col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 63 col2 FROM tab0 WHERE NOT - - col2 / - - col1 > NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 AS col2, + ( + 20 ) col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
20
59
20
61
20

query II rowsort
SELECT 0, + col2 * + ( + col2 ) + - col2 AS col2 FROM tab0 GROUP BY col2
----
0
1406
0
552
0
6162

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col0, col0 / 72 AS col2 FROM tab2 GROUP BY col0 HAVING NOT 85 >= NULL
----

query I rowsort
SELECT - 46 AS col2 FROM tab0 GROUP BY col1
----
-46
-46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3216
SELECT DISTINCT + - CAST( NULL AS SIGNED ) col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3216
SELECT DISTINCT + - CAST ( NULL AS INTEGER ) col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT ( + 0 ) * + col0 + col0 * - - col0 + + 84 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
309
8365
8548

query I rowsort
SELECT - 26 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col0, col2
----

query I rowsort
SELECT 29 FROM tab1 GROUP BY col2
----
29
29
29

query II rowsort
SELECT ALL - col1 * + + col1, col1 FROM tab0 GROUP BY col1
----
-6561
81
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3221
SELECT DISTINCT ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + + col0 = - CAST( NULL AS SIGNED ) - + - 51
----

skipif mysql # not compatible
query I rowsort label-3221
SELECT DISTINCT ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + + col0 = - CAST ( NULL AS INTEGER ) - + - 51
----

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 * 83 + - col2 FROM tab0 cor0 GROUP BY col2
----
-2016
-3192
-6636

onlyif mysql # DIV for integer division: 
query II rowsort label-3224
SELECT ALL + ( + ( + - col0 ) ) * + col0 + + + col0 DIV - ( + col0 ) - - col0 * 56 AS col0, + col0 * 31 FROM tab1 AS cor0 GROUP BY col0
----
-2133
2542
747
682
783
868

skipif mysql # not compatible
query II rowsort label-3224
SELECT ALL + ( + ( + - col0 ) ) * + col0 + + + col0 / - ( + col0 ) - - col0 * 56 AS col0, + col0 * 31 FROM tab1 AS cor0 GROUP BY col0
----
-2133
2542
747
682
783
868

query II rowsort
SELECT DISTINCT + col0 AS col2, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 + col2 col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + 12 / 49 + - col2 * col2 < ( + col0 / 26 )
----
-19
-45
53

query I rowsort
SELECT ALL col1 * + 62 AS col1 FROM tab1 AS cor0 WHERE + ( + 54 ) + + ( - 88 ) NOT IN ( col1 / + col0 ) GROUP BY col0, col1
----
2728
3534
372

query I rowsort
SELECT ALL - - ( - - col2 ) AS col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT 13 FROM tab1 AS cor0 GROUP BY col2, col0
----
13
13
13

query II rowsort
SELECT - col0, col0 / + + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < - 69
----

query II rowsort
SELECT ALL + col1 * - 12 AS col0, + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-492
41
-708
59
-732
61

query II rowsort
SELECT ALL col0, - 98 FROM tab1 GROUP BY col0
----
22
-98
28
-98
82
-98

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3233
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT + 95 <> - 85
----

skipif mysql # not compatible
query I rowsort label-3233
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT + 95 <> - 85
----

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT + - col0 BETWEEN ( + col0 ) AND ( NULL )
----
24
38
79

query I rowsort
SELECT DISTINCT - - 70 - - 19 FROM tab1 WHERE NOT + 12 > NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3236
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3236
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

query II rowsort
SELECT + col2 AS col2, ( - col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT + col2 NOT IN ( + 50 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3238
SELECT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT - + col1 * + + AVG ( - + col1 ) + - - 51 + + col0 * + CAST( col0 AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3238
SELECT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT - + col1 * + + AVG ( - + col1 ) + - - 51 + + col0 * + CAST ( col0 AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IN ( - ( + 81 ) )
----

query I rowsort
SELECT + 0 AS col2 FROM tab1 GROUP BY col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST( NULL AS SIGNED ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST ( NULL AS INTEGER ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

query I rowsort
SELECT 72 FROM tab2 GROUP BY col2, col1 HAVING col1 IN ( + - col2 + - + col2 )
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2 HAVING 16 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3245
SELECT - CAST( - + CASE + + col0 WHEN + ( + + ( - CAST( NULL AS SIGNED ) ) ) THEN + - col1 END AS SIGNED ) FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3245
SELECT - CAST ( - + CASE + + col0 WHEN + ( + + ( - CAST ( NULL AS INTEGER ) ) ) THEN + - col1 END AS INTEGER ) FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + + 75 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT - + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 76 * 84 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
6384

query I rowsort
SELECT 91 AS col1 FROM tab2 WHERE NULL NOT BETWEEN ( NULL ) AND ( NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NOT - 41 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL 49 + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
132
75
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3251
SELECT CAST( NULL AS SIGNED ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3251
SELECT CAST ( NULL AS INTEGER ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 42 + + col0 AS col0 FROM tab2 GROUP BY col0
----
133
134
57

query I rowsort
SELECT ALL + col2 + 42 FROM tab1 GROUP BY col2
----
113
50
87

query I rowsort
SELECT DISTINCT + col2 FROM tab0 WHERE col0 * 35 + 12 * - col0 NOT IN ( - col1 ) GROUP BY col0, col2, col1 HAVING NOT - col1 * 12 + + col2 IS NULL
----
24
38
79

query I rowsort
SELECT + 85 + - col0 AS col2 FROM tab2 GROUP BY col0
----
-6
-7
70

query I rowsort
SELECT ALL - 18 * 79 AS col2 FROM tab0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 * - 76 FROM tab1 GROUP BY col0, col0
----
-1672
-2128
-6232

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3258
SELECT DISTINCT - - 51 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IN ( - ( CAST( + CAST( 5 AS SIGNED ) AS SIGNED ) ) * + col0 )
----

skipif mysql # not compatible
query I rowsort label-3258
SELECT DISTINCT - - 51 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IN ( - ( CAST ( + CAST ( 5 AS INTEGER ) AS INTEGER ) ) * + col0 )
----

query I rowsort
SELECT + 69 FROM tab0 GROUP BY col2, col2 HAVING NOT ( NULL ) = col2
----

query I rowsort
SELECT ALL + 92 - col1 AS col0 FROM tab1 GROUP BY col1 HAVING col1 IS NOT NULL
----
35
48
86

query I rowsort
SELECT ALL 30 FROM tab2 AS cor0 GROUP BY col0
----
30
30
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - 91 AS col1 FROM tab0 GROUP BY col0, col2
----
-91
-91
-91

query I rowsort
SELECT 3 / col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING 45 IS NULL
----

query II rowsort
SELECT DISTINCT col1 * - + 67 AS col0, - 71 * + - col1 / 53 FROM tab2 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3266
SELECT col0 DIV + col0 AS col1 FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3266
SELECT col0 / + col0 AS col1 FROM tab2 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col0 AS col2 FROM tab2 WHERE NOT NULL <= - col1 GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab2 WHERE NOT 42 + 71 + + col1 * - col0 IS NOT NULL GROUP BY col1 HAVING NULL >= ( AVG ( + 23 ) )
----

query I rowsort
SELECT - 27 - + col1 + - col1 * 39 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( + 51 * 72 + - 43 ) <> NULL
----

query I rowsort
SELECT ALL col0 + 38 FROM tab0 cor0 GROUP BY col0
----
121
64
81

query I rowsort
SELECT + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col1 * - col1 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1936
-3249
-36

query II rowsort
SELECT DISTINCT + col2, col2 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT ( NULL IS NOT NULL ) )
----

query I rowsort
SELECT DISTINCT col2 + - + col2 FROM tab1 GROUP BY col2
----
0

onlyif mysql # DIV for integer division: 
query II rowsort label-3275
SELECT col0 * - col0 AS col0, col0 DIV 6 + - + col0 FROM tab0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-1849
-36
-676
-22
-6889
-70

skipif mysql # not compatible
query II rowsort label-3275
SELECT col0 * - col0 AS col0, col0 / 6 + - + col0 FROM tab0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-1849
-36
-676
-22
-6889
-70

query II rowsort
SELECT 61, col0 FROM tab2 GROUP BY col0
----
61
15
61
91
61
92

query I rowsort
SELECT ALL - ( - col0 ) + - col0 FROM tab2 GROUP BY col0, col0, col0 HAVING NOT - + AVG ( + col2 ) < NULL
----

query I rowsort
SELECT - col0 + + 12 * - col2 AS col1 FROM tab0 cor0 GROUP BY col2, col0
----
-331
-539
-974

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3279
SELECT ALL + + 46 * + + CAST( NULL AS DECIMAL ) * - 43, - 98 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
-98
NULL
-98
NULL
-98

skipif mysql # not compatible
query II rowsort label-3279
SELECT ALL + + 46 * + + CAST ( NULL AS REAL ) * - 43, - 98 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
-98
NULL
-98
NULL
-98

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3280
SELECT - col1 + + CAST( NULL AS DECIMAL ) AS col2 FROM tab1 cor0 GROUP BY col1 HAVING ( NOT ( NULL ) < + 48 + col1 )
----

skipif mysql # not compatible
query I rowsort label-3280
SELECT - col1 + + CAST ( NULL AS REAL ) AS col2 FROM tab1 cor0 GROUP BY col1 HAVING ( NOT ( NULL ) < + 48 + col1 )
----

query I rowsort
SELECT DISTINCT + col1 - - 59 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 27 + ( - col1 ) AS col2 FROM tab0 GROUP BY col1
----
-54
27

query I rowsort
SELECT + 96 - col1 FROM tab2 GROUP BY col1, col1
----
35
37
55

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT + 27 FROM tab2 cor0 GROUP BY col2, col2
----
27

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 19 col2 FROM tab2 AS cor0 GROUP BY col1
----
19
19
19

query I rowsort
SELECT + 74 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + ( col1 ) IS NULL
----
74
74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 17 col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND - 21
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3290
SELECT - ( - 38 ) DIV - col1 * - - ( - col0 ) AS col2 FROM tab2 GROUP BY col0, col0, col1 HAVING + 8 - 53 >= - col1
----
0
0

skipif mysql # not compatible
query I rowsort label-3290
SELECT - ( - 38 ) / - col1 * - - ( - col0 ) AS col2 FROM tab2 GROUP BY col0, col0, col1 HAVING + 8 - 53 >= - col1
----
0
0

query I rowsort
SELECT col2 - + 41 + - - col2 + - + col2 * - - col2 * 96 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-138589
-55289
-599019

query II rowsort
SELECT ALL col2 AS col0, col2 FROM tab1 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) >= col0 * + 93 GROUP BY col2, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3294
SELECT DISTINCT col2 + col2, + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT - 33 = - + col2 / 10 * - + 64 / - CAST( 42 AS SIGNED )
----
142
71
16
8
90
45

skipif mysql # not compatible
query II rowsort label-3294
SELECT DISTINCT col2 + col2, + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT - 33 = - + col2 / 10 * - + 64 / - CAST ( 42 AS INTEGER )
----
142
71
16
8
90
45

onlyif mysql # DIV for integer division: 
query II rowsort label-3295
SELECT DISTINCT - col2 DIV - + col2 AS col1, - col2 FROM tab0 GROUP BY col2
----
1
-24
1
-38
1
-79

skipif mysql # not compatible
query II rowsort label-3295
SELECT DISTINCT - col2 / - + col2 AS col1, - col2 FROM tab0 GROUP BY col2
----
1
-24
1
-38
1
-79

query I rowsort
SELECT 79 AS col1 FROM tab1 GROUP BY col0, col2
----
79
79
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3297
SELECT ALL - CAST( + 64 AS SIGNED ) FROM tab2 GROUP BY col0
----
-64
-64
-64

skipif mysql # not compatible
query I rowsort label-3297
SELECT ALL - CAST ( + 64 AS INTEGER ) FROM tab2 GROUP BY col0
----
-64
-64
-64

query I rowsort
SELECT DISTINCT col2 - + col2 FROM tab1 GROUP BY col2 HAVING col2 IS NOT NULL
----
0

query I rowsort
SELECT - col1 * + - COALESCE ( - - col1, 69 - + - col1 ) + col1 + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
6723

query I rowsort
SELECT 43 + 98 AS col2 FROM tab0 GROUP BY col1 HAVING ( NOT ( NOT col1 + - + col1 IS NOT NULL ) )
----
141
141

query I rowsort
SELECT 74 FROM tab2 AS cor0 GROUP BY col1
----
74
74
74

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3302
SELECT + col0 - + CAST( NULL AS SIGNED ) + + 38 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3302
SELECT + col0 - + CAST ( NULL AS INTEGER ) + + 38 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3303
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab1 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3303
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT col2 * + col0 AS col2 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT ( + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL + 3 FROM tab2 AS cor0 GROUP BY col1
----
3
3
3

query I rowsort
SELECT + 54 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
54
54
54

query I rowsort
SELECT ALL + 98 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
98
98
98

query I rowsort
SELECT + col0 + + - ( - col0 ) + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
273
276
45

query I rowsort
SELECT 22 FROM tab0 GROUP BY col1, col2
----
22
22
22

query I rowsort
SELECT + col2 * col2 * + + 53 FROM tab1 AS cor0 GROUP BY col2
----
107325
267173
3392

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL BETWEEN + col1 AND - col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3313
SELECT DISTINCT 45 + col2 DIV col0 FROM tab2 GROUP BY col2, col0
----
45
50

skipif mysql # not compatible
query I rowsort label-3313
SELECT DISTINCT 45 + col2 / col0 FROM tab2 GROUP BY col2, col0
----
45
50

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
22
28
82

onlyif mysql # CAST syntax: DECIMAL type: DIV for integer division: 
query II rowsort label-3316
SELECT DISTINCT - 0 DIV ( + col1 ), + col1 + - ( - col1 ) * + CAST( NULL AS DECIMAL ) * - 6 AS col1 FROM tab2 GROUP BY col1
----
0
NULL

skipif mysql # not compatible
query II rowsort label-3316
SELECT DISTINCT - 0 / ( + col1 ), + col1 + - ( - col1 ) * + CAST ( NULL AS REAL ) * - 6 AS col1 FROM tab2 GROUP BY col1
----
0
NULL

query I rowsort
SELECT ( - 28 ) + - col2 * ( - 71 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
3167
5013
540

onlyif mysql # DIV for integer division: 
query I rowsort label-3318
SELECT DISTINCT + 93 DIV col2 * - + col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-118
-122
-82

skipif mysql # not compatible
query I rowsort label-3318
SELECT DISTINCT + 93 / col2 * - + col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-118
-122
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-3319
SELECT - col0 DIV + ( 7 ) AS col1 FROM tab1 GROUP BY col0
----
-11
-3
-4

skipif mysql # not compatible
query I rowsort label-3319
SELECT - col0 / + ( 7 ) AS col1 FROM tab1 GROUP BY col0
----
-11
-3
-4

onlyif mysql # DIV for integer division: 
query I rowsort label-3320
SELECT ALL + 0 DIV 82 AS col0 FROM tab1 cor0 WHERE - col2 IS NOT NULL GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-3320
SELECT ALL + 0 / 82 AS col0 FROM tab1 cor0 WHERE - col2 IS NOT NULL GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 35 + + 11 * 43 col2 FROM tab0 AS cor0 GROUP BY col0
----
438
438
438

query I rowsort
SELECT ALL - + 95 FROM tab0 AS cor0 GROUP BY col0
----
-95
-95
-95

onlyif mysql # DIV for integer division: 
query I rowsort label-3323
SELECT + col2 DIV col0 * col2 * col0 col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
0
0
6525

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3323
SELECT + col2 / col0 * col2 * col0 col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
0
0
6525

query I rowsort
SELECT DISTINCT 36 FROM tab1 AS cor0 GROUP BY col2
----
36

query I rowsort
SELECT ALL + + col2 FROM tab2 cor0 GROUP BY col2, col1 HAVING + - ( col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT - + 58 FROM tab0 AS cor0 GROUP BY col0
----
-58

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT NULL = ( - + 70 ) * - 82
----

query I rowsort
SELECT + col1 + - + col1 FROM tab2 GROUP BY col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3329
SELECT + CAST( NULL AS SIGNED ) / + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3329
SELECT + CAST ( NULL AS INTEGER ) / + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + 3 FROM tab0 GROUP BY col1
----
3
3

query II rowsort
SELECT 85 * + - col2 + - 35, 21 + + + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-3860
66
-6070
92
-715
29

query II rowsort
SELECT DISTINCT NULLIF ( 10, col1 ), col1 FROM tab2 GROUP BY col1
----
10
41
10
59
10
61

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 30 * 26 * + col0 - - - col0 FROM tab2 GROUP BY col0 HAVING - + 59 IS NULL
----

query I rowsort
SELECT ALL 10 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
260
430
830

query I rowsort
SELECT - 44 FROM tab0 AS cor0 GROUP BY col1
----
-44
-44

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NULL <> + col2 - - - col0 + + 33 / - col0 * - - 88 * NULLIF ( col0, - col0 ) - + col1 + - - col1 * + col0
----

query I rowsort
SELECT col0 * + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col1 - - col1 FROM tab0 GROUP BY col0, col1
----
0
0
162

query I rowsort
SELECT DISTINCT + ( + - col2 ) + col0 * - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-492
-6795
-829

query I rowsort
SELECT - 81 + 29 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
-52
-52
-52

onlyif mysql # DIV for integer division: 
query I rowsort label-3343
SELECT col2 * col2 DIV + col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-3343
SELECT col2 * col2 / + col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL 27 AS col0 FROM tab2 GROUP BY col2
----
27
27
27

query I rowsort
SELECT ALL col1 + + + 31 FROM tab1 GROUP BY col1, col0 HAVING NOT + 61 - + col1 IS NULL
----
37
75
88

query I rowsort
SELECT ALL 69 * - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-5589
0
0

query I rowsort
SELECT DISTINCT 88 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
88

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( - col0 ) col0 FROM tab0 GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 78 col1 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-78
-78
-78

query I rowsort
SELECT DISTINCT col0 + col0 + - col0 + - - col0 * - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT ALL - col0 + - + col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT ALL col2 + + + col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL + col2 * - col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST( NULL AS SIGNED ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST ( NULL AS INTEGER ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3357
SELECT col0 FROM tab1 AS cor0 WHERE NOT + + col1 / + - col1 + - col2 + - NULLIF ( - + 86, NULLIF ( + - 6, - col1 + - ( col2 ) ) ) IS NOT NULL AND NOT col0 < + col1 * - - CAST( - - col0 AS SIGNED ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3357
SELECT col0 FROM tab1 AS cor0 WHERE NOT + + col1 / + - col1 + - col2 + - NULLIF ( - + 86, NULLIF ( + - 6, - col1 + - ( col2 ) ) ) IS NOT NULL AND NOT col0 < + col1 * - - CAST ( - - col0 AS INTEGER ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT 14 AS col1 FROM tab0 GROUP BY col2
----
14

query I rowsort
SELECT DISTINCT + col1 + - + col2 FROM tab0 cor0 GROUP BY col2, col1
----
-38
-79
57

query I rowsort
SELECT + - col2 * + + col2 * + col2 FROM tab2 cor0 GROUP BY col2, col0
----
-195112
-493039
-658503

query I rowsort
SELECT - 10 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-10
-10
-10

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col1 * + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query II rowsort
SELECT - col0, + col0 / ( 60 ) FROM tab2 AS cor0 WHERE NULL NOT BETWEEN NULL AND ( ( + col0 ) ) GROUP BY col1, col0
----

query I rowsort
SELECT ALL + 27 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - + 92 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3367
SELECT + CAST( NULL AS SIGNED ) + - 29 + - ( col1 ) * CAST( NULL AS SIGNED ) AS col2 FROM tab1 WHERE NOT ( + + col0 ) NOT IN ( - 32 ) GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-3367
SELECT + CAST ( NULL AS INTEGER ) + - 29 + - ( col1 ) * CAST ( NULL AS INTEGER ) AS col2 FROM tab1 WHERE NOT ( + + col0 ) NOT IN ( - 32 ) GROUP BY col1, col1
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 29 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL = + 69
----

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT ( + col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3373
SELECT - col1 + + CAST( NULL AS SIGNED ) + - CAST( 21 AS SIGNED ) * 15 / - 32 - + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3373
SELECT - col1 + + CAST ( NULL AS INTEGER ) + - CAST ( 21 AS INTEGER ) * 15 / - 32 - + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3374
SELECT ALL COALESCE ( + col0, + col2 * - ( - 30 ), - 52 * + col2 - + + col0 + + + 24 ) FROM tab1 AS cor0 WHERE NOT NULL = NULL GROUP BY col0, col2 HAVING - CAST( - 35 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3374
SELECT ALL COALESCE ( + col0, + col2 * - ( - 30 ), - 52 * + col2 - + + col0 + + + 24 ) FROM tab1 AS cor0 WHERE NOT NULL = NULL GROUP BY col0, col2 HAVING - CAST ( - 35 AS INTEGER ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST( 60 AS SIGNED ) / - CAST( - col1 AS SIGNED ) AND + 12
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST ( 60 AS INTEGER ) / - CAST ( - col1 AS INTEGER ) AND + 12
----

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-3376
SELECT ALL + col2 + + 38, - col2, + 67 col2 FROM tab0 WHERE NOT ( - + 61 ) <> - CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) GROUP BY col2 HAVING ( + col2 ) = - 86
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-3376
SELECT ALL + col2 + + 38, - col2, + 67 col2 FROM tab0 WHERE NOT ( - + 61 ) <> - CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER ) GROUP BY col2 HAVING ( + col2 ) = - 86
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3377
SELECT ALL + col0 FROM tab2 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0, col0 HAVING NOT col0 < + - CAST( NULL AS SIGNED ) * - col0
----

skipif mysql # not compatible
query I rowsort label-3377
SELECT ALL + col0 FROM tab2 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0, col0 HAVING NOT col0 < + - CAST ( NULL AS INTEGER ) * - col0
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-3378
SELECT DISTINCT + col1 DIV + col1 - + + 38 + - col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL OR col1 <> - - CAST( NULL AS SIGNED )
----
-43
-81
-94

skipif mysql # not compatible
query I rowsort label-3378
SELECT DISTINCT + col1 / + col1 - + + 38 + - col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL OR col1 <> - - CAST ( NULL AS INTEGER )
----
-43
-81
-94

query I rowsort
SELECT - 70 / - col1 + - ( col2 ) AS col2 FROM tab2 WHERE 6 IS NULL GROUP BY col2, col1 HAVING - col2 NOT BETWEEN NULL AND - - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3380
SELECT ALL + + CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3380
SELECT ALL + + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + NULLIF ( + col0, 93 ) + + 83 FROM tab0 GROUP BY col0
----
109
126
166

query I rowsort
SELECT 56 FROM tab0 GROUP BY col2
----
56
56
56

query I rowsort
SELECT DISTINCT + 26 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
26

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab0 AS cor0 WHERE + 16 <> - + 92 * + - col0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col2 + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT ALL 42 FROM tab1 GROUP BY col2
----
42
42
42

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 73 col1 FROM tab2 GROUP BY col2
----
73

query I rowsort
SELECT ALL - 18 * + col2 * col1 * - 66 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + col1 IS NOT NULL
----
3047220
3711312
57024

query I rowsort
SELECT - + 40 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL > - col0
----

query I rowsort
SELECT ALL - - 40 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1 + 6, 81 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) = 59
----

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT NULL NOT BETWEEN NULL AND - 21 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - 13 FROM tab1 AS cor0 GROUP BY col1
----
-13

query I rowsort
SELECT - 46 - + ( + - 47 ) FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3396
SELECT + - CAST( NULL AS SIGNED ) / - col2 AS col2 FROM tab1 cor0 GROUP BY col1, col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3396
SELECT + - CAST ( NULL AS INTEGER ) / - col2 AS col2 FROM tab1 cor0 GROUP BY col1, col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col0 * + 68 FROM tab0 GROUP BY col0
----
-1768
-2924
-5644

onlyif mysql # DIV for integer division: 
query I rowsort label-3398
SELECT 68 * 65 + - 81 DIV col0 FROM tab1 GROUP BY col2, col0, col2
----
4417
4418
4420

skipif mysql # not compatible
query I rowsort label-3398
SELECT 68 * 65 + - 81 / col0 FROM tab1 GROUP BY col2, col0, col2
----
4417
4418
4420

query I rowsort
SELECT - 68 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3400
SELECT ALL + 66 * CAST( col1 AS DECIMAL ) FROM tab0 GROUP BY col1 HAVING col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-3400
SELECT ALL + 66 * CAST ( col1 AS REAL ) FROM tab0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT - col0 * 88 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 48 FROM tab1 AS cor0 GROUP BY col2
----
-48
-48
-48

query II rowsort
SELECT - 20, col1 AS col2 FROM tab2 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT - 89 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-89

query I rowsort
SELECT DISTINCT - 97 FROM tab0 GROUP BY col1
----
-97

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL > - + ( - col2 )
----

query II rowsort
SELECT - - col1 * col2 + - 3 * + col2 AS col1, - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
24
-8
2430
-45
2911
-71

query I rowsort
SELECT DISTINCT + ( + col1 ) + - NULLIF ( + col0, + + col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
-32
-51
46

query I rowsort
SELECT ALL + 46 FROM tab1 GROUP BY col2
----
46
46
46

query I rowsort
SELECT - 13 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-13
-13
-13

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + 51 >= - col1
----

query I rowsort
SELECT ALL - - col0 + - - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT ALL ( col1 ) + - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - 84 FROM tab2 GROUP BY col1
----
-84
-84
-84

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 AS cor0 WHERE col1 + col0 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT + 33 FROM tab2 AS cor0 GROUP BY col2, col2
----
33
33
33

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3417
SELECT + col1 * - col2 + + + CAST( NULL AS DECIMAL ) * - + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3417
SELECT + col1 * - col2 + + + CAST ( NULL AS REAL ) * - + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 - + - col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT - 93 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-93
-93
-93

onlyif mysql # DIV for integer division: 
query I rowsort label-3420
SELECT DISTINCT - col0 DIV + ( col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-3420
SELECT DISTINCT - col0 / + ( col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING - - 51 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT - col1 + - 26 + - col1 + - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-158
-197
-44

query I rowsort
SELECT ALL + col2 * - - 83 - - 19 AS col2 FROM tab0 cor0 GROUP BY col2
----
2011
3173
6576

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3424
SELECT - CAST( NULL AS DECIMAL ) * - col0 * - 70 AS col1 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3424
SELECT - CAST ( NULL AS REAL ) * - col0 * - 70 AS col1 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 92 AS col2 FROM tab2 GROUP BY col1
----
92

query I rowsort
SELECT - 37 + - col2 AS col0 FROM tab2 GROUP BY col2
----
-116
-124
-95

query I rowsort
SELECT DISTINCT + ( + col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT col1 + - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT DISTINCT + 96 AS col0 FROM tab2 GROUP BY col0
----
96

query I rowsort
SELECT ALL ( col2 ) - col2 FROM tab2 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col1, col2, col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3433
SELECT ALL - CAST( NULL AS SIGNED ) + + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + + 61 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3433
SELECT ALL - CAST ( NULL AS INTEGER ) + + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + + 61 IS NOT NULL
----

query I rowsort
SELECT ALL 29 + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
112
55
72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3435
SELECT col1 FROM tab0 AS cor0 WHERE col2 <> - - CAST( NULL AS SIGNED ) + - 89 GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-3435
SELECT col1 FROM tab0 AS cor0 WHERE col2 <> - - CAST ( NULL AS INTEGER ) + - 89 GROUP BY col1, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3436
SELECT ALL + - 12 DIV col1 * 56 DIV 94 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-3436
SELECT ALL + - 12 / col1 * 56 / 94 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1
0
0

query I rowsort
SELECT ALL 9 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT col2 <= 53
----
9
9
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 64 - - - col0 - + 88 col2 FROM tab1 GROUP BY col0
----
-174
-180
-234

onlyif mysql # DIV for integer division: 
query I rowsort label-3439
SELECT DISTINCT 6 DIV + 26 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0

skipif mysql # not compatible
query I rowsort label-3439
SELECT DISTINCT 6 / + 26 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT 10 FROM tab2 GROUP BY col0 HAVING + 67 - - 34 IS NOT NULL
----
10
10
10

query I rowsort
SELECT ALL + 24 / - ( - + col0 ) * + 48 AS col2 FROM tab2 GROUP BY col0 HAVING ( NOT + 62 IS NOT NULL )
----

query II rowsort
SELECT DISTINCT - col0 + 55, + col0 + 10 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-28
93
12
53
29
36

query I rowsort
SELECT ALL - 79 FROM tab0 AS cor0 GROUP BY col0, col2
----
-79
-79
-79

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE - col0 BETWEEN NULL AND col1 GROUP BY col1, col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + CASE - 56 WHEN + 63 THEN col2 * + 96 * col1 / + - 84 / + - col2 + + col1 ELSE NULL END AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT 81 - 28 AS col2 FROM tab2 GROUP BY col2, col0
----
53
53
53

query I rowsort
SELECT DISTINCT - - col0 + col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
506
6806
812

query I rowsort
SELECT + 66 * - col1 * - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
433026

query I rowsort
SELECT - col2 + - 82 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) <> NULL GROUP BY col0, col2 HAVING col2 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3450
SELECT + 19 DIV + - col0 + + col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-3450
SELECT + 19 / + - col0 + + col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query II rowsort label-3451
SELECT DISTINCT - col1, col1 DIV 14 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
3
-57
4
-6
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3451
SELECT DISTINCT - col1, col1 / 14 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
3
-57
4
-6
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL NULLIF ( + + col0, col0 ) * - + COALESCE ( - ( 87 ), + 48, col1 ) * - - 56 * 91 col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + + 36 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
118
58
64

query II rowsort
SELECT + + col2 * + + col2 + + - col2, + 40 AS col1 FROM tab0 AS cor0 WHERE col1 IS NOT NULL GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
1406
40
552
40
6162
40

query I rowsort
SELECT - 47 FROM tab1 WHERE NOT NULL <> + - col0 * - ( + col1 ) * + + col0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 + - col0 + + 19 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) <> - 23
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 66 col2 FROM tab2 GROUP BY col2
----
-66

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - 20 col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-20

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3461
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3461
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT DISTINCT - 89 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + 99 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL AND NOT 43 IS NULL
----
99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3464
SELECT DISTINCT + 81 AS col1 FROM tab1 WHERE ( NOT + 58 + + col2 IS NULL ) GROUP BY col0 HAVING ( CAST( + col0 AS SIGNED ) ) + - col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-3464
SELECT DISTINCT + 81 AS col1 FROM tab1 WHERE ( NOT + 58 + + col2 IS NULL ) GROUP BY col0 HAVING ( CAST ( + col0 AS INTEGER ) ) + - col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( - 94 ) * col0 col0 FROM tab0 GROUP BY col0, col0
----
2444
4042
7802

query I rowsort
SELECT col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) > ( NULL )
----

onlyif mysql # DIV for integer division: 
query II rowsort label-3467
SELECT 7 DIV + col2 + col2, 21 AS col1 FROM tab0 GROUP BY col2
----
24
21
38
21
79
21

skipif mysql # not compatible
query II rowsort label-3467
SELECT 7 / + col2 + col2, 21 AS col1 FROM tab0 GROUP BY col2
----
24
21
38
21
79
21

query I rowsort
SELECT 42 + + 94 + + + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
151
227
228

query I rowsort
SELECT ALL + + 45 - + + col1 + + - col1 + + - col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL >= ( + ( + ( + 88 ) ) )
----

query I rowsort
SELECT DISTINCT + col1 + + - col1 AS col0 FROM tab2 WHERE + - 7 - - col2 IN ( + col0, + 29 ) GROUP BY col1 HAVING - 56 < ( col1 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3471
SELECT DISTINCT - - col2 + - + 23 DIV col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-3471
SELECT DISTINCT - - col2 + - + 23 / col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT 78 AS col2 FROM tab0 GROUP BY col0
----
78
78
78

query I rowsort
SELECT ALL 35 FROM tab1 GROUP BY col2
----
35
35
35

query II rowsort
SELECT col1 AS col0, - 17 FROM tab2 GROUP BY col1
----
41
-17
59
-17
61
-17

query I rowsort
SELECT ALL - 12 FROM tab1 AS cor0 GROUP BY col0, col1
----
-12
-12
-12

query I rowsort
SELECT DISTINCT - col1 * 88 FROM tab2 AS cor0 GROUP BY col0, col1
----
-3608
-5192
-5368

query I rowsort
SELECT 48 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT 98 AS col2 FROM tab1 GROUP BY col1
----
98
98
98

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3480
SELECT - 32 + - CAST( NULL AS SIGNED ) * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3480
SELECT - 32 + - CAST ( NULL AS INTEGER ) * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - ( - - 74 ) IS NOT NULL
----

query I rowsort
SELECT ( col0 ) - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3483
SELECT - 55 * + col1 FROM tab2 AS cor0 WHERE NOT NULL < + CAST( NULL AS SIGNED ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-3483
SELECT - 55 * + col1 FROM tab2 AS cor0 WHERE NOT NULL < + CAST ( NULL AS INTEGER ) GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3484
SELECT + + col2 DIV - col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
44
7
70

skipif mysql # not compatible
query I rowsort label-3484
SELECT + + col2 / - col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
44
7
70

query I rowsort
SELECT ALL + col2 + - 51 FROM tab2 AS cor0 WHERE NOT col0 / + col0 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col1 + + col1 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
0
0
0

query II rowsort
SELECT DISTINCT - col0 AS col1, - ( + - col0 ) AS col2 FROM tab0 GROUP BY col0, col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT 21 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
21
21
21

query I rowsort
SELECT + col1 + col1 FROM tab0 AS cor0 WHERE NOT NULL BETWEEN col0 AND + 4 + - 14 * + col1 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 71 * + - 56 col0 FROM tab0 GROUP BY col1
----
-3976
-3976

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3492
SELECT DISTINCT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) = NULL
----

skipif mysql # not compatible
query I rowsort label-3492
SELECT DISTINCT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - col2 * 52 - + 91 AS col2 FROM tab0 GROUP BY col2, col1
----
-1339
-2067
-4199

query I rowsort
SELECT + col0 + - 3 * - + col0 + + 34 AS col1 FROM tab1 GROUP BY col1, col0 HAVING ( col1 / col1 ) IS NOT NULL
----
122
146
362

query I rowsort
SELECT - col0 + - - 20 * - + col0 * 25 * + col2 - 72 FROM tab1 GROUP BY col2, col0 HAVING - AVG ( DISTINCT 59 ) NOT BETWEEN 36 AND - col0 + - 57 * col0
----
-2911154
-630100
-88094

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 96 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( ( + 29 ) )
----

query II rowsort
SELECT - 76, - col2 * 68 + 91 AS col2 FROM tab1 GROUP BY col1, col2
----
-76
-2969
-76
-453
-76
-4737

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 79 FROM tab0 AS cor0 GROUP BY col0
----
79

query I rowsort
SELECT ALL + + col2 * + 57 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - AVG ( col1 ) IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col0 + 74, + col0 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NULL
----
-8
82
46
28
52
22

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3503
SELECT - CAST( NULL AS SIGNED ) AS col2, - ( col0 ) + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND 25
----

skipif mysql # not compatible
query II rowsort label-3503
SELECT - CAST ( NULL AS INTEGER ) AS col2, - ( col0 ) + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND 25
----

query I rowsort
SELECT + col2 + - col2 + + ( + - 19 ) + - - col2 FROM tab1 GROUP BY col2
----
-11
26
52

query I rowsort
SELECT 64 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
64
64
64

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3506
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - 31 * CAST( NULL AS DECIMAL ) IS NOT NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-3506
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - 31 * CAST ( NULL AS REAL ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + - 10 + 84 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
74

query I rowsort
SELECT ALL ( + col1 ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL AND + col1 <= NULL
----

query I rowsort
SELECT 84 FROM tab2 GROUP BY col1, col0
----
84
84
84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 16 col2 FROM tab2 GROUP BY col0
----
16
16
16

query I rowsort
SELECT DISTINCT 69 FROM tab0 GROUP BY col1, col0 HAVING + col1 <= ( + - 72 )
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( - 22 + + AVG ( ALL - col2 ) IS NULL )
----

query I rowsort
SELECT ALL - 70 AS col2 FROM tab1 GROUP BY col0, col0
----
-70
-70
-70

query I rowsort
SELECT DISTINCT - 23 AS col0 FROM tab1 GROUP BY col1
----
-23

query I rowsort
SELECT DISTINCT col1 * 58 FROM tab2 GROUP BY col1, col1 HAVING + col1 < NULL
----

query I rowsort
SELECT + 48 * + 47 FROM tab1 AS cor0 GROUP BY col1
----
2256
2256
2256

onlyif mysql # DIV for integer division: 
query I rowsort label-3517
SELECT + col2 DIV 2 DIV col2 * - col2 - 15 + - + ( + col2 ) + + col2 + - - col2 * + col2 * 97 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
196410
488962
6193

skipif mysql # not compatible
query I rowsort label-3517
SELECT + col2 / 2 / col2 * - col2 - 15 + - + ( + col2 ) + + col2 + - - col2 * + col2 * 97 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
196410
488962
6193

query I rowsort
SELECT DISTINCT + col0 + col0 FROM tab1 GROUP BY col0
----
164
44
56

query II rowsort
SELECT - col1, - col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
-44
-44
-57
-57
-6
-6

query I rowsort
SELECT + col2 * col1 * col1 FROM tab2 GROUP BY col2, col1 HAVING - ( + col1 ) IS NOT NULL
----
274999
323727
97498

query I rowsort
SELECT col2 + - 98 FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING NOT - col2 * + col2 BETWEEN NULL AND 91
----

query I rowsort
SELECT DISTINCT - 19 - col0 FROM tab2 GROUP BY col0 HAVING col0 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST( + col0 AS SIGNED ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST ( + col0 AS INTEGER ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

query II rowsort
SELECT + col2 AS col2, - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
-24
38
-38
79
-79

query II rowsort
SELECT DISTINCT + 42 * - 96 AS col1, col0 AS col1 FROM tab1 GROUP BY col1, col0
----
-4032
22
-4032
28
-4032
82

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE NOT col1 * + col1 IS NULL GROUP BY col2, col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col2 + col2 * - + 5 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-256
-383
-507

query I rowsort
SELECT + col1 + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT - 80 IS NULL
----
22
28
82

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 WHERE NOT col0 * + col2 * - 8 <> - col1 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 * - + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL col0 * - 1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT 15 + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 * + col1 IS NOT NULL
----

query I rowsort
SELECT col2 * - + col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query II rowsort
SELECT DISTINCT - col1 AS col1, + 52 + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
11
-59
-7
-61
-9

query I rowsort
SELECT 61 / CASE + col0 WHEN - col0 THEN 59 + + col0 WHEN + - 42 - - + 60 / + col0 THEN NULL ELSE NULL END - + - col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT col2 + + col1 FROM tab2 GROUP BY col1, col2
----
138
148
99

query I rowsort
SELECT - - col1 AS col1 FROM tab1 WHERE - col1 < - col1 * + 6 GROUP BY col1, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3539
SELECT - 24 * + + ( col1 ) + col1, col2 + 52 + + 99 FROM tab0 GROUP BY col2, col1 HAVING CAST( 84 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-3539
SELECT - 24 * + + ( col1 ) + col1, col2 + 52 + + 99 FROM tab0 GROUP BY col2, col1 HAVING CAST ( 84 AS INTEGER ) IS NULL
----

query I rowsort
SELECT - 43 * + 77 AS col2 FROM tab2 GROUP BY col2, col1
----
-3311
-3311
-3311

query I rowsort
SELECT - col0 + col1 AS col2 FROM tab1 GROUP BY col2, col0, col1
----
-16
-38
29

query I rowsort
SELECT + 4 * - col1 * - - 33 + + + col0 + + + CASE col1 WHEN - - 39 THEN - col1 * + col1 END AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT 52 + - + col0 FROM tab2 GROUP BY col0, col0
----
-39
-40
37

query I rowsort
SELECT col2 + - + col2 FROM tab0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT 51 FROM tab1 GROUP BY col2
----
51
51
51

query I rowsort
SELECT DISTINCT 22 FROM tab1 GROUP BY col0 HAVING NOT col0 BETWEEN - + 37 AND + + 78
----
22

onlyif mysql # DIV for integer division: 
query I rowsort label-3547
SELECT ALL + - col0 + + col0 DIV col0 FROM tab1 AS cor0 GROUP BY col0
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-3547
SELECT ALL + - col0 + + col0 / col0 FROM tab1 AS cor0 GROUP BY col0
----
-21
-27
-81

query I rowsort
SELECT DISTINCT 66 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
66

onlyif mysql # DIV for integer division: 
query II rowsort label-3549
SELECT DISTINCT - + col2 + - ( col2 ) DIV + col2, col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-59
58
-80
79
-88
87

skipif mysql # not compatible
query II rowsort label-3549
SELECT DISTINCT - + col2 + - ( col2 ) / + col2, col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-59
58
-80
79
-88
87

query I rowsort
SELECT ALL col2 / - + col2 FROM tab2 WHERE NOT 42 IS NOT NULL GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 95 - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
16
37
8

query I rowsort
SELECT DISTINCT + + 58 + + - 63 * + ( + 59 ) AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-3659

query I rowsort
SELECT - 79 + - col1 AS col0 FROM tab0 GROUP BY col1, col1
----
-160
-79

query II rowsort
SELECT - 87, col2 AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 35 AS col1 FROM tab2 GROUP BY col0, col0
----
35
35
35

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3556
SELECT + CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3556
SELECT + CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1 HAVING NOT + + 74 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 * + 17 * col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-32912
-55233
-612

query II rowsort
SELECT - col0 AS col0, - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT col1 - + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
0

query II rowsort
SELECT ALL - col1 * col1 AS col0, 27 * 91 FROM tab0 cor0 GROUP BY col1
----
-6561
2457
0
2457

query I rowsort
SELECT DISTINCT + col0 + - col0 + + - col0 AS col0 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT 37 FROM tab2 AS cor0 GROUP BY col2, col0
----
37

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL NOT IN ( 16, 46 )
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL + 64 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
64
64
64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 * - + COALESCE ( + 81, + col2, - + col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( + + ( - 67 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3568
SELECT DISTINCT col2, + col2 AS col1 FROM tab1 AS cor0 WHERE + col2 * - - col2 <= - CAST( col1 AS SIGNED ) GROUP BY col2, col1 HAVING NOT + col1 IS NULL
----

skipif mysql # not compatible
query II rowsort label-3568
SELECT DISTINCT col2, + col2 AS col1 FROM tab1 AS cor0 WHERE + col2 * - - col2 <= - CAST ( col1 AS INTEGER ) GROUP BY col2, col1 HAVING NOT + col1 IS NULL
----

query I rowsort
SELECT - + col1 FROM tab1 WHERE - col2 * + col1 - - 14 + 88 + col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT - col1 * + col1 + - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-1722
-3540
-3782

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab2 AS cor0 WHERE ( - col0 / + ( - - col2 ) * - 13 ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT ( col0 ) * + ( col2 ) FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col1, col2 HAVING NULL = - - 90 - + 4 * - - 78
----

query II rowsort
SELECT ALL + + col2 AS col0, col2 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT - - COALESCE ( - 5, - col2, - - col2 ) FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + - col1 IS NOT NULL
----
-5

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + 80 AS col2 FROM tab0 GROUP BY col0 HAVING NULL <> + col0 / + + col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3579
SELECT + 50 + - col0 FROM tab1 GROUP BY col0 HAVING NOT + CAST( NULL AS SIGNED ) NOT IN ( + - 8 )
----

skipif mysql # not compatible
query I rowsort label-3579
SELECT + 50 + - col0 FROM tab1 GROUP BY col0 HAVING NOT + CAST ( NULL AS INTEGER ) NOT IN ( + - 8 )
----

query I rowsort
SELECT - + 90 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col1, col2 HAVING NULL IS NULL
----
-90
-90
-90

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING - col1 + + + col1 IS NULL
----

query II rowsort
SELECT col2 + + col2 + + + 23, col2 FROM tab1 AS cor0 WHERE ( col0 ) IS NULL GROUP BY col2 HAVING NOT + col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3583
SELECT - + 57 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - 27 * - ( col2 ) + - 26 <= CAST( - col1 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3583
SELECT - + 57 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - 27 * - ( col2 ) + - 26 <= CAST ( - col1 AS INTEGER )
----

query I rowsort
SELECT DISTINCT + col2 / col2 FROM tab2 GROUP BY col0, col2 HAVING + ( - - 3 ) < col2 * - 10 + - 91 + - 38
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * - col0 * + 9 + + col0 + + 22 col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL 37 AS col1 FROM tab0 GROUP BY col0, col2
----
37
37
37

query I rowsort
SELECT - 90 + - - 4 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-86
-86
-86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3588
SELECT col2 * + col2 + NULLIF ( - col2, col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT CAST( - ( + - col0 ) AS SIGNED ) * - col1 - + ( - 1 ) - - - 19 * col0 + ( - ( + col2 ) ) NOT IN ( + 87 ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3588
SELECT col2 * + col2 + NULLIF ( - col2, col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT CAST ( - ( + - col0 ) AS INTEGER ) * - col1 - + ( - 1 ) - - - 19 * col0 + ( - ( + col2 ) ) NOT IN ( + 87 ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 WHERE NOT ( 83 ) = col1 GROUP BY col0, col1 HAVING ( NULL ) IN ( col2 * 39 )
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 WHERE NOT + NULLIF ( col2, col2 ) + col2 <= NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3591
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-3591
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT + ( + col1 ) * 51 FROM tab1 cor0 GROUP BY col1, col1
----
2244
2907
306

query I rowsort
SELECT 28 + + + 25 AS col0 FROM tab1 GROUP BY col0, col1
----
53
53
53

query I rowsort
SELECT ALL 57 * + 79 AS col1 FROM tab0 GROUP BY col2
----
4503
4503
4503

query I rowsort
SELECT + col0 * 70 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
1050
6370
6440

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE col1 IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + CASE + col0 WHEN + ( + 85 ) THEN + 54 WHEN + col1 THEN 0 END FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - - 4 - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= + 5
----

query I rowsort
SELECT + 13 FROM tab2 AS cor0 GROUP BY col1, col0
----
13
13
13

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3600
SELECT ALL - ( + + CAST( NULL AS SIGNED ) ) * - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-3600
SELECT ALL - ( + + CAST ( NULL AS INTEGER ) ) * - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ( - col0 ) + col0 FROM tab0 AS cor0 WHERE NOT ( col1 ) BETWEEN NULL AND + col2 * col1 + col1 * ( 69 ) GROUP BY col0, col0, col0 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT ALL - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3603
SELECT DISTINCT + CAST( NULL AS DECIMAL ) * - col0 AS col0 FROM tab0 WHERE + col0 <> col2 GROUP BY col2, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-3603
SELECT DISTINCT + CAST ( NULL AS REAL ) * - col0 AS col0 FROM tab0 WHERE + col0 <> col2 GROUP BY col2, col0
----
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-3604
SELECT ALL + col0 DIV col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3604
SELECT ALL + col0 / col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT + 78 * + col2 AS col2 FROM tab1 GROUP BY col2, col2 HAVING - col2 IS NOT NULL
----
3510
5538
624

query I rowsort
SELECT ALL 98 FROM tab0 AS cor0 GROUP BY col1, col0
----
98
98
98

query I rowsort
SELECT col1 FROM tab0 WHERE NOT col2 * - - 93 + COALESCE ( 87, ( - col0 ) * col0 ) NOT IN ( + col2 * col1 ) GROUP BY col1
----

query I rowsort
SELECT 30 FROM tab2 GROUP BY col1 HAVING NOT ( + + col1 ) IS NULL
----
30
30
30

query I rowsort
SELECT ALL + + 36 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
36
36
36

query I rowsort
SELECT + col0 * + col0 * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-17576
-571787
-79507

query I rowsort
SELECT col2 + + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
142
16
90

query I rowsort
SELECT DISTINCT 60 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
60

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + + AVG ( DISTINCT 13 ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL + 57 FROM tab0 GROUP BY col0
----
57
57
57

query I rowsort
SELECT ALL + - 29 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-29
-29
-29

query I rowsort
SELECT ( + 69 ) FROM tab1 AS cor0 GROUP BY col2, col2
----
69
69
69

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col1, col2, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 57 col2 FROM tab0 GROUP BY col2, col0
----
57
57
57

query I rowsort
SELECT ALL + col1 / + col1 + + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT - 61 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 26 FROM tab2 GROUP BY col0
----
26

query I rowsort
SELECT ALL - col2 - col0 AS col0 FROM tab1 GROUP BY col2, col0, col0 HAVING ( NULL ) IS NULL
----
-153
-30
-73

query I rowsort
SELECT ALL + ( ( 14 ) ) FROM tab1 GROUP BY col0, col0
----
14
14
14

query I rowsort
SELECT DISTINCT 34 AS col2 FROM tab1 WHERE ( col1 ) = NULL GROUP BY col1, col1
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2 HAVING ( - 34 ) NOT IN ( - 40 / col2 )
----
-81
0
0

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3626
SELECT + col0 DIV col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT - 2 + col0 < + 84 * col1 - + col1
----
1
1

skipif mysql # not compatible
query I rowsort label-3626
SELECT + col0 / col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT - 2 + col0 < + 84 * col1 - + col1
----
1
1

query I rowsort
SELECT + col0 FROM tab0 WHERE - col0 * col1 < 71 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - 16 + - col1 * col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1952
-3265
-52

query I rowsort
SELECT + 82 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING - col0 NOT IN ( 87 )
----
82
82
82

query I rowsort
SELECT - col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3631
SELECT col2 * CAST( NULL AS SIGNED ) col0 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND ( - 53 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3631
SELECT col2 * CAST ( NULL AS INTEGER ) col0 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND ( - 53 )
----

query I rowsort
SELECT - 50 FROM tab1 GROUP BY col0
----
-50
-50
-50

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * + col2 * - col2 col0 FROM tab1 cor0 GROUP BY col2
----
-357911
-512
-91125

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT 54 FROM tab2 AS cor0 GROUP BY col0
----
54
54
54

query I rowsort
SELECT + 28 FROM tab2 GROUP BY col0, col1
----
28
28
28

query I rowsort
SELECT 17 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
17
17
17

query I rowsort
SELECT + + 47 + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-44
-45
32

onlyif mysql # DIV for integer division: 
query I rowsort label-3639
SELECT - 16 DIV + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-3639
SELECT - 16 / + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + 62 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3641
SELECT col1 * - ( col0 ) * - CAST( + - col0 AS SIGNED ) - + col0 + CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) AS col2 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3641
SELECT col1 * - ( col0 ) * - CAST ( + - col0 AS INTEGER ) - + col0 + CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER ) AS col2 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 AS col1 FROM tab1 WHERE - + col2 > - col1 + - + 74 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 * + - 1 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-3644
SELECT 49 DIV - 26 - + col0 FROM tab2 GROUP BY col0
----
-16
-92
-93

skipif mysql # not compatible
query I rowsort label-3644
SELECT 49 / - 26 - + col0 FROM tab2 GROUP BY col0
----
-16
-92
-93

query I rowsort
SELECT + col2 * - 52 + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - - col0 * + - 17 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-1547
-1564
-255

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 * + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT 59 FROM tab0 AS cor0 GROUP BY col2
----
59
59
59

query I rowsort
SELECT 80 AS col0 FROM tab0 AS cor0 WHERE NULL IN ( col2 * col2 ) GROUP BY col0
----

query I rowsort
SELECT - 84 - - col0 FROM tab1 GROUP BY col0, col2
----
-2
-56
-62

query II rowsort
SELECT + col2 AS col1, col2 AS col1 FROM tab2 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col2, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - col1 col1, + col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) = - col0 GROUP BY col1
----

query I rowsort
SELECT col1 - - 79 + col1 FROM tab1 AS cor0 GROUP BY col1
----
167
193
91

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3656
SELECT ALL CAST( NULL AS SIGNED ) * - col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3656
SELECT ALL CAST ( NULL AS INTEGER ) * - col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col2 HAVING - col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT 4 AS col2 FROM tab2 GROUP BY col0
----
4
4
4

query I rowsort
SELECT col0 AS col1 FROM tab2 WHERE NULL > NULL GROUP BY col2, col0, col0
----

query I rowsort
SELECT DISTINCT + - 86 * col1 + + 26 * - - col1 + - col1 FROM tab2 WHERE NULL > NULL GROUP BY col0, col2, col1
----

query II rowsort
SELECT DISTINCT + ( col2 ) AS col0, col2 / + col2 FROM tab1 AS cor0 WHERE col1 IS NOT NULL GROUP BY col2, col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL NULLIF ( col0, - 30 ) FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-3664
SELECT DISTINCT + CAST( + + 56 AS SIGNED ) + - - ( col2 ) - - + col2 * - - col2 DIV + ( - + col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
56

skipif mysql # not compatible
query I rowsort label-3664
SELECT DISTINCT + CAST ( + + 56 AS INTEGER ) + - - ( col2 ) - - + col2 * - - col2 / + ( - + col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
56

query I rowsort
SELECT DISTINCT col0 * + + col0 - - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3667
SELECT 80 AS col2 FROM tab0 AS cor0 WHERE NOT + col2 < 43 GROUP BY col0 HAVING CAST( NULL AS SIGNED ) * + - 52 = + 8
----

skipif mysql # not compatible
query I rowsort label-3667
SELECT 80 AS col2 FROM tab0 AS cor0 WHERE NOT + col2 < 43 GROUP BY col0 HAVING CAST ( NULL AS INTEGER ) * + - 52 = + 8
----

query I rowsort
SELECT 27 FROM tab1 GROUP BY col2, col1
----
27
27
27

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col0 * - col1 * - - ( + + col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
149769

query I rowsort
SELECT col0 * - ( + + ( - col2 ) ) + + + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
1075
2080
3237

query I rowsort
SELECT DISTINCT + 32 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
32

query I rowsort
SELECT ALL - - 37 FROM tab2 AS cor0 WHERE - col2 + col2 + + 0 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 * col0 - + + 80 FROM tab1 AS cor0 WHERE col2 NOT IN ( + col2 ) GROUP BY col0
----

query II rowsort
SELECT DISTINCT col0 AS col1, - ( + col0 ) FROM tab2 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT DISTINCT - 87 FROM tab0 WHERE ( + + col2 ) + ( - + col1 ) < col1 GROUP BY col2
----
-87

query I rowsort
SELECT + 83 + - col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
83
83
83

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE NOT + 70 IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3680
SELECT ALL - CAST( NULL AS SIGNED ) + ( + col2 ) + + ( + 28 ) FROM tab2 GROUP BY col1, col2, col1 HAVING NOT - 73 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3680
SELECT ALL - CAST ( NULL AS INTEGER ) + ( + col2 ) + + ( + 28 ) FROM tab2 GROUP BY col1, col2, col1 HAVING NOT - 73 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT 29 FROM tab1 AS cor0 GROUP BY col0 HAVING - AVG ( DISTINCT + col1 ) <> ( + + 20 )
----
29
29
29

query I rowsort
SELECT DISTINCT - col1 * col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT ( - + col1 ) AS col1 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-3685
SELECT DISTINCT 61 DIV 56 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
1
82

skipif mysql # not compatible
query I rowsort label-3685
SELECT DISTINCT 61 / 56 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
1
82

query I rowsort
SELECT 58 / col0 - - col0 - col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3687
SELECT + + col0 * col0 / + CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3687
SELECT + + col0 * col0 / + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 * + + col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING 89 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL - col1 * - col0 * col0 + - - 46 * + - col0 FROM tab1 GROUP BY col0, col1
----
1892
292084
43400

query I rowsort
SELECT + 18 AS col2 FROM tab2 GROUP BY col1, col1
----
18
18
18

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL 12 * - + col2 * 38 FROM tab0 GROUP BY col2, col0, col1
----
-10944
-17328
-36024

query I rowsort
SELECT + col2 + + NULLIF ( + col2, col2 * - 64 ) AS col1 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL + - 34 FROM tab1 AS cor0 GROUP BY col0
----
-34
-34
-34

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3696
SELECT DISTINCT - 33 - 79 FROM tab0 AS cor0 GROUP BY col0 HAVING + + 98 IN ( + CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-3696
SELECT DISTINCT - 33 - 79 FROM tab0 AS cor0 GROUP BY col0 HAVING + + 98 IN ( + CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT ALL + 91 FROM tab0 GROUP BY col2
----
91
91
91

query I rowsort
SELECT ALL col0 * + 58 * col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT - AVG ( + col1 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + 2 + col2 FROM tab1 cor0 GROUP BY col2, col1
----
10
47
73

query II rowsort
SELECT + 89, col1 FROM tab0 GROUP BY col1
----
89
0
89
81

query I rowsort
SELECT - 14 * + col2 AS col2 FROM tab1 GROUP BY col2
----
-112
-630
-994

query I rowsort
SELECT DISTINCT ( - col1 ) - - 8 FROM tab2 AS cor0 GROUP BY col1, col1
----
-33
-51
-53

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3705
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0, col0, col2 HAVING NOT col0 * + col2 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3705
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0, col0, col2 HAVING NOT col0 * + col2 IS NULL
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - + col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3708
SELECT DISTINCT COALESCE ( - col2, - 16 ) + - + 22 * + col0 * + 58 * + CAST( 12 AS SIGNED ) * col2 FROM tab1 WHERE - col0 IS NOT NULL GROUP BY col2, col0 HAVING NULL IN ( 17 )
----

skipif mysql # not compatible
query I rowsort label-3708
SELECT DISTINCT COALESCE ( - col2, - 16 ) + - + 22 * + col0 * + 58 * + CAST ( 12 AS INTEGER ) * col2 FROM tab1 WHERE - col0 IS NOT NULL GROUP BY col2, col0 HAVING NULL IN ( 17 )
----

query I rowsort
SELECT ALL - + col0 * col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * + col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
132
1596
3608

query I rowsort
SELECT DISTINCT - col2 + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-72
12
34

query I rowsort
SELECT - - col2 * - col2 / - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING + - col2 IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 27 col1 FROM tab2 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT 34 * + - col0 * - + col0 AS col1 FROM tab2 GROUP BY col0, col1
----
281554
287776
7650

query II rowsort
SELECT DISTINCT + col1, 12 FROM tab0 GROUP BY col1
----
0
12
81
12

query I rowsort
SELECT ALL 65 FROM tab2 AS cor0 GROUP BY col0
----
65
65
65

query I rowsort
SELECT DISTINCT + 13 + + col0 + 45 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT 1 IS NULL
----
101
141
84

query I rowsort
SELECT ( + col1 ) FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - 27 FROM tab0 GROUP BY col2
----
-27
-27
-27

query I rowsort
SELECT + 36 - - 2 FROM tab0 GROUP BY col0
----
38
38
38

query I rowsort
SELECT - 2 FROM tab0 GROUP BY col1
----
-2
-2

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query II rowsort
SELECT + 28 AS col2, + col0 FROM tab1 GROUP BY col0
----
28
22
28
28
28
82

query I rowsort
SELECT ALL - - 31 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
31
31
31

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + 6 col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT 26 * col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
1118
2158
676

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 57 col0 FROM tab0 GROUP BY col2, col0
----
57
57
57

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL col2 + col2 AS col1 FROM tab1 GROUP BY col2 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT DISTINCT + 98 FROM tab0 cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3732
SELECT col0 + col0 * CAST( col0 AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
1892
6972
702

skipif mysql # not compatible
query I rowsort label-3732
SELECT col0 + col0 * CAST ( col0 AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
1892
6972
702

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 82 col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-82
-82
-82

query I rowsort
SELECT ALL col2 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ( 57 ) AS col1 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT + col2 * col2 IS NULL
----
57
57
57

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - ( + col0 ) - col0 col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IN ( ( ( ( + 9 ) ) ) * 0 )
----

query I rowsort
SELECT DISTINCT 86 + col1 + 82 FROM tab2 GROUP BY col1 HAVING NOT col1 IS NULL
----
209
227
229

query I rowsort
SELECT + - ( 94 ) * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
2444
4042
7802

query I rowsort
SELECT DISTINCT - ( + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT - ( - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3741
SELECT DISTINCT - 99 + col2 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) <= - col0 * CAST( NULL AS DECIMAL ) + + col0 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-3741
SELECT DISTINCT - 99 + col2 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) <= - col0 * CAST ( NULL AS REAL ) + + col0 GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col2 / col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - 69 FROM tab0 AS cor0 GROUP BY col2
----
-69
-69
-69

query I rowsort
SELECT DISTINCT - ( - 95 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
95

query I rowsort
SELECT ALL 48 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
48
48
48

query I rowsort
SELECT + 42 * - 69 FROM tab2 AS cor0 GROUP BY col0
----
-2898
-2898
-2898

onlyif mysql # DIV for integer division: 
query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 DIV col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 / col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

query I rowsort
SELECT DISTINCT + ( + col2 ) AS col1 FROM tab2 GROUP BY col2, col1 HAVING NULL BETWEEN NULL AND + col1
----

query I rowsort
SELECT + - ( col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 + + 19 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN ( - + 8 ) AND NULL
----

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col2, col0
----
-41
-59
-61

query I rowsort
SELECT ALL + col0 + col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
133
150
76

query I rowsort
SELECT + 24 FROM tab1 AS cor0 GROUP BY col1, col2
----
24
24
24

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
0

query I rowsort
SELECT ALL + + ( + col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT ALL 36, col1 FROM tab2 GROUP BY col1 HAVING NULL = ( NULL )
----

query I rowsort
SELECT ALL 65 * + - col2 FROM tab0 GROUP BY col2
----
-1560
-2470
-5135

query I rowsort
SELECT col0 + 30 AS col0 FROM tab2 GROUP BY col0, col0 HAVING + + 27 * 55 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - col1 * col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3762
SELECT DISTINCT + + col0 + + + col0 AS col2, + col2 - + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT - 52 IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-3762
SELECT DISTINCT + + col0 + + + col0 AS col2, + col2 - + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT - 52 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3763
SELECT ALL - + col2 AS col2, col2 FROM tab0 AS cor0 WHERE NOT CAST( NULL AS SIGNED ) * - col2 + - col0 IS NULL GROUP BY col2, col0
----

skipif mysql # not compatible
query II rowsort label-3763
SELECT ALL - + col2 AS col2, col2 FROM tab0 AS cor0 WHERE NOT CAST ( NULL AS INTEGER ) * - col2 + - col0 IS NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3764
SELECT - + col1 DIV - col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3764
SELECT - + col1 / - col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT 54 AS col2 FROM tab2 GROUP BY col0
----
54
54
54

query I rowsort
SELECT ALL col1 + - - 49 FROM tab1 AS cor0 GROUP BY col1
----
106
55
93

query I rowsort
SELECT col0 * - col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT DISTINCT - 61 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-61

query I rowsort
SELECT DISTINCT 77 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT 86 IS NULL
----
77

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 76 col2 FROM tab2 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT DISTINCT col2 - - - 87 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-29
-8
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3774
SELECT DISTINCT + CAST( NULL AS DECIMAL ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( + 16 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3774
SELECT DISTINCT + CAST ( NULL AS REAL ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( + 16 ) IS NULL
----

query I rowsort
SELECT - 34 FROM tab2 AS cor0 GROUP BY col1, col1
----
-34
-34
-34

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3776
SELECT col1 * - CAST( NULL AS SIGNED ) + 92 * - col1 / + + col1, - col1 / CAST( NULL AS SIGNED ) AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-3776
SELECT col1 * - CAST ( NULL AS INTEGER ) + 92 * - col1 / + + col1, - col1 / CAST ( NULL AS INTEGER ) AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col1, col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3778
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 / - 94 * + CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3778
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 / - 94 * + CAST ( NULL AS INTEGER ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2 - + col2 AS col1, ( + col2 ) * - col2 * + + 40 * + 9 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL BETWEEN ( col2 * + col0 ) AND NULL
----

query I rowsort
SELECT - col2 + - - ( + col2 ) + + + col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col2 * col2 AS col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3782
SELECT DISTINCT - CAST( + col0 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-3782
SELECT DISTINCT - CAST ( + col0 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT + 50 FROM tab1 WHERE NULL <= - 25 GROUP BY col2
----

query I rowsort
SELECT - ( + col1 ) FROM tab0 GROUP BY col0, col1, col1, col1 HAVING NOT - 41 IS NULL
----
-81
0
0

query II rowsort
SELECT col2 AS col0, - col2 AS col0 FROM tab2 GROUP BY col2, col2
----
58
-58
79
-79
87
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 82 + + col1 col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + - col0 IS NULL
----
123
141
143

query I rowsort
SELECT ( - col0 ) FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + + col2 + col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT + col2 + - ( 24 ) AS col1 FROM tab0 cor0 GROUP BY col2
----
0
14
55

onlyif mysql # DIV for integer division: 
query I rowsort label-3790
SELECT col2 - col2 * + + col2 * + col2 * - col2 DIV + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
13848
493118
54910

skipif mysql # not compatible
query I rowsort label-3790
SELECT col2 - col2 * + + col2 * + col2 * - col2 / + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
13848
493118
54910

query II rowsort
SELECT ALL col2 AS col2, col2 * col2 * + + col2 + + col2 + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
195112
79
493039
87
658503

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3792
SELECT - CAST( - 96 AS SIGNED ) + - 24 FROM tab1 AS cor0 GROUP BY col2
----
72
72
72

skipif mysql # not compatible
query I rowsort label-3792
SELECT - CAST ( - 96 AS INTEGER ) + - 24 FROM tab1 AS cor0 GROUP BY col2
----
72
72
72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3793
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3793
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3794
SELECT + 99 * + col2 + - col2 + + + col2 + + 11 * + CAST( NULL AS SIGNED ) * - + col2 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3794
SELECT + 99 * + col2 + - col2 + + + col2 + + 11 * + CAST ( NULL AS INTEGER ) * - + col2 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT + col1 AS col0, ( + col1 ) FROM tab0 GROUP BY col1, col1
----
0
0
81
81

onlyif mysql # DIV for integer division: 
query I rowsort label-3796
SELECT 9 DIV + - 81 col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3796
SELECT 9 / + - 81 col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
58
79
87

query I rowsort
SELECT ALL + 99 FROM tab2 AS cor0 GROUP BY col2, col2
----
99
99
99

query I rowsort
SELECT DISTINCT 79 FROM tab1 GROUP BY col1 HAVING + 69 < NULL
----

query I rowsort
SELECT DISTINCT col0 + + col0 - + col0 * + col0 AS col1 FROM tab2 GROUP BY col0
----
-195
-8099
-8280

query I rowsort
SELECT - 86 AS col0 FROM tab1 GROUP BY col1, col1
----
-86
-86
-86

onlyif mysql # DIV for integer division: 
query I rowsort label-3803
SELECT + col0 DIV NULLIF ( 43, + + AVG ( ALL + col1 ) ) FROM tab0 AS cor0 GROUP BY col0
----
0
1
1

skipif mysql # not compatible
query I rowsort label-3803
SELECT + col0 / NULLIF ( 43, + + AVG ( ALL + col1 ) ) FROM tab0 AS cor0 GROUP BY col0
----
0
1
1

query II rowsort
SELECT DISTINCT col0, col0 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT + col1 + + - 26 FROM tab1 GROUP BY col1
----
-20
18
31

query I rowsort
SELECT DISTINCT + + 46 FROM tab0 AS cor0 GROUP BY col2, col0
----
46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3807
SELECT - CAST( NULL AS SIGNED ) / - + col2 + col2 + - col2 + 57 AS col1 FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3807
SELECT - CAST ( NULL AS INTEGER ) / - + col2 + col2 + - col2 + 57 AS col1 FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3808
SELECT DISTINCT col1 + - CAST( col1 AS SIGNED ) * 47 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL > NULL
----

skipif mysql # not compatible
query I rowsort label-3808
SELECT DISTINCT col1 + - CAST ( col1 AS INTEGER ) * 47 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + 57 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3811
SELECT DISTINCT - - 61 FROM tab1 cor0 GROUP BY col0, col2, col1 HAVING - + col1 IN ( + 96 - + CASE + col2 WHEN + - COALESCE ( - col2, + COALESCE ( + + 9, - - col2 ) ) THEN - col0 WHEN + CAST( NULL AS SIGNED ) THEN col2 ELSE NULL END )
----

skipif mysql # not compatible
query I rowsort label-3811
SELECT DISTINCT - - 61 FROM tab1 cor0 GROUP BY col0, col2, col1 HAVING - + col1 IN ( + 96 - + CASE + col2 WHEN + - COALESCE ( - col2, + COALESCE ( + + 9, - - col2 ) ) THEN - col0 WHEN + CAST ( NULL AS INTEGER ) THEN col2 ELSE NULL END )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3812
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3812
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + ( - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT + col2 <= + 3
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + col1 FROM tab1 WHERE + col0 - col0 NOT IN ( + - col0 ) GROUP BY col0, col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NOT - - col2 * - 1 BETWEEN NULL AND - + col1 + + col0 GROUP BY col0, col0
----
-43

query I rowsort
SELECT ALL ( + + ( + 87 ) ) + - - 60 AS col1 FROM tab2 AS cor0 WHERE ( + + col2 ) IN ( - + col2 + - 95 * + col1, + col0 - col1 ) GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3818
SELECT ALL + + 93 DIV + 17 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
5
5
5

skipif mysql # not compatible
query I rowsort label-3818
SELECT ALL + + 93 / + 17 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
5
5
5

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3819
SELECT + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING 29 <> + 74
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3819
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING 29 <> + 74
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col2 / - col2 FROM tab0 AS cor0 WHERE NOT - col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT 18 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
18
18
18

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col0 / + col0 / + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - + 18 + - col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0
----
-101
-44
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-3825
SELECT DISTINCT col0 DIV col0 + col0 * + col0 AS col0 FROM tab1 GROUP BY col0
----
485
6725
785

skipif mysql # not compatible
query I rowsort label-3825
SELECT DISTINCT col0 / col0 + col0 * + col0 AS col0 FROM tab1 GROUP BY col0
----
485
6725
785

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3826
SELECT + AVG ( - CAST( NULL AS SIGNED ) ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3826
SELECT + AVG ( - CAST ( NULL AS INTEGER ) ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col2 * - + col2 + + 31 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3333
-6210
-7538

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3828
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - AVG ( ALL - + col2 ) + + + CAST( NULL AS SIGNED ) IN ( + 93 )
----

skipif mysql # not compatible
query I rowsort label-3828
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - AVG ( ALL - + col2 ) + + + CAST ( NULL AS INTEGER ) IN ( + 93 )
----

query III rowsort
SELECT ALL - + AVG ( - 23 ), + col0 - - col1, col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL BETWEEN col1 AND 75 / 10
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL + 23 FROM tab0 GROUP BY col1, col0, col2
----
23
23
23

query I rowsort
SELECT DISTINCT 95 FROM tab1 AS cor0 GROUP BY col2
----
95

query I rowsort
SELECT + 27 AS col0 FROM tab0 GROUP BY col1
----
27
27

query I rowsort
SELECT DISTINCT 63 FROM tab0 GROUP BY col0, col0 HAVING - + 22 + ( col0 ) NOT BETWEEN ( - - col0 ) AND ( 12 )
----
63

query I rowsort
SELECT ALL + - 16 FROM tab2 cor0 GROUP BY col0, col0, col2 HAVING NOT col2 * + ( - 50 ) IN ( - col2 * 71 * + 6, col0 )
----
-16
-16
-16

query I rowsort
SELECT + col1 * - - col1 * - col2 + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-137374
-146177
-266

query I rowsort
SELECT 82 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
82
82
82

query I rowsort
SELECT 31 AS col2 FROM tab2 WHERE NULL NOT BETWEEN + 70 AND ( 8 ) GROUP BY col2
----

query I rowsort
SELECT col0 * + - 68 AS col0 FROM tab0 GROUP BY col0
----
-1768
-2924
-5644

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3840
SELECT DISTINCT CAST( NULL AS SIGNED ) + col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3840
SELECT DISTINCT CAST ( NULL AS INTEGER ) + col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3841
SELECT CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0 HAVING NOT - + 23 NOT BETWEEN NULL AND 73
----

skipif mysql # not compatible
query I rowsort label-3841
SELECT CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0 HAVING NOT - + 23 NOT BETWEEN NULL AND 73
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3843
SELECT + CAST( NULL AS SIGNED ) col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3843
SELECT + CAST ( NULL AS INTEGER ) col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 90 * 65 col1 FROM tab2 WHERE + 81 / + col1 - 81 NOT IN ( col0 ) GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT + ( + col2 ), ( - + col2 ) FROM tab1 GROUP BY col2 HAVING NOT + 23 * col2 <= ( col2 )
----
45
-45
71
-71
8
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3846
SELECT DISTINCT col0 AS col0 FROM tab0 WHERE NULL IN ( + CAST( - - 84 AS SIGNED ) * col0 ) GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3846
SELECT DISTINCT col0 AS col0 FROM tab0 WHERE NULL IN ( + CAST ( - - 84 AS INTEGER ) * col0 ) GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 + col1 + + + 87 AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) > + 71 * col2 * 74
----

query I rowsort
SELECT - ( + col0 ) FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-3850
SELECT DISTINCT 20 + 6 DIV - + 53 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
20

skipif mysql # not compatible
query I rowsort label-3850
SELECT DISTINCT 20 + 6 / - + 53 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
20

query II rowsort
SELECT DISTINCT + col1 AS col1, - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
-38
0
-79
81
-24

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab0 AS cor0 WHERE NOT 41 > + 69 GROUP BY col2, col1
----
-1444
-576
-6241

query I rowsort
SELECT ALL + + 54 FROM tab1 cor0 GROUP BY col2
----
54
54
54

query I rowsort
SELECT + col2 + - col2 + - 14 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= ( - - col2 )
----

query I rowsort
SELECT - 10 FROM tab2 WHERE + 52 + 59 * 58 * + col0 BETWEEN NULL AND ( NULL ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 69 col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IN ( 61 + + 6 )
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab1 AS cor0 WHERE col1 IS NULL GROUP BY col0
----

query I rowsort
SELECT + col1 * + col1 + - 56 FROM tab1 AS cor0 WHERE col1 + + 83 - COALESCE ( + col1, - 95 ) * - col0 < NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + 44 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
44

query I rowsort
SELECT ( + col2 ) FROM tab2 AS cor0 WHERE ( NULL <= ( - col2 ) / col0 * - col0 ) GROUP BY col2, col1 HAVING NOT + col1 NOT IN ( col2, 51, + 21, col2 + + col2 )
----

query I rowsort
SELECT DISTINCT + ( col1 ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
41
59
61

query I rowsort
SELECT ALL 70 FROM tab1 GROUP BY col0, col2
----
70
70
70

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT + col0 IS NULL
----
-15
-91
-92

query II rowsort
SELECT DISTINCT col2 AS col2, + 60 * - col2 FROM tab0 GROUP BY col2
----
24
-1440
38
-2280
79
-4740

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 80 col2 FROM tab2 GROUP BY col0, col2
----
80
80
80

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3866
SELECT CAST( NULL AS DECIMAL ), col2 FROM tab0 GROUP BY col2, col2
----
NULL
24
NULL
38
NULL
79

skipif mysql # not compatible
query II rowsort label-3866
SELECT CAST ( NULL AS REAL ), col2 FROM tab0 GROUP BY col2, col2
----
NULL
24
NULL
38
NULL
79

query I rowsort
SELECT + 71 FROM tab1 GROUP BY col2, col1
----
71
71
71

query I rowsort
SELECT ALL - + 1 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query II rowsort label-3869
SELECT ALL - 67 DIV - col0, + col0 + col0 * + + col0 AS col1 FROM tab1 GROUP BY col0
----
0
6806
2
812
3
506

skipif mysql # not compatible
query II rowsort label-3869
SELECT ALL - 67 / - col0, + col0 + col0 * + + col0 AS col1 FROM tab1 GROUP BY col0
----
0
6806
2
812
3
506

query II rowsort
SELECT ALL col0 AS col2, col0 FROM tab0 cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT + ( - - 6 ) AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT - - 42 BETWEEN NULL AND col1
----
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + ( - + col1 ) + + - col2 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-105
-38
-79

query I rowsort
SELECT DISTINCT + ( + + col0 ) - - + 87 * + col0 + 14 * col0 FROM tab0 GROUP BY col0
----
2652
4386
8466

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NOT - - ( - - AVG ( 62 ) ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 19 col1 FROM tab2 AS cor0 GROUP BY col1
----
-19

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col0 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 GROUP BY col1 HAVING - - col1 <> NULL
----

query I rowsort
SELECT 53 AS col2 FROM tab2 GROUP BY col1
----
53
53
53

query I rowsort
SELECT DISTINCT 68 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
68

onlyif mysql # DIV for integer division: 
query I rowsort label-3882
SELECT 4 DIV + 96 + col1 - + 98 * 18 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1703
-1705
-1723

skipif mysql # not compatible
query I rowsort label-3882
SELECT 4 / + 96 + col1 - + 98 * 18 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1703
-1705
-1723

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + ( - 37 ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-37
-37
-37

query I rowsort
SELECT + ( col1 ) * col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING + 65 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ( - + ( - + 19 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
19
19
19

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 55 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
55

query I rowsort
SELECT - 5 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col1
----
-5
-5
-5

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query II rowsort
SELECT col1 + - - 91 + + - col1 AS col1, + col1 + - 16 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 5 col0 FROM tab0 GROUP BY col1
----
-5

query I rowsort
SELECT - col0 * + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + ( + - 10 ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-10
-10
-10

query I rowsort
SELECT - 31 FROM tab1 GROUP BY col1, col1
----
-31
-31
-31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3897
SELECT DISTINCT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3897
SELECT DISTINCT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
44
57
6

query I rowsort
SELECT + col2 / + + col2 / 99 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NOT AVG ( ALL + col0 ) + col1 IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NULL BETWEEN - col0 AND NULL
----

query I rowsort
SELECT col0 * - col0 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT - 8 AS col1 FROM tab0 GROUP BY col2
----
-8
-8
-8

query I rowsort
SELECT - col2 * + 25 FROM tab2 GROUP BY col2
----
-1450
-1975
-2175

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 53 col0 FROM tab2 AS cor0 GROUP BY col1
----
-53
-53
-53

query II rowsort
SELECT DISTINCT - - col1 AS col1, ( - col1 ) FROM tab1 AS cor0 GROUP BY col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT - col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT 11 AS col0, 36 AS col1 FROM tab2 GROUP BY col2
----
11
36
11
36
11
36

query I rowsort
SELECT ALL + col1 * col2 + + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
1968
38
79

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING ( + col0 / + ( - 22 ) ) IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT 25 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
25
25
25

query I rowsort
SELECT ALL - ( col0 ) AS col1 FROM tab0 AS cor0 WHERE NOT 93 IS NULL GROUP BY col0
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-3912
SELECT + col1 DIV col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3912
SELECT + col1 / col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL - col0 * + ( - + col0 ) FROM tab2 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT - NULLIF ( col0, - col0 ) FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + col0 - 73 * - col0 * - 83 * + 77 AS col1 FROM tab1 GROUP BY col0
----
-10263924
-13063176
-38256444

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + 96 FROM tab2 cor0 GROUP BY col0
----
96
96
96

query I rowsort
SELECT - - ( - - ( col2 ) ) AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + + col1 - + 73 + - 14 FROM tab1 AS cor0 GROUP BY col1
----
-30
-43
-81

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - col0 NOT BETWEEN - col0 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 AS cor0 WHERE NOT NULL <> col2 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3922
SELECT ALL CAST( + 1 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3922
SELECT ALL CAST ( + 1 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT ALL 15 + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - 48 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3924
SELECT + - CAST( NULL AS SIGNED ) AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-3924
SELECT + - CAST ( NULL AS INTEGER ) AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT + 72 AS col1 FROM tab2 GROUP BY col0, col0
----
72
72
72

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 43 col2 FROM tab2 AS cor0 GROUP BY col1
----
43
43
43

query I rowsort
SELECT + - 83 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-83
-83

query I rowsort
SELECT ALL - ( - 46 ) FROM tab1 GROUP BY col0
----
46
46
46

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * + col0 AS col2 FROM tab1 GROUP BY col0, col1, col1
----
132
1596
3608

query II rowsort
SELECT + ( 60 ) AS col0, 44 * 74 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
60
3256
60
3256
60
3256

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3933
SELECT ALL ( CAST( NULL AS SIGNED ) ) FROM tab1 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3933
SELECT ALL ( CAST ( NULL AS INTEGER ) ) FROM tab1 cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab2 WHERE col2 IS NOT NULL GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ( + ( - col0 ) ) + - col0 FROM tab2 GROUP BY col0, col0
----
-182
-184
-30

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col2, col1, col1
----
-58
-79
-87

query I rowsort
SELECT col0 FROM tab1 GROUP BY col2, col0 HAVING 74 NOT BETWEEN - 73 AND ( - ( 26 ) )
----
22
28
82

query I rowsort
SELECT - ( + - 59 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
59
59
59

query I rowsort
SELECT + COALESCE ( + NULLIF ( + col0, col0 ), - col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ( + col0 ) AS col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab2 WHERE ( NOT col0 <= ( + + col0 * - col2 ) ) GROUP BY col0 HAVING NULL >= ( - 27 )
----

query I rowsort
SELECT - 29 FROM tab0 GROUP BY col2
----
-29
-29
-29

query I rowsort
SELECT col0 * 46 - col1 AS col1 FROM tab0 WHERE col1 BETWEEN ( col0 ) AND NULL GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 58 + col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col1 * - + 81 + - + col1 * - 51 - + 42 FROM tab1 GROUP BY col1
----
-154614
-260304
-2652

onlyif mysql # DIV for integer division: 
query I rowsort label-3947
SELECT - - col1 DIV 49 * + 2 FROM tab1 WHERE NOT 59 IS NULL GROUP BY col1
----
0
0
2

skipif mysql # not compatible
query I rowsort label-3947
SELECT - - col1 / 49 * + 2 FROM tab1 WHERE NOT 59 IS NULL GROUP BY col1
----
0
0
2

query I rowsort
SELECT + + col2 - 31 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST( NULL AS DECIMAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST ( NULL AS REAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

query I rowsort
SELECT - col2 * + col2 FROM tab1 WHERE - ( - ( - col0 ) ) NOT IN ( - col0 ) GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col2, col0, col0 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT - col0 * - col0 + + + 24 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT 25 * + col0 AS col0 FROM tab0 GROUP BY col0
----
1075
2075
650

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3955
SELECT + - col0 * - col0 + + CAST( CAST( NULL AS SIGNED ) AS SIGNED ) + + col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3955
SELECT + - col0 * - col0 + + CAST ( CAST ( NULL AS INTEGER ) AS INTEGER ) + + col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab0 WHERE 82 IS NOT NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - 59 FROM tab2 GROUP BY col2, col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 91 FROM tab0 GROUP BY col2, col0
----
91

query I rowsort
SELECT DISTINCT + 4 + + col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING ( + col2 ) BETWEEN ( - 28 ) AND ( 76 / NULLIF ( + 34, col2 ) )
----

query I rowsort
SELECT ALL 32 * + col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING col2 + 5 BETWEEN + 10 * col2 AND ( + 39 )
----

query I rowsort
SELECT ALL 32 FROM tab1 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND AVG ( - col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3962
SELECT col2 FROM tab1 GROUP BY col2 HAVING + 35 = CAST( 72 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3962
SELECT col2 FROM tab1 GROUP BY col2 HAVING + 35 = CAST ( 72 AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3963
SELECT + col1 AS col0 FROM tab1 WHERE CAST( NULL AS SIGNED ) > col0 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-3963
SELECT + col1 AS col0 FROM tab1 WHERE CAST ( NULL AS INTEGER ) > col0 GROUP BY col1
----

query I rowsort
SELECT ALL - 73 * + col0 FROM tab0 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND - col0 + + 82 * 74
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0, col0 HAVING NOT ( col0 * col0 ) IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT ALL + 20 AS col2 FROM tab2 AS cor0 WHERE NOT 40 * 72 > NULL GROUP BY col1 HAVING NULL NOT BETWEEN 12 AND NULL
----

query I rowsort
SELECT - + 73 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-58
18
19

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL > col0
----

query I rowsort
SELECT DISTINCT + 52 * - col0 * + 31 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( - col0 ) IS NULL
----
-146601
-148212
-24165

query I rowsort
SELECT DISTINCT - col2 + 53 FROM tab2 AS cor0 GROUP BY col0, col2
----
-26
-34
-5

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING 84 * + 68 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - 0 FROM tab0 GROUP BY col1, col2 HAVING NOT + 17 <= ( 42 + AVG ( DISTINCT 25 + + 77 ) )
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col1 HAVING col1 + col2 * + col2 NOT BETWEEN ( - col2 + - col2 ) AND AVG ( - 5 )
----
45
71
8

query I rowsort
SELECT + ( + col1 ) AS col1 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL + col1 * - ( + - 19 ) + - col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-26
-83
1496

query II rowsort
SELECT ALL ( ( + + 23 ) ) * - + 42 AS col0, + col2 + + 88 + - 40 + + 34 * + 30 AS col1 FROM tab0 GROUP BY col2
----
-966
1092
-966
1106
-966
1147

query I rowsort
SELECT + 91 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT - 1 FROM tab0 cor0 WHERE + col1 = - col2 GROUP BY col0 HAVING NOT + 93 = NULL
----

query I rowsort
SELECT col1 FROM tab0 WHERE NOT + + col0 < - NULLIF ( col0, + - col0 * + + col1 * + col1 ) GROUP BY col2, col2, col1
----
0
0
81

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NOT - col1 BETWEEN NULL AND - - col1
----

query I rowsort
SELECT + col1 + - + 31 AS col1 FROM tab2 GROUP BY col1
----
10
28
30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3983
SELECT - - 20 * col1 * - 23 + col0 AS col0 FROM tab0 AS cor0 WHERE - col0 * + CAST( + - col1 AS SIGNED ) * - col0 IS NOT NULL GROUP BY col0, col1
----
-37217
26
83

skipif mysql # not compatible
query I rowsort label-3983
SELECT - - 20 * col1 * - 23 + col0 AS col0 FROM tab0 AS cor0 WHERE - col0 * + CAST ( + - col1 AS INTEGER ) * - col0 IS NOT NULL GROUP BY col0, col1
----
-37217
26
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - - ( + 36 ), col0 * 70 col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
36
1540
36
1960
36
5740

query I rowsort
SELECT DISTINCT - 71 FROM tab0 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT - 1 FROM tab0 GROUP BY col1
----
-1
-1

query I rowsort
SELECT - col0 - - + col0 AS col1 FROM tab1 GROUP BY col0
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3988
SELECT 81 AS col2, CAST( + 5 AS SIGNED ) FROM tab2 GROUP BY col0
----
81
5
81
5
81
5

skipif mysql # not compatible
query II rowsort label-3988
SELECT 81 AS col2, CAST ( + 5 AS INTEGER ) FROM tab2 GROUP BY col0
----
81
5
81
5
81
5

query I rowsort
SELECT + 24 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
24
24
24

query I rowsort
SELECT - col2 / + 23 FROM tab1 AS cor0 WHERE NOT col0 * 73 NOT BETWEEN col1 AND NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 2 col0 FROM tab0 GROUP BY col2
----
-2

query I rowsort
SELECT col1 * + - col1 * + + ( - 88 ) + + + col1 - - - 45 / 42 AS col2 FROM tab2 GROUP BY col1 HAVING - ( 73 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > + + col2 * - 49 / - col1
----

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL - col2 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT + 95 + + - 15 = NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0, - col0 + - + col0 - - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
-45
91
-273
92
-276

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col2 + - 20 AS col0 FROM tab2 GROUP BY col1, col2, col1
----
38
59
67

query I rowsort
SELECT ALL - 9 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-9
-9

query I rowsort
SELECT col2 + + 68 FROM tab2 AS cor0 WHERE NOT ( 25 + - col0 / - - col2 + + CASE col2 WHEN + col2 THEN NULL WHEN 57 THEN + col0 + - - col0 * + - col0 * - col0 END ) IS NULL GROUP BY col2
----

query I rowsort
SELECT ( + + col2 ) AS col2 FROM tab1 GROUP BY col2 HAVING NOT 98 IS NOT NULL
----

query I rowsort
SELECT ALL 20 + + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
101
20

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 46 col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-46

query I rowsort
SELECT - ( col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + 93 + + col2 FROM tab1 cor0 GROUP BY col2, col2
----
101
138
164

query I rowsort
SELECT DISTINCT - 15 / col2 FROM tab0 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col2 HAVING NOT NULL <= - - col2
----

query I rowsort
SELECT DISTINCT - - col2 + + + col2 - - - 21 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
137
153
95

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - ( - + 11 ) AS col0 FROM tab1 GROUP BY col2
----
11

onlyif mysql # DIV for integer division: 
query I rowsort label-4012
SELECT - + col1 DIV + col1 + col1 + - 98 + + - col1 DIV + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4012
SELECT - + col1 / + col1 + col1 + - 98 + + - col1 / + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

query I rowsort
SELECT DISTINCT + - 88 FROM tab2 cor0 GROUP BY col0, col0, col1
----
-88

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1, col0, col0 HAVING + 5 IS NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4017
SELECT - CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4017
SELECT - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + col2, + 84 col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
84
-38
84
-79
84

query I rowsort
SELECT DISTINCT - col1 + - 73 - - col1 AS col1 FROM tab1 cor0 GROUP BY col1 HAVING ( + col1 ) IS NOT NULL
----
-73

query I rowsort
SELECT + ( + + col1 ) * - col0 AS col1 FROM tab1 GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT + col2 AS col0 FROM tab0 WHERE NOT col0 BETWEEN NULL AND - - col1 AND NOT NULL IS NULL GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 15, + col2 col2 FROM tab1 GROUP BY col0, col2
----
15
45
15
71
15
8

query I rowsort
SELECT ALL - col2 * + - col2 AS col1 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query II rowsort
SELECT col2, + col2 * - col2 FROM tab0 GROUP BY col2
----
24
-576
38
-1444
79
-6241

query I rowsort
SELECT 10 FROM tab0 GROUP BY col0
----
10
10
10

query I rowsort
SELECT + col2 * 40 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1
----
1520
3160
960

query I rowsort
SELECT + 64 FROM tab1 cor0 GROUP BY col1, col0, col1
----
64
64
64

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 WHERE + col2 / 49 IS NULL GROUP BY col0
----

query II rowsort
SELECT DISTINCT col1 * + col1, ( col1 ) AS col0 FROM tab2 GROUP BY col1
----
1681
41
3481
59
3721
61

query I rowsort
SELECT 85 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
85
85
85

query II rowsort
SELECT DISTINCT col0, + 38 FROM tab0 AS cor0 GROUP BY col0
----
26
38
43
38
83
38

query II rowsort
SELECT ALL + col0, - col0 FROM tab0 cor0 GROUP BY col0
----
26
-26
43
-43
83
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4033
SELECT ALL + col0 - + 80 * 98 * - 52 + + CAST( - - col0 AS SIGNED ) * + - col0 AS col2 FROM tab1 AS cor0 WHERE NOT - 67 = - col0 GROUP BY col0
----
401038
406924
407218

skipif mysql # not compatible
query I rowsort label-4033
SELECT ALL + col0 - + 80 * 98 * - 52 + + CAST ( - - col0 AS INTEGER ) * + - col0 AS col2 FROM tab1 AS cor0 WHERE NOT - 67 = - col0 GROUP BY col0
----
401038
406924
407218

onlyif mysql # DIV for integer division: 
query I rowsort label-4034
SELECT + col0 + col0 DIV + - col0 FROM tab1 AS cor0 GROUP BY col0
----
21
27
81

skipif mysql # not compatible
query I rowsort label-4034
SELECT + col0 + col0 / + - col0 FROM tab1 AS cor0 GROUP BY col0
----
21
27
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4035
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4035
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 GROUP BY col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST( + + col2 AS SIGNED ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST ( + + col2 AS INTEGER ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

query I rowsort
SELECT ALL + col1 + - - col1 + + + col2 - + 23 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-3
136
136

query I rowsort
SELECT 38 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - - col1 ) NOT IN ( - 62 * + + col1 * col1 * col1, - col1 * - col1 )
----
38

query I rowsort
SELECT 11 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NOT ( - col2 ) < NULL
----

query I rowsort
SELECT ALL + + 1 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 90 FROM tab2 cor0 GROUP BY col1
----
-90
-90
-90

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4043
SELECT DISTINCT - col2 * col2 FROM tab1 AS cor0 WHERE + col2 + 87 * col0 = - CAST( - 14 AS DECIMAL ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-4043
SELECT DISTINCT - col2 * col2 FROM tab1 AS cor0 WHERE + col2 + 87 * col0 = - CAST ( - 14 AS REAL ) GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4044
SELECT col0 * 66 + + col0 DIV col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
1455
1848
5413

skipif mysql # not compatible
query I rowsort label-4044
SELECT col0 * 66 + + col0 / col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
1455
1848
5413

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4045
SELECT ALL - CAST( NULL AS DECIMAL ) FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4045
SELECT ALL - CAST ( NULL AS REAL ) FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 WHERE ( - col2 ) IS NOT NULL GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 49 col0 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL < NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4049
SELECT ALL - ( 8 ) AS col0 FROM tab2 WHERE NOT - CAST( - col0 AS DECIMAL ) IS NOT NULL GROUP BY col1, col2 HAVING NOT ( col2 * - ( - 84 ) ) > 86 + - col1
----

skipif mysql # not compatible
query I rowsort label-4049
SELECT ALL - ( 8 ) AS col0 FROM tab2 WHERE NOT - CAST ( - col0 AS REAL ) IS NOT NULL GROUP BY col1, col2 HAVING NOT ( col2 * - ( - 84 ) ) > 86 + - col1
----

query I rowsort
SELECT ALL - 78 FROM tab2 GROUP BY col1
----
-78
-78
-78

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4052
SELECT col1 / + ( + AVG ( DISTINCT col2 ) ) + - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT ( + NULLIF ( CAST( NULL AS SIGNED ), 95 ) ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-4052
SELECT col1 / + ( + AVG ( DISTINCT col2 ) ) + - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT ( + NULLIF ( CAST ( NULL AS INTEGER ), 95 ) ) NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col0 col2 FROM tab2 GROUP BY col0 HAVING NOT ( + ( - 12 ) ) IN ( + 61 )
----
182
184
30

query I rowsort
SELECT ALL COALESCE ( - 76, - col0 * + col0 ) * col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0, col1 HAVING NOT ( - NULLIF ( 63, + col2 + ( col0 ) ) ) IS NOT NULL
----

query I rowsort
SELECT + 38 AS col0 FROM tab0 cor0 GROUP BY col1
----
38
38

query I rowsort
SELECT ALL - 9 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) >= - 26
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0 HAVING col0 NOT BETWEEN ( + col0 ) AND ( - col0 )
----

query I rowsort
SELECT ALL col1 FROM tab2 WHERE ( - 7 ) IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + 29 + + col2 - + + col2 * 50 FROM tab1 GROUP BY col2
----
-2176
-3450
-363

query I rowsort
SELECT ALL + 9 FROM tab0 AS cor0 GROUP BY col0
----
9
9
9

query I rowsort
SELECT col1 * - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

onlyif mysql # DIV for integer division: 
query I rowsort label-4062
SELECT 75 DIV + 19 FROM tab2 WHERE NOT 36 >= ( 92 ) GROUP BY col1, col2
----
3
3
3

skipif mysql # not compatible
query I rowsort label-4062
SELECT 75 / + 19 FROM tab2 WHERE NOT 36 >= ( 92 ) GROUP BY col1, col2
----
3
3
3

query I rowsort
SELECT 56 + + col0 + - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
100
112
220

query I rowsort
SELECT ALL 45 - - col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 23 FROM tab1 AS cor0 GROUP BY col0, col1
----
23
23
23

query I rowsort
SELECT 66 * 49 FROM tab2 AS cor0 GROUP BY col0, col0, col0, col0
----
3234
3234
3234

query I rowsort
SELECT DISTINCT + - 37 FROM tab1 AS cor0 GROUP BY col0
----
-37

query I rowsort
SELECT ALL + - 26 + - + col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4069
SELECT - col2 + - - NULLIF ( - col2, + 59 + + ( CAST( + + col1 AS SIGNED ) ) ) * - ( + col1 ) * + - col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL BETWEEN NULL AND - col2
----

skipif mysql # not compatible
query I rowsort label-4069
SELECT - col2 + - - NULLIF ( - col2, + 59 + + ( CAST ( + + col1 AS INTEGER ) ) ) * - ( + col1 ) * + - col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL BETWEEN NULL AND - col2
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT col2 * - col2 * + - 63 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
211932
393183
476847

query I rowsort
SELECT + - ( - 29 ) * col0 - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1290
2490
780

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 76 col1 FROM tab2 WHERE + col1 * + col0 + - - 78 > 84 * + col0 + col0 * + + col2 + + - col2 + col2 / 52 GROUP BY col2
----

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1 HAVING NULL IN ( - 90 )
----

query I rowsort
SELECT - 22 * + + col1 * + col1 FROM tab0 AS cor0 WHERE + col0 BETWEEN + 82 * - + col1 AND + + 16 + + col0 GROUP BY col1
----
-144342
0

query I rowsort
SELECT col1 / - + 80 AS col0 FROM tab1 cor0 WHERE + 1 NOT BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING 76 >= NULL
----

query I rowsort
SELECT ALL 8 FROM tab0 AS cor0 WHERE NOT ( NULL ) >= + col1 GROUP BY col0
----

query I rowsort
SELECT + - 37 / + + col2 / - col2 * col2 FROM tab1 AS cor0 WHERE NOT 27 IS NOT NULL GROUP BY col2
----

query II rowsort
SELECT + + col0 * - 89, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1335
-15
-8099
-91
-8188
-92

query I rowsort
SELECT 17 AS col0 FROM tab2 GROUP BY col2
----
17
17
17

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4082
SELECT col1 * col2 + - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4082
SELECT col1 * col2 + - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 29 FROM tab0 WHERE + col0 IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4084
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1 HAVING NOT NULL < - 85
----

skipif mysql # not compatible
query I rowsort label-4084
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1 HAVING NOT NULL < - 85
----

query I rowsort
SELECT DISTINCT + 89 * 51 AS col2 FROM tab2 GROUP BY col2
----
4539

query I rowsort
SELECT DISTINCT + 65 AS col2 FROM tab1 GROUP BY col0
----
65

query I rowsort
SELECT ALL - ( ( - - 40 ) ) + + - col1 FROM tab0 GROUP BY col1
----
-121
-40

query I rowsort
SELECT ALL - col1 * + 12 * + col1 AS col1 FROM tab2 GROUP BY col1
----
-20172
-41772
-44652

query I rowsort
SELECT 34 * col1 FROM tab0 GROUP BY col1
----
0
2754

query I rowsort
SELECT + 32 FROM tab1 GROUP BY col2
----
32
32
32

query I rowsort
SELECT 61 AS col2 FROM tab0 GROUP BY col1
----
61
61

query I rowsort
SELECT ( - col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT + 9 AS col2 FROM tab0 cor0 WHERE col2 > NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col1, col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + 64 / ( + col1 ) FROM tab1 AS cor0 GROUP BY col1, col1, col2 HAVING NOT NULL NOT IN ( - col2 - col1 - + col1 )
----

query I rowsort
SELECT - ( col0 ) * + col0 * + col0 AS col0 FROM tab2 GROUP BY col0
----
-3375
-753571
-778688

query I rowsort
SELECT DISTINCT - - 14 FROM tab2 WHERE NOT col2 IS NULL GROUP BY col0
----
14

query I rowsort
SELECT DISTINCT col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT 43 * - + 54 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-2322

query I rowsort
SELECT + - 38 * 90 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-3420
-3420

query II rowsort
SELECT 44 AS col2, - 38 AS col1 FROM tab0 GROUP BY col0, col2 HAVING ( NULL ) >= NULL
----

query II rowsort
SELECT ALL ( 48 ) AS col0, ( - 51 ) FROM tab0 GROUP BY col0, col1 HAVING NOT NULL <> col1
----

query II rowsort
SELECT + col0 AS col0, + ( - 35 ) FROM tab2 GROUP BY col0
----
15
-35
91
-35
92
-35

query I rowsort
SELECT DISTINCT - - 39 - + 80 AS col0 FROM tab2 cor0 GROUP BY col0, col1
----
-41

query I rowsort
SELECT + - col2 - - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL col1 + - + ( - col2 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
102
115
14

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( NOT - 29 IS NOT NULL )
----

query I rowsort
SELECT DISTINCT - 55 + - col1 + + + ( + col1 ) FROM tab2 GROUP BY col1
----
-55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4109
SELECT DISTINCT col0 + + col2 + + 35 * + - col2 * CAST( NULL AS SIGNED ) * + 11 / + col2 * 1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-4109
SELECT DISTINCT col0 + + col2 + + 35 * + - col2 * CAST ( NULL AS INTEGER ) * + 11 / + col2 * 1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL

query I rowsort
SELECT + ( + ( + - col2 ) ) * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-2025
-5041
-64

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4111
SELECT DISTINCT - + COALESCE ( + + col1, + ( - - col1 ) ) + + - col1 * - 7 * CAST( NULL AS DECIMAL ) AS col1 FROM tab0 AS cor0 WHERE NOT + ( + + 49 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4111
SELECT DISTINCT - + COALESCE ( + + col1, + ( - - col1 ) ) + + - col1 * - 7 * CAST ( NULL AS REAL ) AS col1 FROM tab0 AS cor0 WHERE NOT + ( + + 49 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 + - col2 FROM tab1 GROUP BY col2 HAVING NOT ( NOT col2 - + 20 IS NOT NULL )
----
0

query II rowsort
SELECT ALL col1 AS col2, col1 + - col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 32 col0 FROM tab0 GROUP BY col1
----
32
32

query I rowsort
SELECT + col1 + - col1 AS col2 FROM tab2 GROUP BY col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4116
SELECT ALL - CAST( NULL AS SIGNED ) + + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT + 33 <= NULL
----

skipif mysql # not compatible
query I rowsort label-4116
SELECT ALL - CAST ( NULL AS INTEGER ) + + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT + 33 <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4117
SELECT + CAST( NULL AS SIGNED ) * + 58 FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4117
SELECT + CAST ( NULL AS INTEGER ) * + 58 FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + col1 AS col1 FROM tab2 cor0 GROUP BY col2, col1, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - 96 - - + col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-17
-38
-9

query II rowsort
SELECT - - col0, + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NOT + col0 >= NULL )
----

query I rowsort
SELECT - - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-44
-57
-6

query II rowsort
SELECT 51, COALESCE ( - 5, + 75 * - + 29 ) FROM tab1 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT - - 51 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
2958
4029
4437

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4125
SELECT + - CAST( NULL AS DECIMAL ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4125
SELECT + - CAST ( NULL AS REAL ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT + col0 AS col0, + col0 AS col1 FROM tab2 WHERE NOT ( + - col0 ) IS NULL GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT - 51 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( + + 80, col0, col0 + + + ( + ( - 40 ) ) )
----

query II rowsort
SELECT ALL col1, col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + + 19 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
19
19
19

query I rowsort
SELECT ALL 31 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
31
31
31

query I rowsort
SELECT + 37 FROM tab0 GROUP BY col1
----
37
37

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - col2 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT - col1 AS col0 FROM tab2 WHERE ( NOT ( NULL ) = NULL ) GROUP BY col1
----

query I rowsort
SELECT ( + col2 ) - - col0 AS col2 FROM tab0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT ALL + + col1 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT + 66 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4139
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL > - ( 44 ) * - ( + CAST( + 38 AS DECIMAL ) ) * + + 40
----

skipif mysql # not compatible
query I rowsort label-4139
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL > - ( 44 ) * - ( + CAST ( + 38 AS REAL ) ) * + + 40
----

query I rowsort
SELECT DISTINCT 62 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( - COALESCE ( + - 19, ( - 66 ) + + 13 ) ) <= ( NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL < col1 * col2
----

query I rowsort
SELECT DISTINCT - 65 AS col0 FROM tab2 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT - col2 + 11 / 83 AS col1 FROM tab0 GROUP BY col2 HAVING - + 11 IS NULL
----

query I rowsort
SELECT ALL - 69 + + 40 AS col0 FROM tab0 GROUP BY col1, col2, col2
----
-29
-29
-29

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 40 col1 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT NULL >= - ( - col1 ) - 15
----

query I rowsort
SELECT + ( - col1 ) / + 87 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL AND NOT ( NOT NULL IS NOT NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + COALESCE ( + col1, + - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 + - 97 IS NOT NULL
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4149
SELECT col2 + + 70 * col2 - CAST( + - 82 AS SIGNED ) - - col2 + + col2 * + col2 * - ( - - col2 ) AS col1 FROM tab1 GROUP BY col2, col2, col2 HAVING + ( - col2 ) IS NOT NULL
----
-352717
-87803
146

skipif mysql # not compatible
query I rowsort label-4149
SELECT col2 + + 70 * col2 - CAST ( + - 82 AS INTEGER ) - - col2 + + col2 * + col2 * - ( - - col2 ) AS col1 FROM tab1 GROUP BY col2, col2, col2 HAVING + ( - col2 ) IS NOT NULL
----
-352717
-87803
146

query II rowsort
SELECT - col2 * - col2, col2 AS col0 FROM tab0 AS cor0 WHERE NOT 3 - - col0 NOT BETWEEN COALESCE ( - col1, - col0, + col1 ) AND ( NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col0 * - 61 * - 34 + col0 AS col0 FROM tab0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
172225
53950
89225

query I rowsort
SELECT - col1 * - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT + ( + col1 ) AS col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT + ( + 84 ) + col0 + - ( + col0 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
84

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4155
SELECT 98 + col2 + + + col2 * - CAST( NULL AS SIGNED ) - - + col2 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4155
SELECT 98 + col2 + + + col2 * - CAST ( NULL AS INTEGER ) - - + col2 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT - - col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT - col0 < + col0 + 58
----

query I rowsort
SELECT - 17 FROM tab0 AS cor0 GROUP BY col1
----
-17
-17

onlyif mysql # DIV for integer division: 
query I rowsort label-4158
SELECT DISTINCT - col0 DIV + 23 FROM tab1 AS cor0 GROUP BY col0
----
-1
-3
0

skipif mysql # not compatible
query I rowsort label-4158
SELECT DISTINCT - col0 / + 23 FROM tab1 AS cor0 GROUP BY col0
----
-1
-3
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4159
SELECT DISTINCT + col1 + 75 + + CAST( - - 43 AS SIGNED ) / + col1 AS col2 FROM tab1 AS cor0 WHERE col2 IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-4159
SELECT DISTINCT + col1 + 75 + + CAST ( - - 43 AS INTEGER ) / + col1 AS col2 FROM tab1 AS cor0 WHERE col2 IS NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4160
SELECT - col1 * col1 DIV 90 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
-21
-36
0

skipif mysql # not compatible
query I rowsort label-4160
SELECT - col1 * col1 / 90 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
-21
-36
0

query I rowsort
SELECT 78 FROM tab2 GROUP BY col2, col0
----
78
78
78

query I rowsort
SELECT 4 FROM tab1 GROUP BY col0, col1
----
4
4
4

query I rowsort
SELECT DISTINCT - 47 AS col1 FROM tab1 GROUP BY col1, col2
----
-47

query I rowsort
SELECT ( + - col2 ) AS col1 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL ( 78 ) AS col2 FROM tab2 WHERE NOT - 84 NOT IN ( - 74 ) GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL 56 - col1 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT col1 * - col1 IS NULL
----
-3
-5
15

query I rowsort
SELECT ALL - - NULLIF ( - col1, ( - + ( 84 ) ) - + + col1 ) FROM tab1 cor0 GROUP BY col0, col1, col2 HAVING 15 + col0 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULLIF ( - col1, + col1 ) <= + 58
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 cor0 WHERE NOT - col1 IS NULL GROUP BY col2, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query II rowsort
SELECT ALL 69 AS col0, - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
69
-41
69
-59
69
-61

query I rowsort
SELECT ALL + ( + col1 ) + - 94 + + col1 AS col0 FROM tab2 GROUP BY col1
----
-12
24
28

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL < + + col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4174
SELECT DISTINCT col0 / + - CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4174
SELECT DISTINCT col0 / + - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL

query II rowsort
SELECT DISTINCT - col2 AS col0, col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
45
-71
71
-8
8

query II rowsort
SELECT col1, col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
92
59
91
61
15

query I rowsort
SELECT ALL + + ( + col2 ) + COALESCE ( - col2, + 10, col0 ) AS col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING col2 + - 48 IS NULL
----

query I rowsort
SELECT ALL ( + col1 ) + + col1 FROM tab2 GROUP BY col1 HAVING + + col1 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4179
SELECT col0 + - + col0 DIV + - 37 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
84

skipif mysql # not compatible
query I rowsort label-4179
SELECT col0 + - + col0 / + - 37 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
84

query I rowsort
SELECT col1 - - col2 + - 55 + ( col2 ) + + 30 - - col2 * + - col1 FROM tab1 GROUP BY col1, col2
----
-2443
-2963
-51

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col0 * - 64 * + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
118379
43290
440979

query I rowsort
SELECT + + col1 * + col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1640
3422
3660

query II rowsort
SELECT DISTINCT 78 - + col1 AS col1, - col2 FROM tab0 GROUP BY col2, col1
----
-3
-24
78
-38
78
-79

query I rowsort
SELECT + + 52 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT + - col1 * - 18 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
1026
108
792

query I rowsort
SELECT DISTINCT 28 AS col2 FROM tab0 GROUP BY col0
----
28

onlyif mysql # DIV for integer division: 
query I rowsort label-4188
SELECT ALL + 45 DIV + + 26 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4188
SELECT ALL + 45 / + + 26 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - col1 BETWEEN NULL AND - 42
----
0

query I rowsort
SELECT DISTINCT col1 * + + col1 * ( - col1 ) + + col1 FROM tab2 GROUP BY col1
----
-205320
-226920
-68880

query I rowsort
SELECT ALL - 88 FROM tab0 AS cor0 GROUP BY col0
----
-88
-88
-88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 61 col2 FROM tab1 AS cor0 GROUP BY col1
----
61
61
61

query I rowsort
SELECT ALL col1 * 7 FROM tab1 GROUP BY col1
----
308
399
42

query I rowsort
SELECT + 61 + + col0 AS col0 FROM tab2 GROUP BY col0, col1
----
152
153
76

query I rowsort
SELECT + + 71 FROM tab1 WHERE - + col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 * col0 AS col2 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT 66 AS col1 FROM tab2 AS cor0 WHERE + 59 <= col2 GROUP BY col1, col2, col1
----
66

query I rowsort
SELECT ALL + col0 + ( + col0 ) - + + col0 FROM tab2 GROUP BY col0 HAVING + + 9 > NULL
----

query I rowsort
SELECT DISTINCT - 35 FROM tab1 GROUP BY col0, col2
----
-35

query I rowsort
SELECT DISTINCT - 10 * - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
260
430
830

query I rowsort
SELECT ALL + - 57 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-57
-57
-57

query I rowsort
SELECT ALL - col1 * + 45 * - + 66 + + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
121811
175289
181231

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 31 col1 FROM tab0 cor0 GROUP BY col0
----
31

query I rowsort
SELECT ALL + 61 FROM tab1 AS cor0 GROUP BY col2, col2, col1 HAVING - + 45 <= - col2
----
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 90 AS col1, + 90 * + - col0 * ( - col0 ) col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING col0 * - - col0 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4206
SELECT CAST( 47 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col2
----
47
47
47

skipif mysql # not compatible
query I rowsort label-4206
SELECT CAST ( 47 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col2
----
47
47
47

query I rowsort
SELECT col2 * ( + 28 ) FROM tab1 GROUP BY col2
----
1260
1988
224

query I rowsort
SELECT 23 FROM tab1 WHERE NOT 58 * + - col0 <= - 49 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT + + 69 * - + 88 + + col1 FROM tab2 WHERE col1 IS NOT NULL GROUP BY col1, col1
----
-6011
-6013
-6031

query I rowsort
SELECT + ( - col0 ) FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1 + + - col1, + col1 FROM tab2 GROUP BY col1, col1
----
-118
59
-122
61
-82
41

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 WHERE NOT - 13 = ( NULL ) GROUP BY col2, col2 HAVING NOT - col2 = NULL
----

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( col0 <> NULL )
----

query II rowsort
SELECT ALL col0 * - col0 * + - 28 AS col0, col0 * - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
18928
676
192892
6889
51772
1849

query I rowsort
SELECT - 90 FROM tab1 cor0 GROUP BY col2 HAVING ( ( NOT 51 + AVG ( DISTINCT col1 ) IS NULL ) )
----
-90
-90
-90

query I rowsort
SELECT ALL + - 16 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( NULL = + 96 )
----

query I rowsort
SELECT - + 69 FROM tab0 AS cor0 GROUP BY col0
----
-69
-69
-69

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL BETWEEN - + 59 AND - - 51
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE ( col2 ) IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT - - 16 FROM tab1 AS cor0 GROUP BY col0, col2
----
16
16
16

onlyif mysql # DIV for integer division: 
query I rowsort label-4221
SELECT DISTINCT - - 58 DIV + col2 + + - col2 + - + col2 * col2 * + - ( + - col2 ) col0 FROM tab2 cor0 GROUP BY col2
----
-195169
-493118
-658590

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4221
SELECT DISTINCT - - 58 / + col2 + + - col2 + - + col2 * col2 * + - ( + - col2 ) col0 FROM tab2 cor0 GROUP BY col2
----
-195169
-493118
-658590

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4222
SELECT 14 + CAST( NULL AS SIGNED ) + CAST( - col0 AS SIGNED ) - + - col0 * - 87 * - + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL > ( + col0 )
----

skipif mysql # not compatible
query I rowsort label-4222
SELECT 14 + CAST ( NULL AS INTEGER ) + CAST ( - col0 AS INTEGER ) - + - col0 * - 87 * - + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL > ( + col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4223
SELECT - - col2 FROM tab0 AS cor0 WHERE NOT + + NULLIF ( - col2, - 50 ) * - col1 NOT BETWEEN - CAST( 19 AS SIGNED ) AND NULL OR NOT col2 IS NOT NULL GROUP BY col2 HAVING NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-4223
SELECT - - col2 FROM tab0 AS cor0 WHERE NOT + + NULLIF ( - col2, - 50 ) * - col1 NOT BETWEEN - CAST ( 19 AS INTEGER ) AND NULL OR NOT col2 IS NOT NULL GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT + - ( + + col2 ) AS col2 FROM tab0 cor0 WHERE NULL <= col0 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - 58 col2 FROM tab0 AS cor0 GROUP BY col1
----
-58
-58

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE + 53 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL + - 3 * - col0 - 63 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING + 41 NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4228
SELECT DISTINCT + + CAST( NULL AS SIGNED ) * - 20 + CAST( NULL AS SIGNED ) * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-4228
SELECT DISTINCT + + CAST ( NULL AS INTEGER ) * - 20 + CAST ( NULL AS INTEGER ) * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL

query II rowsort
SELECT - 78 AS col1, col1 FROM tab0 GROUP BY col1, col2
----
-78
0
-78
0
-78
81

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - - 96 FROM tab0 cor0 GROUP BY col1, col1
----
96
96

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4232
SELECT - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4232
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4233
SELECT - - col2 AS col2, col2 FROM tab1 WHERE NOT - - col0 * + + 72 IS NOT NULL GROUP BY col2, col1 HAVING NULL < CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query II rowsort label-4233
SELECT - - col2 AS col2, col2 FROM tab1 WHERE NOT - - col0 * + + 72 IS NOT NULL GROUP BY col2, col1 HAVING NULL < CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL col2 * - + col2 + 90 FROM tab1 GROUP BY col2
----
-1935
-4951
26

query I rowsort
SELECT DISTINCT - 59 * - 88 * - col2 + + + ( + - col2 ) FROM tab2 GROUP BY col2
----
-301194
-410247
-451791

query I rowsort
SELECT ALL - 99 AS col2 FROM tab0 cor0 WHERE NULL = 95 / + + CASE WHEN NOT 23 IS NOT NULL THEN col2 END GROUP BY col2, col2
----

query I rowsort
SELECT ( + + col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + 39 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) BETWEEN 93 AND NULL
----

query II rowsort
SELECT ( + + 46 ) AS col2, col0 - + + col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL NOT IN ( + 20 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4241
SELECT + CAST( NULL AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4241
SELECT + CAST ( NULL AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( - 57 )
----

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab1 WHERE + col1 >= col0 GROUP BY col2 HAVING NOT - 52 IS NULL
----
-45

query I rowsort
SELECT - 81 / - col1 FROM tab1 WHERE NULL NOT BETWEEN + col1 + + ( - col1 ) + - col1 AND NULL GROUP BY col1, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4245
SELECT - CAST( NULL AS SIGNED ) + col2 + - 65 AS col0 FROM tab1 AS cor0 WHERE NULL >= col2 GROUP BY col2 HAVING - - 74 IS NULL
----

skipif mysql # not compatible
query I rowsort label-4245
SELECT - CAST ( NULL AS INTEGER ) + col2 + - 65 AS col0 FROM tab1 AS cor0 WHERE NULL >= col2 GROUP BY col2 HAVING - - 74 IS NULL
----

query II rowsort
SELECT + 55, + col2 * + 60 + - - col1 / - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT NULL <= NULL ) OR col2 * + col2 = 88 * - col1 + + ( col2 )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-4247
SELECT + col0, CAST( NULL AS DECIMAL ) + - 52 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
NULL
91
NULL
92
NULL

skipif mysql # not compatible
query II rowsort label-4247
SELECT + col0, CAST ( NULL AS REAL ) + - 52 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
NULL
91
NULL
92
NULL

query I rowsort
SELECT - 52 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT ALL 75 AS col0 FROM tab2 GROUP BY col2
----
75
75
75

query I rowsort
SELECT DISTINCT - AVG ( - 65 ) * + col1 - + 87 FROM tab2 GROUP BY col1, col2 HAVING + + col1 * - col2 = + - 85
----

query I rowsort
SELECT - 59 + - col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING + - col0 IN ( + - 61 )
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-4252
SELECT col1 * - 87 + + col1 DIV - - 13 + 67 - - - col1 * + col1 * - + CAST( + COALESCE ( ( - col1 ), - col1 * - col1 ) AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
-538415
67

skipif mysql # not compatible
query I rowsort label-4252
SELECT col1 * - 87 + + col1 / - - 13 + 67 - - - col1 * + col1 * - + CAST ( + COALESCE ( ( - col1 ), - col1 * - col1 ) AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
-538415
67

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 WHERE - col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT + col0 * col1 + 73 FROM tab1 AS cor0 GROUP BY col1, col0
----
1669
205
3681

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING + 95 NOT BETWEEN NULL AND col2
----
15
91
92

query I rowsort
SELECT - col0 + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-124
-26
-83

query I rowsort
SELECT DISTINCT + 40 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + - 95 * - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IN ( 7 )
----

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE ( NULL ) NOT IN ( col0 + - col1 * col1 ) GROUP BY col0, col2, col0 HAVING NULL <= - 41
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT NULL < ( col0 )
----

query I rowsort
SELECT ALL 8 * 96 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
768
768
768

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL <= - AVG ( DISTINCT - 52 ) * + 85
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 96 col2 FROM tab1 GROUP BY col1
----
96
96
96

query I rowsort
SELECT ALL + 1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT col2 * 17 IN ( + 32 )
----
1
1
1

query I rowsort
SELECT DISTINCT ( - 17 ) AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-17

query I rowsort
SELECT ALL + 54 FROM tab2 WHERE NOT col1 = ( + col1 + + col0 * + col1 ) GROUP BY col2
----
54
54
54

query I rowsort
SELECT ALL 19 AS col0 FROM tab0 WHERE NOT NULL IN ( col2 ) GROUP BY col0 HAVING ( NULL ) <= ( col0 )
----

query I rowsort
SELECT DISTINCT 91 AS col0 FROM tab0 AS cor0 WHERE NOT col2 * + 50 * - col1 - - col1 / col2 < NULL GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 11 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4271
SELECT - + ( col2 ) + + 31 + 77 DIV col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( AVG ( col1 ) ) <= ( - col2 )
----
-26
-48
-56

skipif mysql # not compatible
query I rowsort label-4271
SELECT - + ( col2 ) + + 31 + 77 / col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( AVG ( col1 ) ) <= ( - col2 )
----
-26
-48
-56

query I rowsort
SELECT + col1 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 * - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * - col2 + + ( - + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
-1482
-600
-6320

query I rowsort
SELECT 52 * - 53 FROM tab0 GROUP BY col1
----
-2756
-2756

query I rowsort
SELECT col2 * col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - + col2 - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
-116
-158
-174

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4279
SELECT 66 + + 68 * CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4279
SELECT 66 + + 68 * CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING + - col0 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT + col2 * + + 95 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
2280
3610
7505

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 70 FROM tab2 GROUP BY col2
----
70
70
70

query I rowsort
SELECT DISTINCT 31 FROM tab2 GROUP BY col0
----
31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4285
SELECT DISTINCT + col2 + - + CAST( 60 AS SIGNED ) * col1 FROM tab0 GROUP BY col2, col1
----
-4836
38
79

skipif mysql # not compatible
query I rowsort label-4285
SELECT DISTINCT + col2 + - + CAST ( 60 AS INTEGER ) * col1 FROM tab0 GROUP BY col2, col1
----
-4836
38
79

query I rowsort
SELECT - col0 * - col2 FROM tab2 GROUP BY col2, col2, col0
----
1305
5336
7189

query I rowsort
SELECT DISTINCT col1 * - col1 + + col2 FROM tab1 GROUP BY col2, col1
----
-1865
-28
-3204

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL <> ( - col0 )
----

query I rowsort
SELECT 90 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
90
90
90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4290
SELECT DISTINCT 1 + AVG ( DISTINCT col0 + - 52 ) col1 FROM tab2 GROUP BY col0, col0 HAVING NOT - 0 / col0 NOT BETWEEN ( CAST( - 16 AS SIGNED ) ) AND - 49
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4290
SELECT DISTINCT 1 + AVG ( DISTINCT col0 + - 52 ) col1 FROM tab2 GROUP BY col0, col0 HAVING NOT - 0 / col0 NOT BETWEEN ( CAST ( - 16 AS INTEGER ) ) AND - 49
----

query I rowsort
SELECT + 73 FROM tab1 GROUP BY col2, col2
----
73
73
73

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1 HAVING col1 * - 68 < - 85
----
-81

query I rowsort
SELECT - 50 + 85 * col1 FROM tab0 GROUP BY col1 HAVING NOT ( 69 ) = - 65
----
-50
6835

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4294
SELECT + 12 AS col2 FROM tab1 GROUP BY col2, col1 HAVING + CAST( + 33 AS SIGNED ) <= col2
----
12
12

skipif mysql # not compatible
query I rowsort label-4294
SELECT + 12 AS col2 FROM tab1 GROUP BY col2, col1 HAVING + CAST ( + 33 AS INTEGER ) <= col2
----
12
12

query I rowsort
SELECT - ( + 63 ) AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-63
-63
-63

query I rowsort
SELECT ALL - + 52 AS col1 FROM tab2 WHERE NOT + 57 + - + ( - col2 ) + + col2 BETWEEN NULL AND + col2 * - col1 GROUP BY col0, col1
----
-52
-52
-52

query I rowsort
SELECT ALL NULLIF ( 63, + - col1 ) FROM tab0 AS cor0 GROUP BY col1, col1
----
63
63

query I rowsort
SELECT DISTINCT - 13 + - - col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 WHERE + + col1 <= NULL GROUP BY col1
----

query I rowsort
SELECT - 42 FROM tab0 AS cor0 GROUP BY col1
----
-42
-42

query I rowsort
SELECT ALL - + 45 FROM tab0 cor0 GROUP BY col1, col1
----
-45
-45

query I rowsort
SELECT - 30 + - + 1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-31
-31
-31

query I rowsort
SELECT - col2 FROM tab2 cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 / col1 * + col2 * - col2 FROM tab2 AS cor0 WHERE NOT NULL >= NULL GROUP BY col1, col2
----

query I rowsort
SELECT col2 * + ( col2 ) FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT + 30 * - col2 = + - col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE - col1 IS NULL AND NULL IS NULL GROUP BY col0, col2, col1 HAVING col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * - - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * col1 * col1 + + col1 col1 FROM tab1 GROUP BY col1
----
185250
222
85228

query I rowsort
SELECT + 76 FROM tab0 GROUP BY col0
----
76
76
76

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col1, col1
----
22
28
82

query II rowsort
SELECT - 23, col2 FROM tab0 GROUP BY col2, col2
----
-23
24
-23
38
-23
79

query I rowsort
SELECT - 67 FROM tab0 AS cor0 GROUP BY col0, col1
----
-67
-67
-67

query I rowsort
SELECT - ( - col1 ) + + - 87 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-26
-28
-46

query I rowsort
SELECT - col1 / + ( - 16 ) + col1 AS col0 FROM tab0 AS cor0 WHERE + col0 * col0 <= NULL GROUP BY col1
----

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT - 15 IS NOT NULL
----

query II rowsort
SELECT 62 AS col0, col1 * - + 80 + + CASE - 88 WHEN + 10 THEN + - 94 END FROM tab2 GROUP BY col1, col1
----
62
NULL
62
NULL
62
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4317
SELECT DISTINCT 35 AS col1 FROM tab1 WHERE NOT ( ( + - col1 < + col1 * + + col0 ) ) GROUP BY col2 HAVING NOT col2 * col2 - col2 - CAST( + + 50 AS SIGNED ) * + 7 < NULL
----

skipif mysql # not compatible
query I rowsort label-4317
SELECT DISTINCT 35 AS col1 FROM tab1 WHERE NOT ( ( + - col1 < + col1 * + + col0 ) ) GROUP BY col2 HAVING NOT col2 * col2 - col2 - CAST ( + + 50 AS INTEGER ) * + 7 < NULL
----

query I rowsort
SELECT ALL - CASE - + 19 WHEN - col0 THEN NULL WHEN - 64 THEN NULL ELSE 91 END FROM tab2 GROUP BY col0
----
-91
-91
-91

query I rowsort
SELECT ALL - 72 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4320
SELECT DISTINCT - col0 col2 FROM tab0 AS cor0 WHERE + 44 > col2 + + - 76 GROUP BY col0, col0 HAVING - col0 NOT BETWEEN + col0 * 90 AND ( + - CAST( col0 AS SIGNED ) + - 13 - col0 * + col0 )
----
-26
-43
-83

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4320
SELECT DISTINCT - col0 col2 FROM tab0 AS cor0 WHERE + 44 > col2 + + - 76 GROUP BY col0, col0 HAVING - col0 NOT BETWEEN + col0 * 90 AND ( + - CAST ( col0 AS INTEGER ) + - 13 - col0 * + col0 )
----
-26
-43
-83

query I rowsort
SELECT col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - + 82 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-82
-82
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4323
SELECT DISTINCT + 65 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + ( + + col0 ) * + + CAST( NULL AS SIGNED ) * 22 NOT BETWEEN 66 * + col0 * - + 55 + + 82 + + col0 AND NULL
----

skipif mysql # not compatible
query I rowsort label-4323
SELECT DISTINCT + 65 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + ( + + col0 ) * + + CAST ( NULL AS INTEGER ) * 22 NOT BETWEEN 66 * + col0 * - + 55 + + 82 + + col0 AND NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + 87 IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 65, col2 * - col2 / - col2 + + col2 + - 26 + col0, + - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= + - col0
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 WHERE NOT col0 + col2 * col2 IS NOT NULL GROUP BY col0, col2, col2 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL - col1 * + col2 FROM tab0 GROUP BY col1, col2 HAVING + + col1 IS NOT NULL
----
-1944
0
0

query I rowsort
SELECT DISTINCT + col1 * col1 / col1 / + 48 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4330
SELECT DISTINCT + 16 DIV col0 * - col1 * - 82 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
0
5002

skipif mysql # not compatible
query I rowsort label-4330
SELECT DISTINCT + 16 / col0 * - col1 * - 82 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
0
5002

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 68 * - col2 + - col2 col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL < - 46
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4332
SELECT + CAST( NULL AS SIGNED ) FROM tab0 cor0 GROUP BY col2 HAVING NOT ( ( NULL IS NULL ) )
----

skipif mysql # not compatible
query I rowsort label-4332
SELECT + CAST ( NULL AS INTEGER ) FROM tab0 cor0 GROUP BY col2 HAVING NOT ( ( NULL IS NULL ) )
----

query II rowsort
SELECT - col1 * 62 + 54 AS col2, col1 FROM tab1 AS cor0 GROUP BY col1
----
-2674
44
-318
6
-3480
57

query I rowsort
SELECT col2 + + col2 + - + col2 * col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
-3248
-6083
-7395

onlyif mysql # DIV for integer division: 
query I rowsort label-4335
SELECT ( + - col1 ) DIV col2 * + + col2 FROM tab1 GROUP BY col2, col0, col1
----
-45
0
0

skipif mysql # not compatible
query I rowsort label-4335
SELECT ( + - col1 ) / col2 * + + col2 FROM tab1 GROUP BY col2, col0, col1
----
-45
0
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4336
SELECT + 66 * CASE - col2 WHEN + COALESCE ( - 84, col2, - col0, - COALESCE ( + 50, + 30, col2 * + col0 ) ) / - - 23 THEN NULL WHEN 14 + + + 36 THEN - + NULLIF ( - col2, - + col2 ) END * - + 0 + + col0 * + CAST( + 27 AS DECIMAL ) col1 FROM tab1 GROUP BY col2, col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4336
SELECT + 66 * CASE - col2 WHEN + COALESCE ( - 84, col2, - col0, - COALESCE ( + 50, + 30, col2 * + col0 ) ) / - - 23 THEN NULL WHEN 14 + + + 36 THEN - + NULLIF ( - col2, - + col2 ) END * - + 0 + + col0 * + CAST ( + 27 AS REAL ) col1 FROM tab1 GROUP BY col2, col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col2 * + col2 * + col2 * - col2 FROM tab0 GROUP BY col2
----
2085136
331776
38950081

query I rowsort
SELECT DISTINCT col0 * - + 96 * col0 FROM tab0 GROUP BY col1, col0
----
-177504
-64896
-661344

query II rowsort
SELECT + + col2 + + - 97 + 8, col1 * col2 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
-18
3124
-44
2565
-81
48

query I rowsort
SELECT DISTINCT + 11 * - 95 AS col2 FROM tab2 WHERE NOT + 30 / + 49 <> NULL GROUP BY col1
----

query I rowsort
SELECT - 23 FROM tab1 GROUP BY col0
----
-23
-23
-23

query I rowsort
SELECT col2 * col2 + + 60 AS col1 FROM tab1 GROUP BY col2
----
124
2085
5101

query I rowsort
SELECT DISTINCT + col2 + + - col2 FROM tab2 GROUP BY col2
----
0

query I rowsort
SELECT - ( - + col2 ) FROM tab2 GROUP BY col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4345
SELECT + col2 * + 56 * - col2 AS col0 FROM tab0 WHERE NOT ( col1 ) * CAST( NULL AS SIGNED ) IS NULL GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-4345
SELECT + col2 * + 56 * - col2 AS col0 FROM tab0 WHERE NOT ( col1 ) * CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT 42 FROM tab2 AS cor0 GROUP BY col0
----
42
42
42

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4347
SELECT - - col2 / col2 * - CAST( NULL AS SIGNED ) * - - col2 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4347
SELECT - - col2 / col2 * - CAST ( NULL AS INTEGER ) * - - col2 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4348
SELECT ALL - col1 - - + CAST( NULL AS SIGNED ), CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col2, col1
----
NULL
NULL
NULL
NULL
NULL
NULL

skipif mysql # not compatible
query II rowsort label-4348
SELECT ALL - col1 - - + CAST ( NULL AS INTEGER ), CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col2, col1
----
NULL
NULL
NULL
NULL
NULL
NULL

query I rowsort
SELECT + + 12 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
12
12
12

query II rowsort
SELECT DISTINCT + col0 AS col1, col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT ( + col1 ) + + ( - col1 ) FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 37 FROM tab0 AS cor0 GROUP BY col0, col2
----
37

query I rowsort
SELECT DISTINCT col0 - + col0 FROM tab1 cor0 WHERE NOT 7 = ( col0 + + col0 ) GROUP BY col0
----
0

query I rowsort
SELECT + 90 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IN ( + 87 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4355
SELECT - CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1 HAVING ( NULL ) > - col1
----

skipif mysql # not compatible
query I rowsort label-4355
SELECT - CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1 HAVING ( NULL ) > - col1
----

query I rowsort
SELECT + - col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL col1 * ( + - col0 ) FROM tab0 GROUP BY col1, col0 HAVING + 52 + - col0 * + 98 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL 54 * - 57 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col0 HAVING NOT NULL NOT BETWEEN ( - col1 ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 WHERE ( NULL ) <> ( NULL ) GROUP BY col0, col2, col0 HAVING - col2 >= 17 * - ( AVG ( - ( col1 ) ) )
----

query I rowsort
SELECT - col2 / + col2 FROM tab1 AS cor0 WHERE ( ( NULL ) IS NOT NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col1 HAVING NULL NOT IN ( + 23 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4364
SELECT 76 * + - col2 * col0 - + CAST( NULL AS SIGNED ) * col0 FROM tab2 GROUP BY col0, col2 HAVING - COALESCE ( 5, - 52 + + col0 ) NOT BETWEEN NULL AND ( - 53 * - CAST( - 15 AS SIGNED ) )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4364
SELECT 76 * + - col2 * col0 - + CAST ( NULL AS INTEGER ) * col0 FROM tab2 GROUP BY col0, col2 HAVING - COALESCE ( 5, - 52 + + col0 ) NOT BETWEEN NULL AND ( - 53 * - CAST ( - 15 AS INTEGER ) )
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 + + 49 FROM tab0 GROUP BY col0
----
132
75
92

query I rowsort
SELECT ALL - - 35 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
35
35
35

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-4367
SELECT DISTINCT CAST( NULL AS SIGNED ) * + col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT + col1 = ( - CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-4367
SELECT DISTINCT CAST ( NULL AS INTEGER ) * + col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT + col1 = ( - CAST ( NULL AS REAL ) )
----

onlyif mysql # DIV for integer division: 
query II rowsort label-4368
SELECT ALL + col1, - ( + + 29 ) DIV - col1 + + - 64 FROM tab2 GROUP BY col1, col2
----
41
-64
59
-64
61
-64

skipif mysql # not compatible
query II rowsort label-4368
SELECT ALL + col1, - ( + + 29 ) / - col1 + + - 64 FROM tab2 GROUP BY col1, col2
----
41
-64
59
-64
61
-64

query I rowsort
SELECT - col2 + - - 76 AS col2 FROM tab2 GROUP BY col0, col2, col2
----
-11
-3
18

query I rowsort
SELECT ALL - col1 + + - ( - + 53 ) FROM tab0 GROUP BY col1
----
-28
53

query II rowsort
SELECT ALL col1, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT + col1 FROM tab1 WHERE NOT 34 * - + col0 IN ( - ( + - col2 ) ) GROUP BY col1 HAVING NOT ( - 67 ) IS NOT NULL
----

query I rowsort
SELECT 35 * ( col1 ) FROM tab1 AS cor0 WHERE NOT col1 / col1 NOT BETWEEN NULL AND ( col2 ) GROUP BY col1, col1
----

query I rowsort
SELECT 44 FROM tab1 AS cor0 GROUP BY col1
----
44
44
44

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4375
SELECT - CAST( NULL AS SIGNED ) AS col2, 33 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
33
NULL
33
NULL
33

skipif mysql # not compatible
query II rowsort label-4375
SELECT - CAST ( NULL AS INTEGER ) AS col2, 33 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
33
NULL
33
NULL
33

query I rowsort
SELECT - + 42 + col1 - + 33 + - - col1 / col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - 5 * + + col0 + col0 AS col0 FROM tab1 GROUP BY col2, col0, col0 HAVING NULL > + col2
----

query I rowsort
SELECT DISTINCT col1 + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
102
115
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4379
SELECT DISTINCT 5 + + CAST( NULL AS SIGNED ) - - col1 + + - col1 / + 3 AS col2 FROM tab2 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4379
SELECT DISTINCT 5 + + CAST ( NULL AS INTEGER ) - - col1 + + - col1 / + 3 AS col2 FROM tab2 GROUP BY col1
----
NULL

query II rowsort
SELECT DISTINCT COALESCE ( 95, 6 ), + ( - col0 ) AS col1 FROM tab1 GROUP BY col0
----
95
-22
95
-28
95
-82

query I rowsort
SELECT + ( col2 ) + col1 FROM tab0 GROUP BY col1, col1, col2
----
105
38
79

query I rowsort
SELECT DISTINCT 7 + + col0 AS col2 FROM tab2 GROUP BY col0
----
22
98
99

query I rowsort
SELECT ALL 89 FROM tab0 GROUP BY col0
----
89
89
89

query I rowsort
SELECT DISTINCT - 92 AS col0 FROM tab1 GROUP BY col0, col1
----
-92

query I rowsort
SELECT col0 + - col0 AS col2 FROM tab0 WHERE NOT ( col1 / col2 ) BETWEEN col0 * - 49 AND col0 GROUP BY col0 HAVING NULL <> - 16 * + 51
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
41
59
61

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0 HAVING NOT ( 63 ) IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col1 HAVING NOT ( - AVG ( DISTINCT + col0 ) ) IS NOT NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 + - - ( - 75 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + ( - - 34 ) - - 10 + + ( + + col1 ) FROM tab1 GROUP BY col0, col1
----
101
50
88

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 59 + + col0 - col0 * + + col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING ( - ( col0 ) >= NULL )
----

query I rowsort
SELECT DISTINCT - + 3 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-3

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 WHERE NOT - col1 > + col2 + - col1 * col2 GROUP BY col2
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4397
SELECT DISTINCT ( - col2 ) * + col2 + col2 AS col1 FROM tab2 AS cor0 WHERE NOT col1 BETWEEN - CAST( 37 AS DECIMAL ) + col1 * - 95 AND - - col1 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-4397
SELECT DISTINCT ( - col2 ) * + col2 + col2 AS col1 FROM tab2 AS cor0 WHERE NOT col1 BETWEEN - CAST ( 37 AS REAL ) + col1 * - 95 AND - - col1 GROUP BY col2
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4398
SELECT col0 / + - col0 + - ( CAST( NULL AS DECIMAL ) ) col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4398
SELECT col0 / + - col0 + - ( CAST ( NULL AS REAL ) ) col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 20 FROM tab1 GROUP BY col2
----
-20
-20
-20

query I rowsort
SELECT col2 * - + col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - + col0 + - col0 * + - ( + ( col0 ) ) FROM tab2 AS cor0 GROUP BY col0
----
210
8190
8372

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4402
SELECT DISTINCT + + col1 * + - col1 AS col1, col1 * - 13 * + + 18 * - 84 + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1
----
-6561
NULL
0
NULL

skipif mysql # not compatible
query II rowsort label-4402
SELECT DISTINCT + + col1 * + - col1 AS col1, col1 * - 13 * + + 18 * - 84 + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1
----
-6561
NULL
0
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 * + 49, - col0 col1 FROM tab0 GROUP BY col0, col0
----
1274
-26
2107
-43
4067
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 76 + + - col2 col1 FROM tab1 GROUP BY col2, col2 HAVING col2 / 92 <= 30
----
31
5
68

onlyif mysql # DIV for integer division: 
query I rowsort label-4405
SELECT ALL + col1 DIV - - 14 + col1 FROM tab0 GROUP BY col1
----
0
86

skipif mysql # not compatible
query I rowsort label-4405
SELECT ALL + col1 / - - 14 + col1 FROM tab0 GROUP BY col1
----
0
86

query II rowsort
SELECT col2, + 55 AS col0 FROM tab0 GROUP BY col2
----
24
55
38
55
79
55

query I rowsort
SELECT + - col1 * + col1 - + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-38
-6585
-79

onlyif mysql # DIV for integer division: 
query II rowsort label-4408
SELECT DISTINCT - + col0 AS col2, col0 DIV + - col0 FROM tab1 AS cor0 WHERE col2 * + - 2 + + col1 IS NOT NULL GROUP BY col0 HAVING ( NULL ) IS NULL
----
-22
-1
-28
-1
-82
-1

skipif mysql # not compatible
query II rowsort label-4408
SELECT DISTINCT - + col0 AS col2, col0 / + - col0 FROM tab1 AS cor0 WHERE col2 * + - 2 + + col1 IS NOT NULL GROUP BY col0 HAVING ( NULL ) IS NULL
----
-22
-1
-28
-1
-82
-1

query I rowsort
SELECT - col0 * 87 * - col1 FROM tab0 WHERE NOT col1 BETWEEN 67 + 65 AND - 41 / - col1 + + + col0 * + col1 * col2 / - col0 GROUP BY col1, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - - col1 ) + + 43 FROM tab2 GROUP BY col1, col1, col1
----
102
104
84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + 12 > 83
----
0
81

query I rowsort
SELECT 80 - + 92 FROM tab1 GROUP BY col2
----
-12
-12
-12

query II rowsort
SELECT ALL col0, + ( col0 ) + + ( 54 ) FROM tab2 GROUP BY col0
----
15
69
91
145
92
146

query I rowsort
SELECT DISTINCT - 77 * + - 9 AS col0 FROM tab2 GROUP BY col1
----
693

query I rowsort
SELECT DISTINCT 54 AS col1 FROM tab2 GROUP BY col1, col2
----
54

query I rowsort
SELECT DISTINCT + 76 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
76

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4417
SELECT + + ( + col2 ) * + CAST( - + 4 AS SIGNED ) - + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-114
-237
-72

skipif mysql # not compatible
query I rowsort label-4417
SELECT + + ( + col2 ) * + CAST ( - + 4 AS INTEGER ) - + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-114
-237
-72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col0 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT + 30 FROM tab0 AS cor0 GROUP BY col1
----
30
30

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING 75 IS NOT NULL
----
24
38
79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - 12 * col0 AS col0 FROM tab2 GROUP BY col1, col0
----
-1092
-1104
-180

query I rowsort
SELECT col2 / + + col1 * + col1 + + col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL 87 FROM tab2 cor0 GROUP BY col0, col0
----
87
87
87

query I rowsort
SELECT ALL - 70 AS col1 FROM tab0 GROUP BY col0, col2, col1
----
-70
-70
-70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 61 * - col0 col1 FROM tab2 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-5551
-5612
-915

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4427
SELECT DISTINCT CAST( NULL AS DECIMAL ) FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4427
SELECT DISTINCT CAST ( NULL AS REAL ) FROM tab0 GROUP BY col2
----
NULL

query II rowsort
SELECT 35 + - col0, - 18 AS col2 FROM tab0 GROUP BY col0
----
-48
-18
-8
-18
9
-18

query II rowsort
SELECT DISTINCT 52 AS col2, + 58 FROM tab2 AS cor0 GROUP BY col2
----
52
58

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL + ( + + col0 ) FROM tab0 AS cor0 WHERE NOT + col2 / - + ( - 95 ) IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + 5 FROM tab1 AS cor0 GROUP BY col0, col1
----
5
5
5

query II rowsort
SELECT DISTINCT col2 AS col2, + col2 FROM tab0 GROUP BY col2, col0
----
24
24
38
38
79
79

onlyif mysql # CAST syntax: DECIMAL type: DIV for integer division: 
query I rowsort label-4434
SELECT + 59 DIV - col2 FROM tab2 GROUP BY col1, col2, col2 HAVING + + CAST( - - 68 AS DECIMAL ) * + ( - + ( - ( - 7 ) ) ) + + ( + AVG ( + col0 ) ) + 72 <= - - 13
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-4434
SELECT + 59 / - col2 FROM tab2 GROUP BY col1, col2, col2 HAVING + + CAST ( - - 68 AS REAL ) * + ( - + ( - ( - 7 ) ) ) + + ( + AVG ( + col0 ) ) + 72 <= - - 13
----
-1
0
0

query I rowsort
SELECT + 79 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
79
79
79

query I rowsort
SELECT DISTINCT + 63 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN - col2 / col2 AND + col0 + 11
----

query I rowsort
SELECT ALL + 31 * ( - 72 ) + + + col2 FROM tab1 GROUP BY col1, col2
----
-2161
-2187
-2224

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 78 AS col1 FROM tab0 GROUP BY col0
----
78
78
78

query I rowsort
SELECT + col2 - - 89 AS col1 FROM tab0 GROUP BY col2
----
113
127
168

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4441
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT + CAST( NULL AS SIGNED ) <= - - col0
----

skipif mysql # not compatible
query I rowsort label-4441
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT + CAST ( NULL AS INTEGER ) <= - - col0
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col0, col0, col2
----
-15
-91
-92

query II rowsort
SELECT DISTINCT col2, ( col2 ) * + col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1 HAVING NOT col1 NOT IN ( + col1, ( - + col1 ) )
----

query II rowsort
SELECT + + 98 * - col0 AS col1, col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-2548
26
-4214
43
-8134
83

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL <> - col1 + - - 94
----

query I rowsort
SELECT - - 14 FROM tab2 AS cor0 GROUP BY col0, col1
----
14
14
14

query I rowsort
SELECT 85 FROM tab2 AS cor0 GROUP BY col1 HAVING ( col1 IS NOT NULL )
----
85
85
85

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING ( NOT 14 > - - 68 / + 4 )
----
22
28
82

query I rowsort
SELECT ALL + 30 + + ( - - col0 ) FROM tab2 GROUP BY col0
----
121
122
45

query I rowsort
SELECT 5 FROM tab0 AS cor0 WHERE + 25 IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4452
SELECT DISTINCT 68, + col1 * + CAST( col1 AS SIGNED ) col2 FROM tab0 GROUP BY col1
----
68
0
68
6561

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4452
SELECT DISTINCT 68, + col1 * + CAST ( col1 AS INTEGER ) col2 FROM tab0 GROUP BY col1
----
68
0
68
6561

query I rowsort
SELECT 32 - col0 AS col1 FROM tab2 GROUP BY col0 HAVING - 23 - - + col0 IS NULL
----

query I rowsort
SELECT ALL ( - col0 ) FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query II rowsort
SELECT DISTINCT col2 + + col2 - col2, col2 * - col2 FROM tab1 GROUP BY col2 HAVING NOT NULL <> + 83
----

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT - 75 IS NULL
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-4458
SELECT 65 DIV + 4 FROM tab0 AS cor0 GROUP BY col2
----
16
16
16

skipif mysql # not compatible
query I rowsort label-4458
SELECT 65 / + 4 FROM tab0 AS cor0 GROUP BY col2
----
16
16
16

query I rowsort
SELECT ALL - 80 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT 47 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + + col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT DISTINCT - + 40 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-40

query I rowsort
SELECT DISTINCT - ( - col1 ) * + + col1 + col1 FROM tab1 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT + + 9 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL - ( + ( - 24 ) ) FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
24
24
24

query I rowsort
SELECT + 63 - 51 FROM tab0 AS cor0 GROUP BY col1
----
12
12

query I rowsort
SELECT DISTINCT + - 26 * col1 + - - col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1144
-1482
-156

query I rowsort
SELECT ALL 88 FROM tab0 AS cor0 GROUP BY col1
----
88
88

query I rowsort
SELECT - 29 AS col0 FROM tab1 cor0 GROUP BY col2
----
-29
-29
-29

onlyif mysql # DIV for integer division: 
query I rowsort label-4469
SELECT ALL col2 DIV - + ( - + col2 ) FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4469
SELECT ALL col2 / - + ( - + col2 ) FROM tab2 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT 98 FROM tab1 GROUP BY col1, col1
----
98
98
98

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col2 * - + 74 / + 81 FROM tab0 AS cor0 WHERE + 8 * + col0 * - ( col2 ) <= ( - 89 ) * - - 71 GROUP BY col2 HAVING NOT NULL < ( NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4474
SELECT col1 * + CAST( NULL AS DECIMAL ) * - 64 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4474
SELECT col1 * + CAST ( NULL AS REAL ) * - 64 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 96 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
96
96
96

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
22
-22
28
-28
82
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4477
SELECT ALL - CAST( NULL AS SIGNED ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4477
SELECT ALL - CAST ( NULL AS INTEGER ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT 90 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 WHERE NULL BETWEEN ( NULL ) AND 51 * - col1 * col0 GROUP BY col0
----

query I rowsort
SELECT + - 99 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-8019
0

query II rowsort
SELECT ALL + + 11, col1 * + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT DISTINCT 52 AS col0 FROM tab0 GROUP BY col1 HAVING + 70 IS NULL
----

query I rowsort
SELECT - ( - 44 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4485
SELECT DISTINCT col2 + - + 69 DIV + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
0
44
71

skipif mysql # not compatible
query I rowsort label-4485
SELECT DISTINCT col2 + - + 69 / + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
0
44
71

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 + + col1 + - col1 * - col1 + - col2 - - col1 AS col0 FROM tab2 AS cor0 WHERE - col2 + - 42 IS NULL GROUP BY col1, col2, col1 HAVING ( NULL ) NOT BETWEEN col0 AND - col0 / - - col0 * col0 + col2
----

query I rowsort
SELECT ALL col2 * - - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT 79 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING NOT + 20 IS NULL
----
79
79
79

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 44 col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING + col0 > - - 80
----
-44
-44

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT ( col2 * - col0 ) <> NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4492
SELECT DISTINCT + CAST( NULL AS SIGNED ) + - - col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT + - col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4492
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + - - col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT + - col0 IS NOT NULL
----

query I rowsort
SELECT + 86 + - 85 FROM tab2 AS cor0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT DISTINCT 28 AS col1 FROM tab2 GROUP BY col2
----
28

query I rowsort
SELECT ALL 98 * + - 38 FROM tab1 WHERE NOT NULL BETWEEN + + col0 AND - + col1 / + 60 GROUP BY col2, col2
----

query II rowsort
SELECT + col1, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
82
57
28
6
22

query I rowsort
SELECT col2 - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
142
16
90

query I rowsort
SELECT ALL + - col1 * - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query II rowsort
SELECT ALL col2 AS col2, + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
45
71
71
8
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 61 col2, - col0 AS col1 FROM tab0 GROUP BY col0
----
61
-26
61
-43
61
-83

query I rowsort
SELECT col2 + + 48 AS col0 FROM tab0 GROUP BY col2
----
127
72
86

onlyif mysql # DIV for integer division: 
query I rowsort label-4502
SELECT + 75 DIV - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4502
SELECT + 75 / - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * 6 col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT 37 - - 35 * 4 <= - - AVG ( ALL 74 )
----
45
71
8

query I rowsort
SELECT + col2 - 57 AS col2 FROM tab0 GROUP BY col2
----
-19
-33
22

query I rowsort
SELECT 18 AS col2 FROM tab1 WHERE NOT ( - col0 ) = NULL GROUP BY col2
----

query I rowsort
SELECT 76 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
76
76
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + ( - - col2 ) + + col2 col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL <= - - 93
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4509
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 WHERE ( - 5 ) IS NULL GROUP BY col0, col2 HAVING - - col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4509
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 WHERE ( - 5 ) IS NULL GROUP BY col0, col2 HAVING - - col0 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4510
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-4510
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-4511
SELECT - - col0 / 19 * 7 + - col0 * + CAST( - col0 AS DECIMAL ) - + + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( - ( - col1 ) ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4511
SELECT - - col0 / 19 * 7 + - col0 * + CAST ( - col0 AS REAL ) - + + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( - ( - col1 ) ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col0, - col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
44
-1936
57
-3249
6
-36

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL 61 AS col2 FROM tab0 GROUP BY col1
----
61
61

query I rowsort
SELECT DISTINCT + 91 FROM tab1 AS cor0 GROUP BY col0, col2
----
91

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4516
SELECT 42 FROM tab1 GROUP BY col0, col1, col0 HAVING NOT col1 * + - 72 * - col0 * - - 38 * - - 41 = + col1 + + - CAST( + - 98 AS SIGNED ) + + - 56
----
42
42
42

skipif mysql # not compatible
query I rowsort label-4516
SELECT 42 FROM tab1 GROUP BY col0, col1, col0 HAVING NOT col1 * + - 72 * - col0 * - - 38 * - - 41 = + col1 + + - CAST ( + - 98 AS INTEGER ) + + - 56
----
42
42
42

query I rowsort
SELECT - - 40 FROM tab2 cor0 GROUP BY col1, col0
----
40
40
40

query I rowsort
SELECT 82 + + 91 * + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
4177
6543
810

query I rowsort
SELECT DISTINCT + 92 FROM tab2 WHERE + col0 + + 0 IS NULL GROUP BY col1
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NOT + 39 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 + - + 11 * + col2 + - ( + col2 ) AS col2 FROM tab0 GROUP BY col1, col2 HAVING NULL >= + col2
----

query I rowsort
SELECT DISTINCT + 87 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
87

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NULL > NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-4524
SELECT + ( - - col2 ) + col2 + - col2 * + - col2 + + + 61 * - CAST( NULL AS SIGNED ) AS col0 FROM tab2 cor0 WHERE NOT - col0 + + ( + - 18 ) + + - CAST( NULL AS DECIMAL ) IS NOT NULL GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4524
SELECT + ( - - col2 ) + col2 + - col2 * + - col2 + + + 61 * - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 cor0 WHERE NOT - col0 + + ( + - 18 ) + + - CAST ( NULL AS REAL ) IS NOT NULL GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT 30 FROM tab2 AS cor0 GROUP BY col0, col1
----
30
30
30

query I rowsort
SELECT 97 FROM tab2 GROUP BY col1
----
97
97
97

query I rowsort
SELECT - ( + col0 ) FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - - 32 FROM tab0 AS cor0 GROUP BY col1
----
32
32

query II rowsort
SELECT DISTINCT - 4 AS col0, - 20 + - - 97 * - col1 * 53 FROM tab2 GROUP BY col1
----
-4
-210801
-4
-303339
-4
-313621

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4530
SELECT - ( - + CAST( + 34 AS SIGNED ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4530
SELECT - ( - + CAST ( + 34 AS INTEGER ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

query I rowsort
SELECT - col1 * + - col1 * + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
185193
216
85184

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4532
SELECT ALL + CAST( NULL AS SIGNED ) * + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4532
SELECT ALL + CAST ( NULL AS INTEGER ) * + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4533
SELECT + 21 DIV col2 + - - col0 * - 18 + + + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-1394
-372
-476

skipif mysql # not compatible
query I rowsort label-4533
SELECT + 21 / col2 + - - col0 * - 18 + + + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-1394
-372
-476

query II rowsort
SELECT - - 33, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
33
41
33
59
33
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 74 col2 FROM tab0 GROUP BY col1
----
-74
-74

onlyif mysql # DIV for integer division: 
query I rowsort label-4536
SELECT 52 DIV - 64 col0 FROM tab2 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4536
SELECT 52 / - 64 col0 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT 51 FROM tab1 GROUP BY col0
----
51
51
51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 + + col2 col1 FROM tab1 WHERE + + col0 IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT ALL - col1, 78 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT col2 = NULL
----

query I rowsort
SELECT 55 AS col0 FROM tab1 GROUP BY col2
----
55
55
55

query I rowsort
SELECT - col2 * - + col2 FROM tab2 GROUP BY col0, col2
----
3364
6241
7569

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NOT 99 / + 99 IS NULL )
----

query I rowsort
SELECT DISTINCT 35 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 48 * - col0 AS col0 FROM tab1 GROUP BY col0, col1
----
-1056
-1344
-3936

query I rowsort
SELECT + 18 * + col1 + + col1 * col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 * + 14 * - 18 IS NOT NULL
----
144
2728
4275

query I rowsort
SELECT ( + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + 9 AS col0 FROM tab2 cor0 GROUP BY col1
----
9
9
9

query I rowsort
SELECT DISTINCT 54 * + col0 AS col2 FROM tab1 GROUP BY col0
----
1188
1512
4428

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 29 IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + 39 * - - 34 FROM tab1 GROUP BY col2, col1
----
1326
1326
1326

query I rowsort
SELECT 81 + - col0 + + 24 * + col0 + 55 * - - col0 FROM tab2 GROUP BY col0
----
1251
7179
7257

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 WHERE NULL NOT IN ( 88, + col1 + col0 * + - 33, - col1, 6, - - col2 * + col2, 90 * 94 - - - ( col2 ) + ( - + col0 ) ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * + + ( + + col2 ) col1 FROM tab0 GROUP BY col1, col2, col1
----
-1444
-576
-6241

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4555
SELECT - col0 / - NULLIF ( - - col2, CAST( + + ( + col1 ) AS SIGNED ) * - + 37 ) AS col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT ( - 52 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4555
SELECT - col0 / - NULLIF ( - - col2, CAST ( + + ( + col1 ) AS INTEGER ) * - + 37 ) AS col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT ( - 52 ) IS NOT NULL
----

query I rowsort
SELECT ALL - + col1 * + col1 AS col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL < + + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4557
SELECT CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4557
SELECT CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT - ( - + 17 ) FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - 82 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
82
82
82

onlyif mysql # DIV for integer division: 
query I rowsort label-4560
SELECT + 33 DIV + col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-4
-45
-71

skipif mysql # not compatible
query I rowsort label-4560
SELECT + 33 / + col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-4
-45
-71

query II rowsort
SELECT - col2, col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
58
-79
79
-87
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 * col0 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT IN ( + - NULLIF ( + - NULLIF ( col2, 11 - - ( - 78 ) + + col2 * col1 * + col0 ), - NULLIF ( + col0, - col0 ) + + col0 * - - col1 + col1 ) )
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + AVG ( + ( - col1 ) ) * + - col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4566
SELECT - CAST( + col0 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-4566
SELECT - CAST ( + col0 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-4567
SELECT + 14 DIV 91 AS col0 FROM tab2 GROUP BY col1, col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-4567
SELECT + 14 / 91 AS col0 FROM tab2 GROUP BY col1, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, - 62 col2 FROM tab1 GROUP BY col2, col0, col1 HAVING ( + + col2 IS NOT NULL )
----
-45
-62
-71
-62
-8
-62

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2 HAVING - col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4570
SELECT ALL + ( - + ( - col0 ) ) * + - CAST( NULL AS SIGNED ) - - 89 AS col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4570
SELECT ALL + ( - + ( - col0 ) ) * + - CAST ( NULL AS INTEGER ) - - 89 AS col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 59 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
59
59
59

query I rowsort
SELECT ALL - 46 FROM tab2 AS cor0 GROUP BY col2
----
-46
-46
-46

query I rowsort
SELECT + col0 * + col0 + - 79 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1770
597
6810

query I rowsort
SELECT ALL - col0 * - col2 * - - 25 FROM tab2 GROUP BY col2, col0
----
133400
179725
32625

query I rowsort
SELECT DISTINCT col0 * + ( + + 99 ) FROM tab2 GROUP BY col2, col0
----
1485
9009
9108

query I rowsort
SELECT 8 FROM tab2 AS cor0 GROUP BY col1, col1
----
8
8
8

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col1, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * - - col1 * col1 * + + col2 col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) = + col1
----

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col0 HAVING NOT + - 88 IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4580
SELECT - col1 * - CAST( NULL AS DECIMAL ) + 55 - 99 * + + col1 + - - 44 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4580
SELECT - col1 * - CAST ( NULL AS REAL ) + 55 - 99 * + + col1 + - - 44 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query II rowsort
SELECT - col0 AS col1, col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-26
-43
-83

query II rowsort
SELECT DISTINCT col2, + col2 * - col2 FROM tab1 GROUP BY col0, col0, col2
----
45
-2025
71
-5041
8
-64

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 - 33 AS col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING - - 64 IS NOT NULL
----
-39
-77
-90

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL < ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4588
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND + + ( - + CAST( + + 11 AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-4588
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND + + ( - + CAST ( + + 11 AS INTEGER ) )
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT 99 FROM tab2 GROUP BY col2
----
99

query II rowsort
SELECT DISTINCT + col0 AS col2, col2 - 39 + 76 + col2 FROM tab1 GROUP BY col2, col0
----
22
53
28
127
82
179

onlyif mysql # DIV for integer division: 
query I rowsort label-4592
SELECT ALL - + col1 DIV + col1 - - 84 + + col1 DIV - - 51 FROM tab2 cor0 GROUP BY col1
----
83
84
84

skipif mysql # not compatible
query I rowsort label-4592
SELECT ALL - + col1 / + col1 - - 84 + + col1 / - - 51 FROM tab2 cor0 GROUP BY col1
----
83
84
84

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING + - 89 IS NOT NULL
----
45
71
8

query II rowsort
SELECT 87 * col0, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
2262
0
3741
-81
7221
0

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) >= 95
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4596
SELECT - col1 + - + col1 * + - col1 * + CAST( + + col1 AS SIGNED ) AS col2 FROM tab1 GROUP BY col1, col2
----
185136
210
85140

skipif mysql # not compatible
query I rowsort label-4596
SELECT - col1 + - + col1 * + - col1 * + CAST ( + + col1 AS INTEGER ) AS col2 FROM tab1 GROUP BY col1, col2
----
185136
210
85140

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1, col2 HAVING ( - 29 ) IS NULL
----

query I rowsort
SELECT DISTINCT 39 AS col2 FROM tab2 GROUP BY col1 HAVING NOT + col1 IS NULL OR ( NOT ( NULL ) IS NOT NULL )
----
39

query II rowsort
SELECT col0 + col0, col0 - + - 64 FROM tab2 GROUP BY col0 HAVING NOT ( ( + col0 + col0 + + + col0 ) IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( + 59 ) - col2 col0 FROM tab1 GROUP BY col2
----
-12
14
51

query I rowsort
SELECT 10 * col2 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
216
342
711

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col1 col2, + col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col2, col1 HAVING - col1 < + col1
----
81

onlyif mysql # DIV for integer division: 
query I rowsort label-4604
SELECT col1 DIV col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4604
SELECT col1 / col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT - ( + col2 ) * - col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING NOT ( + col2 ) NOT BETWEEN ( NULL ) AND ( + + col2 )
----

query I rowsort
SELECT DISTINCT + ( - col2 ) + - 41 FROM tab0 cor0 GROUP BY col2, col2, col0 HAVING 75 IS NOT NULL
----
-120
-65
-79

query I rowsort
SELECT DISTINCT - - 79 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
79

query I rowsort
SELECT + - 91 * - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) = ( NULL )
----

query I rowsort
SELECT + + 65 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
65
65
65

query II rowsort
SELECT ALL - col2, + col2 + - - col2 AS col2 FROM tab0 GROUP BY col2
----
-24
48
-38
76
-79
158

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - 3 AS col0, + 60 col0 FROM tab1 GROUP BY col2
----
-3
60
-3
60
-3
60

query I rowsort
SELECT ALL ( - col1 ) FROM tab0 cor0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT + AVG ( ALL - col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL = col1 + col1
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT col0 * - 99 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN + col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4616
SELECT DISTINCT 7 * col1 FROM tab1 GROUP BY col1 HAVING CAST( NULL AS SIGNED ) + 7 IS NULL
----
308
399
42

skipif mysql # not compatible
query I rowsort label-4616
SELECT DISTINCT 7 * col1 FROM tab1 GROUP BY col1 HAVING CAST ( NULL AS INTEGER ) + 7 IS NULL
----
308
399
42

query I rowsort
SELECT 70 * + col2 FROM tab1 GROUP BY col2
----
3150
4970
560

query I rowsort
SELECT + col2 * + + col2 * + col2 * - col2 - - col2 FROM tab0 GROUP BY col2
----
-2085098
-331752
-38950002

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL 46 FROM tab1 AS cor0 GROUP BY col1
----
46
46
46

query I rowsort
SELECT ALL 2 * col2 FROM tab1 GROUP BY col2 HAVING ( 26 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4622
SELECT + col2 + - + CAST( NULL AS SIGNED ) / 66 + - - ( 30 ) col1 FROM tab0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4622
SELECT + col2 + - + CAST ( NULL AS INTEGER ) / 66 + - - ( 30 ) col1 FROM tab0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 * - - col1 col0 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT 70 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
70

query I rowsort
SELECT 58 * + col1 + col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) <> + col1 GROUP BY col1, col2, col2
----

query I rowsort
SELECT + 96 FROM tab1 AS cor0 GROUP BY col1
----
96
96
96

query I rowsort
SELECT - col0 * + 37 - - + col0 FROM tab1 GROUP BY col0
----
-1008
-2952
-792

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4628
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT CAST( CASE 67 WHEN - 28 THEN col1 / col1 + - col1 * - col1 END AS SIGNED ) + col2 BETWEEN 10 AND col2
----

skipif mysql # not compatible
query I rowsort label-4628
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT CAST ( CASE 67 WHEN - 28 THEN col1 / col1 + - col1 * - col1 END AS INTEGER ) + col2 BETWEEN 10 AND col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4629
SELECT DISTINCT CAST( NULL AS SIGNED ) col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4629
SELECT DISTINCT CAST ( NULL AS INTEGER ) col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL

query I rowsort
SELECT 8 AS col0 FROM tab1 GROUP BY col2, col1
----
8
8
8

query I rowsort
SELECT + 31 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4632
SELECT ALL CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4632
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - + 4 FROM tab0 AS cor0 GROUP BY col1, col1
----
-4

query I rowsort
SELECT + 60 AS col1 FROM tab0 GROUP BY col2
----
60
60
60

query I rowsort
SELECT ALL - 30 FROM tab1 GROUP BY col0, col0
----
-30
-30
-30

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT ( AVG ( + 50 ) * col0 ) IS NOT NULL
----

query I rowsort
SELECT + ( col0 ) * col0 AS col2 FROM tab2 GROUP BY col0, col2
----
225
8281
8464

query I rowsort
SELECT DISTINCT - 71 * col1 AS col0 FROM tab1 GROUP BY col1, col0
----
-3124
-4047
-426

query I rowsort
SELECT 98 AS col1 FROM tab0 GROUP BY col2
----
98
98
98

query I rowsort
SELECT + col2 * + col2 AS col0 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT 99 * + col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab0 WHERE NOT ( + col1 ) IS NOT NULL GROUP BY col1 HAVING - col1 BETWEEN NULL AND + ( 16 ) * - col1 + - col1
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 WHERE NOT NULL NOT IN ( - col1 * - 66 ) GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE NOT ( 58 ) IN ( col0 ) GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4645
SELECT + col1 + col1 AS col1 FROM tab0 WHERE NOT col0 * 90 + CAST( 66 AS SIGNED ) * - col2 NOT IN ( + 50 * + 85 ) GROUP BY col1, col2 HAVING + 65 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4645
SELECT + col1 + col1 AS col1 FROM tab0 WHERE NOT col0 * 90 + CAST ( 66 AS INTEGER ) * - col2 NOT IN ( + 50 * + 85 ) GROUP BY col1, col2 HAVING + 65 IS NOT NULL
----

query I rowsort
SELECT - col2 * 15 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1185
-360
-570

query I rowsort
SELECT ALL + 16 - - col2 FROM tab2 GROUP BY col2
----
103
74
95

query I rowsort
SELECT col1 FROM tab0 WHERE NOT + col0 IN ( 91 ) GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4649
SELECT ALL + CAST( NULL AS SIGNED ) - + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4649
SELECT ALL + CAST ( NULL AS INTEGER ) - + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4650
SELECT ALL ( + col0 ) AS col0 FROM tab0 AS cor0 WHERE NOT + 27 * 74 > NULL GROUP BY col0 HAVING NOT ( + CAST( + 15 AS SIGNED ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-4650
SELECT ALL ( + col0 ) AS col0 FROM tab0 AS cor0 WHERE NOT + 27 * 74 > NULL GROUP BY col0 HAVING NOT ( + CAST ( + 15 AS INTEGER ) ) IS NULL
----

query II rowsort
SELECT DISTINCT + - col2 AS col1, col2 + + - col2 FROM tab2 AS cor0 WHERE ( NULL ) >= - col0 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
26
43
83

query I rowsort
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0, col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + col1 col1 FROM tab2 GROUP BY col1, col1 HAVING NULL NOT BETWEEN - 7 * + col1 AND + + 53
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4655
SELECT DISTINCT 16 * col1 + - 52 * - col2 + - + col2 * - 27 - 39 + col1 DIV - 18 FROM tab2 GROUP BY col1, col1, col2
----
5197
7143
7807

skipif mysql # not compatible
query I rowsort label-4655
SELECT DISTINCT 16 * col1 + - 52 * - col2 + - + col2 * - 27 - 39 + col1 / - 18 FROM tab2 GROUP BY col1, col1, col2
----
5197
7143
7807

onlyif mysql # aggregate syntax: 
query II rowsort label-4656
SELECT - 14 AS col0, COUNT( * ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT - col2 * - - COUNT( * ) >= NULL
----

skipif mysql # not compatible
query II rowsort label-4656
SELECT - 14 AS col0, COUNT ( * ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT - col2 * - - COUNT ( * ) >= NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4657
SELECT + 34 DIV - MAX( ALL - + 49 ) FROM tab1 cor0 GROUP BY col1, col0, col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-4657
SELECT + 34 / - MAX ( ALL - + 49 ) FROM tab1 cor0 GROUP BY col1, col0, col2
----
0
0
0

query I rowsort
SELECT - 6 FROM tab1 GROUP BY col0, col2
----
-6
-6
-6

query I rowsort
SELECT ALL - - 4 * col2 + 73 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
305
389
421

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4660
SELECT ALL col2 * + CAST( + 4 AS SIGNED ) + col2 + 64 * + + ( + col2 ) col1 FROM tab1 AS cor0 GROUP BY col2
----
3105
4899
552

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4660
SELECT ALL col2 * + CAST ( + 4 AS INTEGER ) + col2 + 64 * + + ( + col2 ) col1 FROM tab1 AS cor0 GROUP BY col2
----
3105
4899
552

query I rowsort
SELECT - + 92 * + col1 FROM tab1 cor0 GROUP BY col1
----
-4048
-5244
-552

onlyif mysql # aggregate syntax: 
query I rowsort label-4662
SELECT + - 88 FROM tab1 AS cor0 GROUP BY col1 HAVING - 54 + + SUM( + 54 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-4662
SELECT + - 88 FROM tab1 AS cor0 GROUP BY col1 HAVING - 54 + + SUM ( + 54 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4663
SELECT ALL + COUNT( * ) FROM tab0 AS cor0 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-4663
SELECT ALL + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1
----
1
2

query I rowsort
SELECT ALL - 32 + 22 FROM tab0 AS cor0 GROUP BY col0
----
-10
-10
-10

query II rowsort
SELECT DISTINCT + col0 * - col0 - - 31, + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 82 < NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1 HAVING NOT ( - 86 * col2 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4667
SELECT DISTINCT col0 * COUNT( * ) FROM tab0 GROUP BY col0, col2 HAVING NOT NULL NOT IN ( + col2 )
----

skipif mysql # not compatible
query I rowsort label-4667
SELECT DISTINCT col0 * COUNT ( * ) FROM tab0 GROUP BY col0, col2 HAVING NOT NULL NOT IN ( + col2 )
----

query I rowsort
SELECT ALL ( - 5 ) AS col0 FROM tab0 WHERE NOT - col2 IS NULL GROUP BY col2
----
-5
-5
-5

query I rowsort
SELECT DISTINCT - col1 * - 53 FROM tab0 GROUP BY col1
----
0
4293

query I rowsort
SELECT ALL 90 AS col1 FROM tab2 GROUP BY col0, col1
----
90
90
90

query I rowsort
SELECT - col0 AS col2 FROM tab2 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4672
SELECT + col1 + 36 * - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4672
SELECT + col1 + 36 * - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-4673
SELECT - COUNT( * ) + - col1 FROM tab2 GROUP BY col1, col0 HAVING ( + col0 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-4673
SELECT - COUNT ( * ) + - col1 FROM tab2 GROUP BY col1, col0 HAVING ( + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - 66 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-66

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT col1 <> ( NULL )
----

query I rowsort
SELECT - 12 + col1 FROM tab1 GROUP BY col1
----
-6
32
45

query I rowsort
SELECT DISTINCT - ( + col0 ) * + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT col1 + + col1 * - 8 AS col2 FROM tab1 cor0 GROUP BY col1
----
-308
-399
-42

onlyif mysql # aggregate syntax: 
query I rowsort label-4679
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-4679
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL 56 AS col2 FROM tab0 GROUP BY col1
----
56
56

query I rowsort
SELECT ALL col1 * col1 + col1 * 21 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT( * ) > NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM ( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT ( * ) > NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4683
SELECT ALL CAST( NULL AS SIGNED ) + + 63 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4683
SELECT ALL CAST ( NULL AS INTEGER ) + + 63 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 - + col1 FROM tab0 GROUP BY col1
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 * + + col0, + col2 col2 FROM tab1 GROUP BY col1, col2, col0
----
484
8
6724
71
784
45

query II rowsort
SELECT ALL ( + 21 ) - + col1 AS col1, - col0 + - + col1 FROM tab0 AS cor0 GROUP BY col0, col1, col1 HAVING NOT ( NULL ) NOT BETWEEN + 48 AND - - col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4687
SELECT COUNT( * ) * 21 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
21
21
21

skipif mysql # not compatible
query I rowsort label-4687
SELECT COUNT ( * ) * 21 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
21
21
21

onlyif mysql # aggregate syntax: 
query I rowsort label-4688
SELECT COUNT( * ) FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4688
SELECT COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-4689
SELECT ALL col0 + MAX( DISTINCT col0 ) * col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

skipif mysql # not compatible
query I rowsort label-4689
SELECT ALL col0 + MAX ( DISTINCT col0 ) * col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT col1 + + col1 FROM tab0 GROUP BY col1, col2
----
0
0
162

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4691
SELECT + col2 * + col0, 13 + + 10 FROM tab2 GROUP BY col0, col2 HAVING + CAST( NULL AS SIGNED ) <> 24 * - col0
----

skipif mysql # not compatible
query II rowsort label-4691
SELECT + col2 * + col0, 13 + + 10 FROM tab2 GROUP BY col0, col2 HAVING + CAST ( NULL AS INTEGER ) <> 24 * - col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4692
SELECT CAST( 78 AS SIGNED ) FROM tab1 GROUP BY col0, col1
----
78
78
78

skipif mysql # not compatible
query I rowsort label-4692
SELECT CAST ( 78 AS INTEGER ) FROM tab1 GROUP BY col0, col1
----
78
78
78

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + col0 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - + 28 + - col0 / - 58 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 + + col1 + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-166
-5
-52

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE ( 29 ) > NULL GROUP BY col2, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4698
SELECT ( + + col0 ) * COUNT( * ) + + 3 + - + 53 / - + 56 + col0 - + - 71 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4698
SELECT ( + + col0 ) * COUNT ( * ) + + 3 + - + 53 / - + 56 + col0 - + - 71 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 52 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
52
52
52

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING NULL >= + col0
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 WHERE ( NOT NULL IN ( + col0 * 78, + 70 * - 37 * - col1 * + + 51 ) ) GROUP BY col2
----

query I rowsort
SELECT + 0 + 6 FROM tab2 GROUP BY col2
----
6
6
6

query I rowsort
SELECT ALL 29 FROM tab2 WHERE NOT NULL >= + 78 GROUP BY col1, col2
----

query I rowsort
SELECT - 62 + + 4 FROM tab0 GROUP BY col0
----
-58
-58
-58

query I rowsort
SELECT DISTINCT col2 + - 70 AS col0 FROM tab2 GROUP BY col2 HAVING ( ( + 56 / + + 27 ) IS NOT NULL )
----
-12
17
9

query I rowsort
SELECT DISTINCT + col1 - col1 / + + 7 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-4709
SELECT ALL col2, col2 FROM tab0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2 HAVING SUM( DISTINCT + col0 ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-4709
SELECT ALL col2, col2 FROM tab0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2 HAVING SUM ( DISTINCT + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - 92 * - col2 FROM tab2 GROUP BY col2
----
5336
7268
8004

onlyif mysql # aggregate syntax: 
query I rowsort label-4711
SELECT ALL - ( - + COUNT( * ) ) AS col2 FROM tab2 cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4711
SELECT ALL - ( - + COUNT ( * ) ) AS col2 FROM tab2 cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT ALL + + col1 - + ( - + col1 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
114
12
88

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4713
SELECT - MIN( DISTINCT CASE WHEN + col1 IS NOT NULL THEN NULL ELSE - 36 - + - col0 END ) / ( - - col0 ) * - - col0 + - COUNT( ALL col1 ) + + col0 + - 35 * + col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT - + ( - CAST( + col1 AS SIGNED ) ) - + + col1 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4713
SELECT - MIN ( DISTINCT CASE WHEN + col1 IS NOT NULL THEN NULL ELSE - 36 - + - col0 END ) / ( - - col0 ) * - - col0 + - COUNT ( ALL col1 ) + + col0 + - 35 * + col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT - + ( - CAST ( + col1 AS INTEGER ) ) - + + col1 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col2 - 74 FROM tab0 GROUP BY col2, col2
----
-36
-50
5

query I rowsort
SELECT ALL 13 AS col1 FROM tab0 GROUP BY col2
----
13
13
13

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, 85 - + col2 col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + col1 + + 77 FROM tab1 AS cor0 GROUP BY col1, col2
----
121
134
83

query I rowsort
SELECT DISTINCT - - col0 * - - col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0, col0 HAVING ( 91 ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT + 27 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
27
27
27

query I rowsort
SELECT ALL - 37 AS col2 FROM tab0 AS cor0 WHERE NULL NOT IN ( + col2 + - + 1, - NULLIF ( col1, - 44 ), col0, - col1 ) GROUP BY col0
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-4721
SELECT DISTINCT + + 39 + - col2 AS col0 FROM tab2 WHERE NOT + + CAST( NULL AS DECIMAL ) IS NOT NULL GROUP BY col1, col0, col2 HAVING col1 * - COUNT( * ) + - col0 NOT BETWEEN NULL AND + COUNT( + COALESCE ( + col1, - 6 - + col2 ) )
----

skipif mysql # not compatible
query I rowsort label-4721
SELECT DISTINCT + + 39 + - col2 AS col0 FROM tab2 WHERE NOT + + CAST ( NULL AS REAL ) IS NOT NULL GROUP BY col1, col0, col2 HAVING col1 * - COUNT ( * ) + - col0 NOT BETWEEN NULL AND + COUNT ( + COALESCE ( + col1, - 6 - + col2 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4722
SELECT - ( NULLIF ( - + COUNT( * ), - col2 ) ) AS col1 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4722
SELECT - ( NULLIF ( - + COUNT ( * ), - col2 ) ) AS col1 FROM tab0 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-4723
SELECT DISTINCT COUNT( DISTINCT col1 ) FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-4723
SELECT DISTINCT COUNT ( DISTINCT col1 ) FROM tab1 GROUP BY col1
----
1

query II rowsort
SELECT 12, + col1 + - - 94 + 38 AS col2 FROM tab0 GROUP BY col1
----
12
132
12
213

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4725
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST( + + col2 AS SIGNED ) >= + col2 )
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-4725
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST ( + + col2 AS INTEGER ) >= + col2 )
----
-45
-71
-8

query I rowsort
SELECT ALL 8 * - col0 AS col2 FROM tab1 GROUP BY col0
----
-176
-224
-656

onlyif mysql # aggregate syntax: 
query I rowsort label-4727
SELECT - - 63 + 18 + - col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4727
SELECT - - 63 + 18 + - col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4728
SELECT DISTINCT + - COUNT( * ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND + - col1
----

skipif mysql # not compatible
query I rowsort label-4728
SELECT DISTINCT + - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND + - col1
----

query I rowsort
SELECT ALL + 25 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
25
25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4730
SELECT - col2 FROM tab2 GROUP BY col2 HAVING - COALESCE ( col2, + + CAST( NULL AS SIGNED ) * - 29 ) IS NOT NULL
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-4730
SELECT - col2 FROM tab2 GROUP BY col2 HAVING - COALESCE ( col2, + + CAST ( NULL AS INTEGER ) * - 29 ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT col0 * 96 FROM tab0 AS cor0 GROUP BY col0
----
2496
4128
7968

onlyif mysql # aggregate syntax: 
query I rowsort label-4732
SELECT - col2 * - col2 * + - ( NULLIF ( - COUNT( * ), col2 ) ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN - 78 AND SUM( + - 55 ) + - AVG ( DISTINCT - 91 ) * - 65
----

skipif mysql # not compatible
query I rowsort label-4732
SELECT - col2 * - col2 * + - ( NULLIF ( - COUNT ( * ), col2 ) ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN - 78 AND SUM ( + - 55 ) + - AVG ( DISTINCT - 91 ) * - 65
----

onlyif mysql # aggregate syntax: 
query II rowsort label-4733
SELECT + + ( + + ( - + col0 ) ) * - - col0 AS col0, SUM( col0 ) + - col0 * - 91 * + + col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
20490
-8281
753662
-8464
770316

skipif mysql # not compatible
query II rowsort label-4733
SELECT + + ( + + ( - + col0 ) ) * - - col0 AS col0, SUM ( col0 ) + - col0 * - 91 * + + col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
20490
-8281
753662
-8464
770316

query I rowsort
SELECT ALL + + 76 + + col1 * ( - + ( + col1 ) ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-6485
76

onlyif mysql # aggregate syntax: 
query I rowsort label-4735
SELECT + MAX( DISTINCT + 95 ) - - col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
176
95
95

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4735
SELECT + MAX ( DISTINCT + 95 ) - - col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
176
95
95

onlyif mysql # aggregate syntax: 
query I rowsort label-4736
SELECT ALL + col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING ( + - COUNT( * ) / - ( + col1 ) ) <> - 22
----
41
59
61

skipif mysql # not compatible
query I rowsort label-4736
SELECT ALL + col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING ( + - COUNT ( * ) / - ( + col1 ) ) <> - 22
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 74 col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
74
74
74

onlyif mysql # aggregate syntax: 
query I rowsort label-4738
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN + col2 * + - col2 * + COUNT( * ) * - col2 + + col0 AND ( + MIN( ALL 93 ) )
----

skipif mysql # not compatible
query I rowsort label-4738
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN + col2 * + - col2 * + COUNT ( * ) * - col2 + + col0 AND ( + MIN ( ALL 93 ) )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-4739
SELECT DISTINCT 25 * - + ( - ( + - col2 ) ) DIV - MIN( + col2 ), + 60 AS col0 FROM tab2 GROUP BY col2
----
25
60

skipif mysql # not compatible
query II rowsort label-4739
SELECT DISTINCT 25 * - + ( - ( + - col2 ) ) / - MIN ( + col2 ), + 60 AS col0 FROM tab2 GROUP BY col2
----
25
60

query I rowsort
SELECT 55 FROM tab0 AS cor0 GROUP BY col1
----
55
55

onlyif mysql # aggregate syntax: 
query I rowsort label-4741
SELECT + MIN( - col2 ) - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-4741
SELECT + MIN ( - col2 ) - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query II rowsort
SELECT - col1 AS col0, - col0 AS col1 FROM tab2 GROUP BY col1, col0
----
-41
-92
-59
-91
-61
-15

query I rowsort
SELECT DISTINCT 7 FROM tab2 GROUP BY col2, col1
----
7

onlyif mysql # aggregate syntax: 
query I rowsort label-4744
SELECT ALL MAX( ALL 31 ) FROM tab1 GROUP BY col1
----
31
31
31

skipif mysql # not compatible
query I rowsort label-4744
SELECT ALL MAX ( ALL 31 ) FROM tab1 GROUP BY col1
----
31
31
31

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-4745
SELECT ALL + SUM( - + col1 ) * COUNT( ALL - CAST( NULL AS DECIMAL ) ) + col1 AS col0 FROM tab0 WHERE NOT col0 > NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-4745
SELECT ALL + SUM ( - + col1 ) * COUNT ( ALL - CAST ( NULL AS REAL ) ) + col1 AS col0 FROM tab0 WHERE NOT col0 > NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4746
SELECT - MIN( DISTINCT - - col1 ) FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-4746
SELECT - MIN ( DISTINCT - - col1 ) FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col2 * + 90 AS col2 FROM tab0 GROUP BY col2 HAVING 77 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4748
SELECT - COUNT( ALL 65 ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4748
SELECT - COUNT ( ALL 65 ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-4749
SELECT - col2 DIV ( + + col2 ) FROM tab2 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4749
SELECT - col2 / ( + + col2 ) FROM tab2 GROUP BY col2
----
-1
-1
-1

query II rowsort
SELECT col0, - col0 * + 97 FROM tab2 GROUP BY col0
----
15
-1455
91
-8827
92
-8924

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( + ( + col1 ) ) IS NULL
----

query I rowsort
SELECT ALL + 56 FROM tab2 AS cor0 GROUP BY col1
----
56
56
56

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4753
SELECT + + 15 / + col2 + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT col2 * + 88 + + CAST( NULL AS SIGNED ) NOT BETWEEN + MAX( + 14 ) AND 18
----

skipif mysql # not compatible
query I rowsort label-4753
SELECT + + 15 / + col2 + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT col2 * + 88 + + CAST ( NULL AS INTEGER ) NOT BETWEEN + MAX ( + 14 ) AND 18
----

query I rowsort
SELECT - 75 FROM tab0 AS cor0 GROUP BY col2, col2
----
-75
-75
-75

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 WHERE col1 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL ( col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4758
SELECT + COUNT( * ) FROM tab1 WHERE NOT ( NULL ) < - ( col1 ) GROUP BY col2 HAVING ( + COUNT( * ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-4758
SELECT + COUNT ( * ) FROM tab1 WHERE NOT ( NULL ) < - ( col1 ) GROUP BY col2 HAVING ( + COUNT ( * ) IS NULL )
----

query I rowsort
SELECT ALL col0 + + + ( + ( + col0 ) ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4760
SELECT - col0 * - + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4760
SELECT - col0 * - + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + 58 AS col2 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
58
58
58

query I rowsort
SELECT 87 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING 16 < ( + 63 )
----
87
87
87

onlyif mysql # aggregate syntax: 
query I rowsort label-4764
SELECT DISTINCT - col0 * + COUNT( * ) FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-4764
SELECT DISTINCT - col0 * + COUNT ( * ) FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-4765
SELECT COUNT( * ) AS col0, COUNT( * ) - + + COUNT( * ) FROM tab1 GROUP BY col2, col2 HAVING NOT COUNT( * ) * + COUNT( * ) * + + CAST( NULL AS SIGNED ) + - 29 IS NOT NULL
----
1
0
1
0
1
0

skipif mysql # not compatible
query II rowsort label-4765
SELECT COUNT ( * ) AS col0, COUNT ( * ) - + + COUNT ( * ) FROM tab1 GROUP BY col2, col2 HAVING NOT COUNT ( * ) * + COUNT ( * ) * + + CAST ( NULL AS INTEGER ) + - 29 IS NOT NULL
----
1
0
1
0
1
0

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-4766
SELECT - CAST( NULL AS DECIMAL ), ( + col0 ) AS col2 FROM tab2 GROUP BY col0, col1
----
NULL
15
NULL
91
NULL
92

skipif mysql # not compatible
query II rowsort label-4766
SELECT - CAST ( NULL AS REAL ), ( + col0 ) AS col2 FROM tab2 GROUP BY col0, col1
----
NULL
15
NULL
91
NULL
92

query I rowsort
SELECT + col2 * + col2 * 83 FROM tab1 GROUP BY col2
----
168075
418403
5312

query I rowsort
SELECT DISTINCT ( - - col0 ) FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT 78 / col0 FROM tab1 GROUP BY col0 HAVING NOT ( NOT NULL BETWEEN NULL AND - ( + CASE 54 WHEN 55 THEN col0 ELSE NULL END ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4770
SELECT col0 + - 14 * - SUM( DISTINCT - COALESCE ( + 97, - col0 * - col1 ) ) FROM tab0 GROUP BY col0 HAVING NOT 43 + + col0 IS NULL
----
-1275
-1315
-1332

skipif mysql # not compatible
query I rowsort label-4770
SELECT col0 + - 14 * - SUM ( DISTINCT - COALESCE ( + 97, - col0 * - col1 ) ) FROM tab0 GROUP BY col0 HAVING NOT 43 + + col0 IS NULL
----
-1275
-1315
-1332

onlyif mysql # aggregate syntax: 
query I rowsort label-4771
SELECT 11 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - COUNT( * ) + - + 1 IS NULL
----
11
11

skipif mysql # not compatible
query I rowsort label-4771
SELECT 11 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - COUNT ( * ) + - + 1 IS NULL
----
11
11

query I rowsort
SELECT ALL - 92 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( NOT - ( - col1 ) * + - col1 * - 2 IS NULL )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4773
SELECT - - COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING - - CAST( NULL AS SIGNED ) * + - col2 IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4773
SELECT - - COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING - - CAST ( NULL AS INTEGER ) * + - col2 IS NULL
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-4774
SELECT - - COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4774
SELECT - - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT 80 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1920
3040
6320

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col2
----

query I rowsort
SELECT ALL - 37 FROM tab2 GROUP BY col2
----
-37
-37
-37

onlyif mysql # DIV for integer division: 
query I rowsort label-4778
SELECT DISTINCT - + col0 DIV 36 + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
23
36
79

skipif mysql # not compatible
query I rowsort label-4778
SELECT DISTINCT - + col0 / 36 + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
23
36
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4779
SELECT ALL col2 + - CAST( NULL AS SIGNED ) col0 FROM tab2 GROUP BY col2 HAVING - + col2 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4779
SELECT ALL col2 + - CAST ( NULL AS INTEGER ) col0 FROM tab2 GROUP BY col2 HAVING - + col2 IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-4780
SELECT DISTINCT 98 + - COUNT( * ) FROM tab1 GROUP BY col0, col0, col2
----
97

skipif mysql # not compatible
query I rowsort label-4780
SELECT DISTINCT 98 + - COUNT ( * ) FROM tab1 GROUP BY col0, col0, col2
----
97

onlyif mysql # aggregate syntax: 
query I rowsort label-4781
SELECT + MAX( ALL - 61 ) FROM tab1 AS cor0 GROUP BY col1
----
-61
-61
-61

skipif mysql # not compatible
query I rowsort label-4781
SELECT + MAX ( ALL - 61 ) FROM tab1 AS cor0 GROUP BY col1
----
-61
-61
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-4782
SELECT + col2 * 19 * - col2 + COUNT( col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1215
-38474
-95778

skipif mysql # not compatible
query I rowsort label-4782
SELECT + col2 * 19 * - col2 + COUNT ( col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1215
-38474
-95778

onlyif mysql # aggregate syntax: 
query II rowsort label-4783
SELECT - col0, - col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT 12 + - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-4783
SELECT - col0, - col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT 12 + - COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 35 AS col2 FROM tab1 GROUP BY col1
----
-35

query I rowsort
SELECT - col2 * + 52 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2340
-3692
-416

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + - 30, - col0 - + 41, 26 * - col0 - - 14 * - 43 ) + + col1 AS col0 FROM tab2 GROUP BY col1
----
11
29
31

query I rowsort
SELECT - col2 - + - col2 - + 46 FROM tab2 AS cor0 GROUP BY col2
----
-46
-46
-46

query I rowsort
SELECT ALL - 35 / + 64 AS col2 FROM tab0 AS cor0 WHERE NOT NULL < NULL GROUP BY col0, col1 HAVING NOT - col0 * - col0 IS NULL
----

query I rowsort
SELECT + 82 * col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( + col1 ) IS NULL
----
3362
4838
5002

onlyif mysql # aggregate syntax: 
query I rowsort label-4790
SELECT DISTINCT ( + MIN( DISTINCT 25 ) ) + - col2 FROM tab2 GROUP BY col2
----
-33
-54
-62

skipif mysql # not compatible
query I rowsort label-4790
SELECT DISTINCT ( + MIN ( DISTINCT 25 ) ) + - col2 FROM tab2 GROUP BY col2
----
-33
-54
-62

query I rowsort
SELECT - col0 AS col0 FROM tab1 cor0 WHERE NOT ( 18 ) + + col0 > 36 GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col0 + - 85 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING 44 * 10 NOT BETWEEN - 7 AND NULL
----

query I rowsort
SELECT + 76 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 43 FROM tab2 GROUP BY col2
----
43
43
43

query I rowsort
SELECT + + ( col1 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL BETWEEN - 0 * + 98 AND + 41
----

query I rowsort
SELECT DISTINCT - + ( 60 ) - ( + 15 ) FROM tab1 AS cor0 GROUP BY col0
----
-75

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING ( NULL ) NOT BETWEEN ( NULL ) AND NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4798
SELECT 99 / - CAST( 53 AS DECIMAL ) AS col2 FROM tab0 AS cor0 WHERE NULL < col2 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-4798
SELECT 99 / - CAST ( 53 AS REAL ) AS col2 FROM tab0 AS cor0 WHERE NULL < col2 GROUP BY col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4799
SELECT + 38 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 94 + - CAST( NULL AS SIGNED ) BETWEEN NULL AND COUNT( * ) * - col1
----

skipif mysql # not compatible
query I rowsort label-4799
SELECT + 38 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 94 + - CAST ( NULL AS INTEGER ) BETWEEN NULL AND COUNT ( * ) * - col1
----

query I rowsort
SELECT 89 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NOT ( 27 ) IS NULL
----
89
89
89

query I rowsort
SELECT DISTINCT + 37 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
37

onlyif mysql # aggregate syntax: 
query I rowsort label-4802
SELECT ALL ( - 52 ) + 10 col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4802
SELECT ALL ( - 52 ) + 10 col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4803
SELECT DISTINCT - - col0 * + + COUNT( * ) + col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4803
SELECT DISTINCT - - col0 * + + COUNT ( * ) + col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4804
SELECT ALL - - MIN( ( - + 4 ) ) DIV - col0 + 23 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - COUNT( * ) IS NULL
----
23
23
23

skipif mysql # not compatible
query I rowsort label-4804
SELECT ALL - - MIN ( ( - + 4 ) ) / - col0 + 23 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - COUNT ( * ) IS NULL
----
23
23
23

query I rowsort
SELECT + 92 FROM tab1 GROUP BY col1, col1
----
92
92
92

onlyif mysql # aggregate syntax: 
query I rowsort label-4806
SELECT col1 AS col2 FROM tab0 WHERE ( - 39 ) IS NOT NULL GROUP BY col1 HAVING col1 + COUNT( * ) <> - NULLIF ( 21, - 21 )
----
0
81

skipif mysql # not compatible
query I rowsort label-4806
SELECT col1 AS col2 FROM tab0 WHERE ( - 39 ) IS NOT NULL GROUP BY col1 HAVING col1 + COUNT ( * ) <> - NULLIF ( 21, - 21 )
----
0
81

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 WHERE NOT + col1 > ( col1 ) GROUP BY col1 HAVING ( col1 ) > NULL
----

query II rowsort
SELECT + 41, col0 FROM tab1 cor0 GROUP BY col0 HAVING ( 27 * col0 ) IS NULL
----

query I rowsort
SELECT - ( col2 ) - + ( + + col2 ) + - 61 FROM tab0 GROUP BY col2, col0
----
-109
-137
-219

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4811
SELECT ALL - CASE - CAST( NULL AS SIGNED ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4811
SELECT ALL - CASE - CAST ( NULL AS INTEGER ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4812
SELECT ALL + 39 col2 FROM tab2 GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4812
SELECT ALL + 39 col2 FROM tab2 GROUP BY col1 HAVING NOT - CAST ( NULL AS INTEGER ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4813
SELECT ( COUNT( * ) ) * + col2 - - col2 * col2 FROM tab0 GROUP BY col0, col2 HAVING NOT 13 < - col0
----
1482
600
6320

skipif mysql # not compatible
query I rowsort label-4813
SELECT ( COUNT ( * ) ) * + col2 - - col2 * col2 FROM tab0 GROUP BY col0, col2 HAVING NOT 13 < - col0
----
1482
600
6320

query I rowsort
SELECT - + 20 FROM tab2 cor0 GROUP BY col0 HAVING ( NULL ) <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4815
SELECT DISTINCT CAST( 29 AS SIGNED ) * - 61 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) NOT BETWEEN COALESCE ( - 69, col2, 0 ) AND col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4815
SELECT DISTINCT CAST ( 29 AS INTEGER ) * - 61 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) NOT BETWEEN COALESCE ( - 69, col2, 0 ) AND col2
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4816
SELECT DISTINCT - CAST( NULL AS DECIMAL ) AS col0 FROM tab1 AS cor0 WHERE NOT - col0 IN ( - - col1 ) GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4816
SELECT DISTINCT - CAST ( NULL AS REAL ) AS col0 FROM tab1 AS cor0 WHERE NOT - col0 IN ( - - col1 ) GROUP BY col1
----
NULL

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
58
79
87

query I rowsort
SELECT - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-4819
SELECT DISTINCT + - col1 AS col1 FROM tab2 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col1 HAVING COUNT( * ) * - col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-4819
SELECT DISTINCT + - col1 AS col1 FROM tab2 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col1 HAVING COUNT ( * ) * - col1 IS NULL
----

query I rowsort
SELECT 27 AS col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-4821
SELECT DISTINCT + col0 FROM tab0 AS cor0 WHERE NOT NULL >= NULL OR NOT ( - 70 ) = + CAST( NULL AS DECIMAL ) + 51 GROUP BY col0 HAVING + COUNT( * ) NOT IN ( 60 )
----

skipif mysql # not compatible
query I rowsort label-4821
SELECT DISTINCT + col0 FROM tab0 AS cor0 WHERE NOT NULL >= NULL OR NOT ( - 70 ) = + CAST ( NULL AS REAL ) + 51 GROUP BY col0 HAVING + COUNT ( * ) NOT IN ( 60 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4822
SELECT ALL - col0 + COUNT( * ) FROM tab1 GROUP BY col0 HAVING - - CAST( + - col0 AS SIGNED ) <= 70
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-4822
SELECT ALL - col0 + COUNT ( * ) FROM tab1 GROUP BY col0 HAVING - - CAST ( + - col0 AS INTEGER ) <= 70
----
-21
-27
-81

query I rowsort
SELECT ALL + ( col0 ) + - 3 FROM tab2 AS cor0 GROUP BY col0, col0
----
12
88
89

onlyif mysql # aggregate syntax: 
query I rowsort label-4824
SELECT + AVG ( DISTINCT - - col1 ) * - + col1 * + 13 * - - col1 col0 FROM tab2 GROUP BY col1 HAVING + + 32 * COUNT( * ) + col1 IN ( + ( COUNT( * ) ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4824
SELECT + AVG ( DISTINCT - - col1 ) * - + col1 * + 13 * - - col1 col0 FROM tab2 GROUP BY col1 HAVING + + 32 * COUNT ( * ) + col1 IN ( + ( COUNT ( * ) ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4825
SELECT - col1 * - COUNT( - + col1 ) * + - COUNT( * ) + col1 * ( - COUNT( 31 ) ) * col1 + COUNT( * ) col0 FROM tab0 cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
-6641
2

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4825
SELECT - col1 * - COUNT ( - + col1 ) * + - COUNT ( * ) + col1 * ( - COUNT ( 31 ) ) * col1 + COUNT ( * ) col0 FROM tab0 cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
-6641
2

onlyif mysql # DIV for integer division: 
query II rowsort label-4826
SELECT + - 99 DIV - col2 col0, - ( - col2 ) DIV - col2 + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1
-1
12
-1
2
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4826
SELECT + - 99 / - col2 col0, - ( - col2 ) / - col2 + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1
-1
12
-1
2
-1

query I rowsort
SELECT DISTINCT 7 * + - 47 * 67 FROM tab2 GROUP BY col2
----
-22043

query I rowsort
SELECT + col2 * col2 AS col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

onlyif mysql # aggregate syntax: 
query I rowsort label-4829
SELECT - - col1 + - COUNT( * ) / - + col1 * 24 FROM tab0 WHERE NOT - 77 < - col0 / - + col0 GROUP BY col2, col1 HAVING NOT NULL <> ( NULL )
----

skipif mysql # not compatible
query I rowsort label-4829
SELECT - - col1 + - COUNT ( * ) / - + col1 * 24 FROM tab0 WHERE NOT - 77 < - col0 / - + col0 GROUP BY col2, col1 HAVING NOT NULL <> ( NULL )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4830
SELECT + col0 * - col0 + col0 + - + 20 + + COUNT( * ) + - - COUNT( * ) DIV + col0 * col0 - 8 + col0 * - col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-3612
-761788
-787087

skipif mysql # not compatible
query I rowsort label-4830
SELECT + col0 * - col0 + col0 + - + 20 + + COUNT ( * ) + - - COUNT ( * ) / + col0 * col0 - 8 + col0 * - col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-3612
-761788
-787087

query I rowsort
SELECT - 27 FROM tab0 AS cor0 GROUP BY col0
----
-27
-27
-27

query I rowsort
SELECT + ( + 55 ) + col0 * - - col0 + 0 FROM tab0 AS cor0 GROUP BY col0
----
1904
6944
731

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 * col1 * + 1 + col1 col1, 72 + - col1 FROM tab1 GROUP BY col1
----
1980
28
3306
15
42
66

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4834
SELECT ( 32 ) FROM tab1 WHERE col2 * - 43 / - 18 * + COALESCE ( - 77, + + col2 + + COALESCE ( NULLIF ( - col1, + 55 * 31 + CAST( + col2 AS SIGNED ) ), col1 ) ) * + col2 <> ( 31 ) GROUP BY col1
----
32
32
32

skipif mysql # not compatible
query I rowsort label-4834
SELECT ( 32 ) FROM tab1 WHERE col2 * - 43 / - 18 * + COALESCE ( - 77, + + col2 + + COALESCE ( NULLIF ( - col1, + 55 * 31 + CAST ( + col2 AS INTEGER ) ), col1 ) ) * + col2 <> ( 31 ) GROUP BY col1
----
32
32
32

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-4836
SELECT ALL col1 * - MAX( - ( - col1 ) ) * col1 * + COUNT( * ) FROM tab1 GROUP BY col1
----
-185193
-216
-85184

skipif mysql # not compatible
query I rowsort label-4836
SELECT ALL col1 * - MAX ( - ( - col1 ) ) * col1 * + COUNT ( * ) FROM tab1 GROUP BY col1
----
-185193
-216
-85184

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING - + 10 / - + 60 <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4838
SELECT + 34 FROM tab1 GROUP BY col2 HAVING COUNT( * ) = NULL
----

skipif mysql # not compatible
query I rowsort label-4838
SELECT + 34 FROM tab1 GROUP BY col2 HAVING COUNT ( * ) = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4839
SELECT + col2 * + - 27 * - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT 68 < COALESCE ( - COUNT( * ), - 62 ) / - 74 * 8
----
157194
34020
4752

skipif mysql # not compatible
query I rowsort label-4839
SELECT + col2 * + - 27 * - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT 68 < COALESCE ( - COUNT ( * ), - 62 ) / - 74 * 8
----
157194
34020
4752

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( AVG ( ALL + - col1 ) ) - - - col1 col0 FROM tab2 GROUP BY col1 HAVING - + col1 IS NULL
----

query I rowsort
SELECT + col0 * - ( + col0 ) AS col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

onlyif mysql # aggregate syntax: 
query I rowsort label-4842
SELECT - col1 * COUNT( * ) FROM tab2 GROUP BY col1 HAVING NOT + - 83 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4842
SELECT - col1 * COUNT ( * ) FROM tab2 GROUP BY col1 HAVING NOT + - 83 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4843
SELECT ALL + COUNT( * ) * 47 + - ( col2 ) FROM tab0 GROUP BY col2 HAVING NULL = - col2
----

skipif mysql # not compatible
query I rowsort label-4843
SELECT ALL + COUNT ( * ) * 47 + - ( col2 ) FROM tab0 GROUP BY col2 HAVING NULL = - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4844
SELECT + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4844
SELECT + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4845
SELECT DISTINCT 86 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN + - ( + 61 ) AND CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-4845
SELECT DISTINCT 86 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN + - ( + 61 ) AND CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - col1 + + - 49 * - 25 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
1164
1166
1184

query I rowsort
SELECT 87 * col1 FROM tab1 GROUP BY col1, col0
----
3828
4959
522

onlyif mysql # aggregate syntax: 
query I rowsort label-4848
SELECT - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4848
SELECT - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

query II rowsort
SELECT ALL + - col2, col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING - 78 IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT 74 FROM tab0 AS cor0 GROUP BY col2
----
74

query I rowsort
SELECT DISTINCT col2 * + col2 + + 93 AS col2 FROM tab0 GROUP BY col2
----
1537
6334
669

onlyif mysql # aggregate syntax: 
query I rowsort label-4853
SELECT 54 * + + MAX( + 76 ) FROM tab0 cor0 GROUP BY col1
----
4104
4104

skipif mysql # not compatible
query I rowsort label-4853
SELECT 54 * + + MAX ( + 76 ) FROM tab0 cor0 GROUP BY col1
----
4104
4104

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 WHERE - col0 IS NULL GROUP BY col2 HAVING - + 44 < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4855
SELECT ALL + col0 + COALESCE ( - COUNT( * ), COUNT( * ) * - 4 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
25
42
82

skipif mysql # not compatible
query I rowsort label-4855
SELECT ALL + col0 + COALESCE ( - COUNT ( * ), COUNT ( * ) * - 4 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
25
42
82

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-4856
SELECT 79 AS col1, col2 * + col1 DIV + - COUNT( * ) AS col1 FROM tab0 GROUP BY col2, col1
----
79
-1944
79
0
79
0

skipif mysql # not compatible
query II rowsort label-4856
SELECT 79 AS col1, col2 * + col1 / + - COUNT ( * ) AS col1 FROM tab0 GROUP BY col2, col1
----
79
-1944
79
0
79
0

query I rowsort
SELECT DISTINCT - 71 + - + col2 AS col2 FROM tab0 GROUP BY col2
----
-109
-150
-95

onlyif mysql # DIV for integer division: 
query II rowsort label-4858
SELECT + col1 DIV - col1 + col1 AS col2, col1 FROM tab1 AS cor0 GROUP BY col1
----
43
44
5
6
56
57

skipif mysql # not compatible
query II rowsort label-4858
SELECT + col1 / - col1 + col1 AS col2, col1 FROM tab1 AS cor0 GROUP BY col1
----
43
44
5
6
56
57

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4859
SELECT CAST( NULL AS SIGNED ) AS col1, 44 * - col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL > col2 * - col2
----

skipif mysql # not compatible
query II rowsort label-4859
SELECT CAST ( NULL AS INTEGER ) AS col1, 44 * - col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL > col2 * - col2
----

query I rowsort
SELECT ALL + + 30 FROM tab0 AS cor0 WHERE NOT - 45 IS NULL GROUP BY col1
----
30
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 col2, - 23 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT col2 + col1 IS NOT NULL
----

query I rowsort
SELECT ( + 21 ) AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4863
SELECT DISTINCT + COUNT( * ) AS col2 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-4863
SELECT DISTINCT + COUNT ( * ) AS col2 FROM tab1 GROUP BY col1
----
1

query II rowsort
SELECT ALL col0 + + + 31 AS col0, + 60 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
122
60
123
60
46
60

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4865
SELECT ALL - CAST( NULL AS SIGNED ) + + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - col0 + + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4865
SELECT ALL - CAST ( NULL AS INTEGER ) + + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - col0 + + COUNT ( * ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4866
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4866
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

query II rowsort
SELECT + - col0 / - ( + ( + - 49 ) ) AS col0, + col2 * col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1
5822
0
1260
0
176

query I rowsort
SELECT + 0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NOT NULL >= NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4870
SELECT - COUNT( * ) * - 86 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
86
86
86

skipif mysql # not compatible
query I rowsort label-4870
SELECT - COUNT ( * ) * - 86 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
86
86
86

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NOT col1 <= NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT col2 * + + 87 IS NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4873
SELECT DISTINCT - 35 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + MIN( - 86 ) < + COUNT( * ) * + AVG ( + col0 )
----

skipif mysql # not compatible
query I rowsort label-4873
SELECT DISTINCT - 35 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + MIN ( - 86 ) < + COUNT ( * ) * + AVG ( + col0 )
----

query I rowsort
SELECT col2 + + 31 AS col2 FROM tab2 GROUP BY col2
----
110
118
89

query I rowsort
SELECT ALL + 46 * + col1 * - col0 * - - 35 * + col1 * + col0 + - + 68 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1 HAVING ( + col0 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4876
SELECT - col0 * - 99 - - col0 * + + col0 + col2 + - + CAST( 39 AS SIGNED ) FROM tab2 cor0 GROUP BY col2, col0
----
17330
1758
17591

skipif mysql # not compatible
query I rowsort label-4876
SELECT - col0 * - 99 - - col0 * + + col0 + col2 + - + CAST ( 39 AS INTEGER ) FROM tab2 cor0 GROUP BY col2, col0
----
17330
1758
17591

query I rowsort
SELECT + 54 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
26
43
83

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4879
SELECT - ( 75 ) * + + col1 * SUM( - col1 ) + + - 95 DIV - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 60 IS NULL
----
126073
261074
279074

skipif mysql # not compatible
query I rowsort label-4879
SELECT - ( 75 ) * + + col1 * SUM ( - col1 ) + + - 95 / - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 60 IS NULL
----
126073
261074
279074

onlyif mysql # aggregate syntax: 
query I rowsort label-4880
SELECT ALL - - col0 - - CASE 13 WHEN 57 THEN - COALESCE ( - col0, - - COUNT( * ) ) * + col0 END AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND 39 + col0 - 14
----

skipif mysql # not compatible
query I rowsort label-4880
SELECT ALL - - col0 - - CASE 13 WHEN 57 THEN - COALESCE ( - col0, - - COUNT ( * ) ) * + col0 END AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND 39 + col0 - 14
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4881
SELECT + + 59 + - CAST( NULL AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4881
SELECT + + 59 + - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + + 59 >= + 92 + + col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 34 AS col0, - col1 col0 FROM tab0 cor0 WHERE NOT + 49 * - col0 IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + 92 + col0 FROM tab0 AS cor0 GROUP BY col0
----
118
135
175

query I rowsort
SELECT + - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col1
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-4886
SELECT - SUM( + - col1 ) * - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

skipif mysql # not compatible
query I rowsort label-4886
SELECT - SUM ( + - col1 ) * - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

onlyif mysql # aggregate syntax: 
query I rowsort label-4887
SELECT COUNT( * ) * + col2 + + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
142
16
90

skipif mysql # not compatible
query I rowsort label-4887
SELECT COUNT ( * ) * + col2 + + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
142
16
90

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4888
SELECT col1 + 46 + + col2 * - col2 * ( - + col1 ) + - - CASE col2 WHEN + 91 * - - col1 * MAX( NULLIF ( + - 42, - col2 + - - col1 ) ) THEN NULL WHEN col1 THEN NULL WHEN + col1 THEN CAST( NULL AS SIGNED ) ELSE - + col2 END + - col2 + + col2 + - 8 + 80 / + col2 / col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IN ( 68 )
----

skipif mysql # not compatible
query I rowsort label-4888
SELECT col1 + 46 + + col2 * - col2 * ( - + col1 ) + - - CASE col2 WHEN + 91 * - - col1 * MAX ( NULLIF ( + - 42, - col2 + - - col1 ) ) THEN NULL WHEN col1 THEN NULL WHEN + col1 THEN CAST ( NULL AS INTEGER ) ELSE - + col2 END + - col2 + + col2 + - 8 + 80 / + col2 / col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IN ( 68 )
----

query I rowsort
SELECT 85 AS col1 FROM tab2 GROUP BY col0
----
85
85
85

onlyif mysql # aggregate syntax: 
query II rowsort label-4890
SELECT col1 + col1, + col1 col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <> ( + MIN( DISTINCT + ( - + 63 ) ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4890
SELECT col1 + col1, + col1 col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <> ( + MIN ( DISTINCT + ( - + 63 ) ) )
----

query I rowsort
SELECT ALL col1 * 86 AS col1 FROM tab0 GROUP BY col1
----
0
6966

query I rowsort
SELECT - ( 81 ) FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4893
SELECT - 87 FROM tab0 GROUP BY col2, col1 HAVING NOT + col1 <= - CAST( 45 AS SIGNED )
----
-87
-87
-87

skipif mysql # not compatible
query I rowsort label-4893
SELECT - 87 FROM tab0 GROUP BY col2, col1 HAVING NOT + col1 <= - CAST ( 45 AS INTEGER )
----
-87
-87
-87

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NOT - col2 IS NULL GROUP BY col2, col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-4895
SELECT ALL + col2 * COUNT( * ) AS col1, + 94 DIV - - col2 FROM tab0 GROUP BY col2
----
24
3
38
2
79
1

skipif mysql # not compatible
query II rowsort label-4895
SELECT ALL + col2 * COUNT ( * ) AS col1, + 94 / - - col2 FROM tab0 GROUP BY col2
----
24
3
38
2
79
1

query II rowsort
SELECT ALL + col1, 86 * col2 FROM tab2 cor0 GROUP BY col1, col2 HAVING NULL BETWEEN + 56 AND + col1 * + + col1 + + col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4897
SELECT COUNT( * ) FROM tab2 AS cor0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4897
SELECT COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT col1 + + + col1 FROM tab0 GROUP BY col1
----
0
162

onlyif mysql # aggregate syntax: 
query I rowsort label-4899
SELECT DISTINCT + COUNT( * ) * + + 96 FROM tab2 GROUP BY col1
----
96

skipif mysql # not compatible
query I rowsort label-4899
SELECT DISTINCT + COUNT ( * ) * + + 96 FROM tab2 GROUP BY col1
----
96

query II rowsort
SELECT col0 - col0 AS col2, + col0 * + col0 AS col0 FROM tab2 GROUP BY col0
----
0
225
0
8281
0
8464

onlyif mysql # aggregate syntax: 
query II rowsort label-4901
SELECT COUNT( * ), col1 FROM tab2 cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col0
----

skipif mysql # not compatible
query II rowsort label-4901
SELECT COUNT ( * ), col1 FROM tab2 cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL 9 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
9
9
9

onlyif mysql # aggregate syntax: 
query I rowsort label-4903
SELECT - col0 + + col0 + - - COUNT( * ) + - 25 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-24
-24
-24

skipif mysql # not compatible
query I rowsort label-4903
SELECT - col0 + + col0 + - - COUNT ( * ) + - 25 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-24
-24
-24

onlyif mysql # aggregate syntax: 
query I rowsort label-4904
SELECT - 59 * - COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
59
59
59

skipif mysql # not compatible
query I rowsort label-4904
SELECT - 59 * - COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
59
59
59

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 69 col1 FROM tab0 AS cor0 WHERE NOT col2 * - col2 IS NOT NULL GROUP BY col2, col1, col0
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - ( 63 ) < + col1 + - col1
----

query II rowsort
SELECT + col0, ( - 26 ) AS col2 FROM tab2 GROUP BY col2, col0 HAVING col2 * - 23 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4908
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - + COUNT( * ) <= 99
----

skipif mysql # not compatible
query I rowsort label-4908
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - + COUNT ( * ) <= 99
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4909
SELECT DISTINCT - COUNT( * ) AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
-1

skipif mysql # not compatible
query I rowsort label-4909
SELECT DISTINCT - COUNT ( * ) AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-4910
SELECT - COUNT( * ) * - - col0 + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0
----
-23
-29
-83

skipif mysql # not compatible
query I rowsort label-4910
SELECT - COUNT ( * ) * - - col0 + - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0
----
-23
-29
-83

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE ( ( NOT ( NOT - 58 * - 56 IS NULL ) ) ) GROUP BY col0, col0
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4912
SELECT col1 DIV - + COUNT( * ) FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-4912
SELECT col1 / - + COUNT ( * ) FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL 76 FROM tab0 GROUP BY col1
----
76
76

query I rowsort
SELECT + + ( 84 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
84
84
84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 80 col0 FROM tab0 AS cor0 GROUP BY col0
----
-80

query I rowsort
SELECT 37 FROM tab2 GROUP BY col2
----
37
37
37

query I rowsort
SELECT + 53 AS col0 FROM tab0 GROUP BY col0, col2 HAVING - col0 * - 37 IS NOT NULL
----
53
53
53

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 85 col0 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
85
85
85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0, col2 - - col0 * 66 - - 75 col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( + col0 ) IS NOT NULL
----

query II rowsort
SELECT + - col2, + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col2 + - - col2 FROM tab1 GROUP BY col2
----
0
0
0

query II rowsort
SELECT DISTINCT + - 72, col2 + + col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING ( 28 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4923
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST( + 49 AS SIGNED ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4923
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST ( + 49 AS INTEGER ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

query I rowsort
SELECT 39 + - 30 * - col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 - + ( - col2 ) FROM tab2 GROUP BY col0, col2 HAVING 79 IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-4926
SELECT - col0, 69 + - 73 DIV + col0 AS col2 FROM tab1 GROUP BY col0, col0
----
-22
66
-28
67
-82
69

skipif mysql # not compatible
query II rowsort label-4926
SELECT - col0, 69 + - 73 / + col0 AS col2 FROM tab1 GROUP BY col0, col0
----
-22
66
-28
67
-82
69

query I rowsort
SELECT DISTINCT 22 FROM tab2 GROUP BY col2, col2, col1
----
22

onlyif mysql # aggregate syntax: 
query II rowsort label-4928
SELECT + col1, COUNT( * ) FROM tab0 GROUP BY col1, col0
----
0
1
0
1
81
1

skipif mysql # not compatible
query II rowsort label-4928
SELECT + col1, COUNT ( * ) FROM tab0 GROUP BY col1, col0
----
0
1
0
1
81
1

onlyif mysql # aggregate syntax: 
query I rowsort label-4929
SELECT - - SUM( ALL - col2 ) FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-4929
SELECT - - SUM ( ALL - col2 ) FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-4930
SELECT - COUNT( * ) FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4930
SELECT - COUNT ( * ) FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-1
-1
-1

query II rowsort
SELECT DISTINCT - col2 AS col0, col2 * + 0 AS col1 FROM tab1 AS cor0 WHERE - col2 * - col2 NOT BETWEEN NULL AND NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4932
SELECT DISTINCT + + MAX( ALL + - col2 ) DIV + NULLIF ( COUNT( * ), - col2 ) + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-4932
SELECT DISTINCT + + MAX ( ALL + - col2 ) / + NULLIF ( COUNT ( * ), - col2 ) + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

onlyif mysql # aggregate syntax: 
query II rowsort label-4933
SELECT ALL 7 * + col0 + - col0 / + COUNT( * ) * + ( + ( - + COUNT( - col0 ) ) ) * + - 47 * MAX( DISTINCT - 71 ) + + 20, MIN( + ( + col0 ) ) col1 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col0 HAVING + 68 / + + 94 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4933
SELECT ALL 7 * + col0 + - col0 / + COUNT ( * ) * + ( + ( - + COUNT ( - col0 ) ) ) * + - 47 * MAX ( DISTINCT - 71 ) + + 20, MIN ( + ( + col0 ) ) col1 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col0 HAVING + 68 / + + 94 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4934
SELECT DISTINCT + COUNT( - + col1 ) FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-4934
SELECT DISTINCT + COUNT ( - + col1 ) FROM tab1 GROUP BY col1
----
1

query I rowsort
SELECT - col1 + - col2 * + - ( - AVG ( ALL + 72 ) ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL NULLIF ( - + col1, + 72 ) / - + col1 AS col0 FROM tab2 AS cor0 WHERE NULL IN ( col0 - 24 ) GROUP BY col1, col0 HAVING NOT NULL < NULL
----

query II rowsort
SELECT ALL + col0, + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( 19 ) IS NOT NULL
----
22
22
28
28
82
82

onlyif mysql # aggregate syntax: 
query I rowsort label-4938
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT - 90 = - 33 / - COUNT( DISTINCT - 60 )
----
24
38
79

skipif mysql # not compatible
query I rowsort label-4938
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT - 90 = - 33 / - COUNT ( DISTINCT - 60 )
----
24
38
79

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4939
SELECT - + MAX( col1 ) DIV 31 * + col1 FROM tab1 WHERE NOT col0 IS NULL GROUP BY col1
----
-44
-57
0

skipif mysql # not compatible
query I rowsort label-4939
SELECT - + MAX ( col1 ) / 31 * + col1 FROM tab1 WHERE NOT col0 IS NULL GROUP BY col1
----
-44
-57
0

onlyif mysql # aggregate syntax: 
query I rowsort label-4940
SELECT + - COUNT( * ) * CASE - + 40 WHEN + + 85 + + 63 THEN + COUNT( * ) ELSE NULL END * COALESCE ( - - 79, - - ( - col1 ) ) - + col1 AS col0 FROM tab2 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1 HAVING NOT - + col1 < NULL
----

skipif mysql # not compatible
query I rowsort label-4940
SELECT + - COUNT ( * ) * CASE - + 40 WHEN + + 85 + + 63 THEN + COUNT ( * ) ELSE NULL END * COALESCE ( - - 79, - - ( - col1 ) ) - + col1 AS col0 FROM tab2 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1 HAVING NOT - + col1 < NULL
----

query I rowsort
SELECT + 22 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col1, col2
----
22
22
22

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4942
SELECT ALL + col1 + + CAST( col1 AS SIGNED ), 7 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1, col1 HAVING NOT - 33 >= - col1
----

skipif mysql # not compatible
query II rowsort label-4942
SELECT ALL + col1 + + CAST ( col1 AS INTEGER ), 7 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1, col1 HAVING NOT - 33 >= - col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4943
SELECT + + COUNT( * ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4943
SELECT + + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-4944
SELECT ALL + COUNT( * ) FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4944
SELECT ALL + COUNT ( * ) FROM tab1 GROUP BY col0
----
1
1
1

query I rowsort
SELECT - ( + col0 ) * col0 + - - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-462
-6642
-756

onlyif mysql # aggregate syntax: 
query I rowsort label-4946
SELECT ALL + + 2 + - + COALESCE ( - COUNT( * ), + 19, - COUNT( * ) ) * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
46
59
8

skipif mysql # not compatible
query I rowsort label-4946
SELECT ALL + + 2 + - + COALESCE ( - COUNT ( * ), + 19, - COUNT ( * ) ) * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
46
59
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 0 col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4948
SELECT - CAST( NULL AS SIGNED ) FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col1 HAVING NOT 78 IS NULL
----

skipif mysql # not compatible
query I rowsort label-4948
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col1 HAVING NOT 78 IS NULL
----

query I rowsort
SELECT DISTINCT - 45 FROM tab2 GROUP BY col2 HAVING ( col2 ) IS NOT NULL
----
-45

onlyif mysql # DIV for integer division: 
query I rowsort label-4950
SELECT + + col2 + + col2 + - - col2 * + col2 DIV col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
135
213
24

skipif mysql # not compatible
query I rowsort label-4950
SELECT + + col2 + + col2 + - - col2 * + col2 / col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
135
213
24

onlyif mysql # aggregate syntax: 
query I rowsort label-4951
SELECT - col2 - + - COUNT( * ) + - - 68 + col2 * col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 56 IS NULL
----
1475
621
6231

skipif mysql # not compatible
query I rowsort label-4951
SELECT - col2 - + - COUNT ( * ) + - - 68 + col2 * col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 56 IS NULL
----
1475
621
6231

query I rowsort
SELECT ALL - + 23 FROM tab2 cor0 GROUP BY col0
----
-23
-23
-23

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4953
SELECT CAST( NULL AS SIGNED ) * + col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL > ( col1 * + 0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4953
SELECT CAST ( NULL AS INTEGER ) * + col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL > ( col1 * + 0 )
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-4954
SELECT - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING col0 BETWEEN - + COUNT( DISTINCT - ( + CAST( + 88 AS DECIMAL ) ) ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-4954
SELECT - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING col0 BETWEEN - + COUNT ( DISTINCT - ( + CAST ( + 88 AS REAL ) ) ) AND NULL
----

query I rowsort
SELECT DISTINCT - 66 FROM tab0 AS cor0 GROUP BY col2, col0, col0 HAVING NOT ( NULL ) >= - 40 * + 97
----

onlyif mysql # aggregate syntax: 
query II rowsort label-4956
SELECT + - ( + 63 ) / - - COUNT( * ), col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL <= + 3
----

skipif mysql # not compatible
query II rowsort label-4956
SELECT + - ( + 63 ) / - - COUNT ( * ), col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL <= + 3
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4957
SELECT + 99 * + col1 + - + col2 FROM tab1 GROUP BY col1, col2 HAVING + + MIN( ALL - 20 ) * + col2 + col2 IS NOT NULL
----
4285
5598
586

skipif mysql # not compatible
query I rowsort label-4957
SELECT + 99 * + col1 + - + col2 FROM tab1 GROUP BY col1, col2 HAVING + + MIN ( ALL - 20 ) * + col2 + col2 IS NOT NULL
----
4285
5598
586

onlyif mysql # aggregate syntax: 
query I rowsort label-4958
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - - COUNT( * ) + ( + col0 ) > ( NULL )
----

skipif mysql # not compatible
query I rowsort label-4958
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - - COUNT ( * ) + ( + col0 ) > ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4959
SELECT DISTINCT + col0 - - col1 * - + 7 * - + NULLIF ( col1, col1 / SUM( ALL col2 * - 88 ) + col0 * + 59 ) FROM tab2 AS cor0 GROUP BY col0, col1
----
11859
24458
26062

skipif mysql # not compatible
query I rowsort label-4959
SELECT DISTINCT + col0 - - col1 * - + 7 * - + NULLIF ( col1, col1 / SUM ( ALL col2 * - 88 ) + col0 * + 59 ) FROM tab2 AS cor0 GROUP BY col0, col1
----
11859
24458
26062

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4960
SELECT DISTINCT + ( - CAST( NULL AS DECIMAL ) ) + + + 78 AS col0 FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4960
SELECT DISTINCT + ( - CAST ( NULL AS REAL ) ) + + + 78 AS col0 FROM tab1 GROUP BY col2
----
NULL

query I rowsort
SELECT + - col0 * - + ( - ( - 62 ) ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1612
2666
5146

onlyif mysql # aggregate syntax: 
query I rowsort label-4962
SELECT DISTINCT - - 32 * + - col1 * + MAX( + col2 ) + NULLIF ( MIN( 4 ), 73 ) * col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-148836
-169476
-75864

skipif mysql # not compatible
query I rowsort label-4962
SELECT DISTINCT - - 32 * + - col1 * + MAX ( + col2 ) + NULLIF ( MIN ( 4 ), 73 ) * col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-148836
-169476
-75864

query I rowsort
SELECT col1 - + + col1 AS col0 FROM tab1 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT - 99 FROM tab2 GROUP BY col2 HAVING NOT ( - col2 IS NOT NULL )
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 cor0 WHERE NOT NULL <> col2 GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4966
SELECT ( 10 ) + + - 88 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT ( 10 ) > COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-4966
SELECT ( 10 ) + + - 88 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT ( 10 ) > COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4967
SELECT - COUNT( * ) AS col2 FROM tab1 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4967
SELECT - COUNT ( * ) AS col2 FROM tab1 GROUP BY col0, col0
----
-1
-1
-1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-4968
SELECT COUNT( DISTINCT col1 ) * - CAST( NULL AS SIGNED ) + + + col0, - ( - ( 47 ) ) * col0 FROM tab0 GROUP BY col2, col1, col0 HAVING NULL < NULL
----

skipif mysql # not compatible
query II rowsort label-4968
SELECT COUNT ( DISTINCT col1 ) * - CAST ( NULL AS INTEGER ) + + + col0, - ( - ( 47 ) ) * col0 FROM tab0 GROUP BY col2, col1, col0 HAVING NULL < NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-4969
SELECT 0 AS col0, - 37 col1 FROM tab0 GROUP BY col2, col0, col2, col2 HAVING ( + COUNT( * ) ) NOT BETWEEN - 50 AND + col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4969
SELECT 0 AS col0, - 37 col1 FROM tab0 GROUP BY col2, col0, col2, col2 HAVING ( + COUNT ( * ) ) NOT BETWEEN - 50 AND + col0
----

query I rowsort
SELECT 3 + - + 53 AS col1 FROM tab1 GROUP BY col0, col2, col0 HAVING NULL = - ( - - col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4971
SELECT ALL COUNT( * ) FROM tab0 GROUP BY col1 HAVING ( 95 ) IS NOT NULL
----
1
2

skipif mysql # not compatible
query I rowsort label-4971
SELECT ALL COUNT ( * ) FROM tab0 GROUP BY col1 HAVING ( 95 ) IS NOT NULL
----
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-4972
SELECT MIN( - col2 ) + 20 * + 10 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + COUNT( * ) / + 88 - col0 * 11 NOT BETWEEN NULL AND col0
----

skipif mysql # not compatible
query I rowsort label-4972
SELECT MIN ( - col2 ) + 20 * + 10 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + COUNT ( * ) / + 88 - col0 * 11 NOT BETWEEN NULL AND col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 * 1 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL NOT BETWEEN col1 * 72 + ( 33 ) AND 17 * col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4974
SELECT + ( + COUNT( * ) ) FROM tab0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4974
SELECT + ( + COUNT ( * ) ) FROM tab0 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT + 7 FROM tab2 AS cor0 GROUP BY col1
----
7
7
7

onlyif mysql # aggregate syntax: 
query I rowsort label-4976
SELECT ALL - + MAX( DISTINCT - 90 ) FROM tab1 AS cor0 GROUP BY col0, col1
----
90
90
90

skipif mysql # not compatible
query I rowsort label-4976
SELECT ALL - + MAX ( DISTINCT - 90 ) FROM tab1 AS cor0 GROUP BY col0, col1
----
90
90
90

query I rowsort
SELECT DISTINCT col1 + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-4978
SELECT ALL COUNT( ALL ( - 46 ) ) AS col1 FROM tab2 GROUP BY col2, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4978
SELECT ALL COUNT ( ALL ( - 46 ) ) AS col1 FROM tab2 GROUP BY col2, col0
----
1
1
1

query I rowsort
SELECT ALL - + col0 + 48 + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 59 = + + 97
----
-116
-8
4

onlyif mysql # aggregate syntax: 
query I rowsort label-4980
SELECT 48 col2 FROM tab2 GROUP BY col1, col0, col1 HAVING NOT - - NULLIF ( - SUM( + col2 ), - - MIN( - 73 ) ) * - + MIN( DISTINCT col1 ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4980
SELECT 48 col2 FROM tab2 GROUP BY col1, col0, col1 HAVING NOT - - NULLIF ( - SUM ( + col2 ), - - MIN ( - 73 ) ) * - + MIN ( DISTINCT col1 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT - - col2 + - - col2 * - + 12 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-264
-418
-869

query I rowsort
SELECT + 21 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
21
21
21

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4984
SELECT - 0 + - col0 * col1 AS col1 FROM tab0 cor0 WHERE - 73 IN ( col0 + 17 * col2 * - ( - - CAST( + + col2 AS SIGNED ) ) ) GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-4984
SELECT - 0 + - col0 * col1 AS col1 FROM tab0 cor0 WHERE - 73 IN ( col0 + 17 * col2 * - ( - - CAST ( + + col2 AS INTEGER ) ) ) GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4985
SELECT DISTINCT CAST( NULL AS SIGNED ) * + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4985
SELECT DISTINCT CAST ( NULL AS INTEGER ) * + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT col0 * - + col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-240
-8372
-8556

onlyif mysql # aggregate syntax: 
query I rowsort label-4987
SELECT - + MAX( ALL col0 ) * + col0 / + + 83 FROM tab0 AS cor0 WHERE NOT ( NOT ( 57 IS NOT NULL ) ) GROUP BY col0 HAVING NOT ( - col0 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4987
SELECT - + MAX ( ALL col0 ) * + col0 / + + 83 FROM tab0 AS cor0 WHERE NOT ( NOT ( 57 IS NOT NULL ) ) GROUP BY col0 HAVING NOT ( - col0 ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4988
SELECT - 0 * COUNT( * ) + + + CAST( + + col1 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif mysql # not compatible
query I rowsort label-4988
SELECT - 0 * COUNT ( * ) + + + CAST ( + + col1 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

onlyif mysql # aggregate syntax: 
query I rowsort label-4989
SELECT DISTINCT ( col2 ) FROM tab0 GROUP BY col2, col1 HAVING - ( + MIN( - col1 ) ) <> + 66 * - ( + 87 ) + + 79
----
24
38
79

skipif mysql # not compatible
query I rowsort label-4989
SELECT DISTINCT ( col2 ) FROM tab0 GROUP BY col2, col1 HAVING - ( + MIN ( - col1 ) ) <> + 66 * - ( + 87 ) + + 79
----
24
38
79

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4990
SELECT ALL - ( + 48 ) DIV - COUNT( * ) FROM tab1 GROUP BY col2, col2
----
48
48
48

skipif mysql # not compatible
query I rowsort label-4990
SELECT ALL - ( + 48 ) / - COUNT ( * ) FROM tab1 GROUP BY col2, col2
----
48
48
48

onlyif mysql # aggregate syntax: 
query I rowsort label-4991
SELECT + + MIN( + 97 ) FROM tab1 AS cor0 GROUP BY col0
----
97
97
97

skipif mysql # not compatible
query I rowsort label-4991
SELECT + + MIN ( + 97 ) FROM tab1 AS cor0 GROUP BY col0
----
97
97
97

onlyif mysql # aggregate syntax: 
query I rowsort label-4992
SELECT ALL + ( + col1 ) - - - col1 + + col1 * + ( - COUNT( col1 ) ) + - col1 * - col1 FROM tab2 GROUP BY col1, col1
----
1640
3422
3660

skipif mysql # not compatible
query I rowsort label-4992
SELECT ALL + ( + col1 ) - - - col1 + + col1 * + ( - COUNT ( col1 ) ) + - col1 * - col1 FROM tab2 GROUP BY col1, col1
----
1640
3422
3660

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - 19 col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-19
-19
-19

onlyif mysql # aggregate syntax: 
query I rowsort label-4994
SELECT + + 37 + - ( - + MIN( + - 94 ) ) col2 FROM tab0 cor0 GROUP BY col0 HAVING NOT + - COALESCE ( - + 65, + col0, + COUNT( * ) / + 91 ) <= ( col0 + col0 )
----
-57

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4994
SELECT + + 37 + - ( - + MIN ( + - 94 ) ) col2 FROM tab0 cor0 GROUP BY col0 HAVING NOT + - COALESCE ( - + 65, + col0, + COUNT ( * ) / + 91 ) <= ( col0 + col0 )
----
-57

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-4995
SELECT - col0 DIV 10 col2 FROM tab2 GROUP BY col2, col0 HAVING + COUNT( * ) IS NOT NULL
----
-1
-9
-9

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4995
SELECT - col0 / 10 col2 FROM tab2 GROUP BY col2, col0 HAVING + COUNT ( * ) IS NOT NULL
----
-1
-9
-9

query I rowsort
SELECT - col2 * - - 27 - - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-2107
-605
-943

query I rowsort
SELECT + ( - col2 ) FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4998
SELECT - COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4998
SELECT - COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-4999
SELECT DISTINCT - 46 + - + COUNT( * ) col1 FROM tab1 cor0 GROUP BY col0
----
-47

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4999
SELECT DISTINCT - 46 + - + COUNT ( * ) col1 FROM tab1 cor0 GROUP BY col0
----
-47

onlyif mysql # aggregate syntax: 
query I rowsort label-5000
SELECT col2 + + col2 + + + col2 + MAX( DISTINCT - 86 ) + + 33 FROM tab2 GROUP BY col2
----
121
184
208

skipif mysql # not compatible
query I rowsort label-5000
SELECT col2 + + col2 + + + col2 + MAX ( DISTINCT - 86 ) + + 33 FROM tab2 GROUP BY col2
----
121
184
208

onlyif mysql # aggregate syntax: 
query I rowsort label-5001
SELECT - col2 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IN ( + COUNT( * ), + col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5001
SELECT - col2 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IN ( + COUNT ( * ), + col2 )
----

query I rowsort
SELECT + ( - col1 ) * - + col1 + ( + col1 ) FROM tab2 GROUP BY col1
----
1722
3540
3782

query I rowsort
SELECT DISTINCT + 13 + - col2 FROM tab2 GROUP BY col2
----
-45
-66
-74

onlyif mysql # aggregate syntax: 
query I rowsort label-5004
SELECT SUM( col2 ) FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-5004
SELECT SUM ( col2 ) FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-5005
SELECT DISTINCT + COUNT( * ) - + COUNT( - - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
0

skipif mysql # not compatible
query I rowsort label-5005
SELECT DISTINCT + COUNT ( * ) - + COUNT ( - - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
0

query I rowsort
SELECT ALL + ( - col0 ) * ( + - col0 ) AS col0 FROM tab1 cor0 GROUP BY col0 HAVING 44 IS NOT NULL
----
484
6724
784

query I rowsort
SELECT ALL + - 73 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - 99 + + col0 BETWEEN col0 AND + 54
----
-73
-73
-73

onlyif mysql # DIV for integer division: 
query II rowsort label-5008
SELECT DISTINCT - col0, 58 DIV + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
3
-91
0
-92
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5008
SELECT DISTINCT - col0, 58 / + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
3
-91
0
-92
0

query I rowsort
SELECT ALL - col0 + - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
-153
-30
-73

query I rowsort
SELECT ALL col2 + + 3 + + col2 + - col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL col1 * - col1 * - - ( + col1 ) * - col1 AS col0 FROM tab0 GROUP BY col1
----
0
43046721

onlyif mysql # DIV for integer division: 
query I rowsort label-5012
SELECT ALL + 4 DIV 10 col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5012
SELECT ALL + 4 / 10 col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5013
SELECT DISTINCT 35 + 35, - CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col2
----
70
NULL

skipif mysql # not compatible
query II rowsort label-5013
SELECT DISTINCT 35 + 35, - CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col2
----
70
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5014
SELECT - CASE + - CAST( NULL AS SIGNED ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST( NULL AS SIGNED ) THEN - CAST( 37 AS SIGNED ) * - - col1 - + COUNT( * ) + + + COUNT( * ) END + - + ( CAST( + 88 AS DECIMAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5014
SELECT - CASE + - CAST ( NULL AS INTEGER ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST ( NULL AS INTEGER ) THEN - CAST ( 37 AS INTEGER ) * - - col1 - + COUNT ( * ) + + + COUNT ( * ) END + - + ( CAST ( + 88 AS REAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT col1 AS col0, + 20 FROM tab0 GROUP BY col1, col1
----
0
20
81
20

query I rowsort
SELECT DISTINCT + + 7 + + - col2 + - 57 + - + col2 + 44 FROM tab1 AS cor0 GROUP BY col2, col2
----
-148
-22
-96

onlyif mysql # aggregate syntax: 
query II rowsort label-5017
SELECT DISTINCT + COUNT( * ) col0, + COALESCE ( - 50, - col1, + COUNT( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5017
SELECT DISTINCT + COUNT ( * ) col0, + COALESCE ( - 50, - col1, + COUNT ( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

query I rowsort
SELECT ALL + ( - + 22 ) AS col2 FROM tab2 GROUP BY col1, col1
----
-22
-22
-22

onlyif mysql # aggregate syntax: 
query I rowsort label-5019
SELECT + 57 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5019
SELECT + 57 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5020
SELECT - COUNT( * ) AS col1 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5020
SELECT - COUNT ( * ) AS col1 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

query I rowsort
SELECT - col0 FROM tab2 WHERE NOT ( 56 * col0 ) NOT BETWEEN NULL AND + 15 GROUP BY col0
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5022
SELECT ALL 37 + 24 * - 44 FROM tab2 GROUP BY col1, col0, col0 HAVING col1 * col1 + - COALESCE ( - 56, COUNT( * ) * + col1 ) IN ( CAST( NULL AS SIGNED ) + + 78 )
----

skipif mysql # not compatible
query I rowsort label-5022
SELECT ALL 37 + 24 * - 44 FROM tab2 GROUP BY col1, col0, col0 HAVING col1 * col1 + - COALESCE ( - 56, COUNT ( * ) * + col1 ) IN ( CAST ( NULL AS INTEGER ) + + 78 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5023
SELECT col0 / col0 + 7 * + col0 FROM tab0 GROUP BY col0 HAVING CAST( NULL AS SIGNED ) * + ( 37 ) + + 60 * 82 >= ( - COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-5023
SELECT col0 / col0 + 7 * + col0 FROM tab0 GROUP BY col0 HAVING CAST ( NULL AS INTEGER ) * + ( 37 ) + + 60 * 82 >= ( - COUNT ( * ) )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5024
SELECT DISTINCT 54 DIV - 76 col1 FROM tab0 GROUP BY col2, col0, col0 HAVING ( - COUNT( * ) * + col2 ) NOT IN ( 27 )
----
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5024
SELECT DISTINCT 54 / - 76 col1 FROM tab0 GROUP BY col2, col0, col0 HAVING ( - COUNT ( * ) * + col2 ) NOT IN ( 27 )
----
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5025
SELECT DISTINCT + ( - ( col1 ) ) FROM tab1 WHERE NOT ( + 83 * - 11 + col1 ) <> - 40 GROUP BY col1, col2 HAVING NOT ( + CASE 0 WHEN - ( col2 ) THEN NULL WHEN AVG ( - 67 ) - - 85 THEN + 53 * col2 - COUNT( * ) ELSE NULL END ) <> col2
----

skipif mysql # not compatible
query I rowsort label-5025
SELECT DISTINCT + ( - ( col1 ) ) FROM tab1 WHERE NOT ( + 83 * - 11 + col1 ) <> - 40 GROUP BY col1, col2 HAVING NOT ( + CASE 0 WHEN - ( col2 ) THEN NULL WHEN AVG ( - 67 ) - - 85 THEN + 53 * col2 - COUNT ( * ) ELSE NULL END ) <> col2
----

query I rowsort
SELECT 18 + + 32 * - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT - col1 * + 90 + - col0 NOT IN ( 33 * 33 )
----

query I rowsort
SELECT ALL - 71 * 40 + + col0 AS col0 FROM tab2 GROUP BY col0
----
-2748
-2749
-2825

onlyif mysql # aggregate syntax: 
query I rowsort label-5028
SELECT ALL - COUNT( * ) AS col2 FROM tab2 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5028
SELECT ALL - COUNT ( * ) AS col2 FROM tab2 GROUP BY col0, col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col0 * 90 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5030
SELECT ALL - COUNT( * ) + + col1 * 8 FROM tab0 GROUP BY col1 HAVING 69 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5030
SELECT ALL - COUNT ( * ) + + col1 * 8 FROM tab0 GROUP BY col1 HAVING 69 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5031
SELECT DISTINCT CAST( NULL AS SIGNED ) / col1 FROM tab0 WHERE NOT ( - 29 ) NOT IN ( + COALESCE ( col2, 1 / - col1 ) ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5031
SELECT DISTINCT CAST ( NULL AS INTEGER ) / col1 FROM tab0 WHERE NOT ( - 29 ) NOT IN ( + COALESCE ( col2, 1 / - col1 ) ) GROUP BY col1
----

query I rowsort
SELECT + 77 * col1 FROM tab1 AS cor0 GROUP BY col1
----
3388
4389
462

query I rowsort
SELECT + col2 + 60 FROM tab0 AS cor0 GROUP BY col2 HAVING ( col2 * 41 ) >= NULL
----

query I rowsort
SELECT col1 + col2 FROM tab0 GROUP BY col1, col2 HAVING + ( col1 ) * 52 = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5035
SELECT col1 - + col1 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING + ( col0 ) + col1 NOT BETWEEN NULL AND ( SUM( - 61 ) * 87 )
----
-1640
-3422
-3660

skipif mysql # not compatible
query I rowsort label-5035
SELECT col1 - + col1 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING + ( col0 ) + col1 NOT BETWEEN NULL AND ( SUM ( - 61 ) * 87 )
----
-1640
-3422
-3660

onlyif mysql # aggregate syntax: 
query I rowsort label-5036
SELECT DISTINCT + AVG ( DISTINCT col2 ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL <> COALESCE ( - col2, - ( col2 ) ) * ( + COUNT( * ) + col1 )
----

skipif mysql # not compatible
query I rowsort label-5036
SELECT DISTINCT + AVG ( DISTINCT col2 ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL <> COALESCE ( - col2, - ( col2 ) ) * ( + COUNT ( * ) + col1 )
----

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 WHERE - col2 NOT BETWEEN ( - col1 ) AND + col1 / 94 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT - col1 * 60 + 76 FROM tab0 GROUP BY col1
----
-4784
76

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5040
SELECT CAST( NULL AS SIGNED ) col1 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5040
SELECT CAST ( NULL AS INTEGER ) col1 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 * ( col2 ) FROM tab1 GROUP BY col2, col1
----
2565
3124
48

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + col0, 19, - col2 - col2, + col1 ) * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

onlyif mysql # aggregate syntax: 
query I rowsort label-5043
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NOT - 19 IS NOT NULL GROUP BY col1, col1 HAVING NOT + COUNT( * ) >= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5043
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NOT - 19 IS NOT NULL GROUP BY col1, col1 HAVING NOT + COUNT ( * ) >= ( NULL )
----

query I rowsort
SELECT ALL - col1 - col1 AS col1 FROM tab1 GROUP BY col1
----
-114
-12
-88

onlyif mysql # aggregate syntax: 
query I rowsort label-5045
SELECT DISTINCT + COUNT( * ) FROM tab1 GROUP BY col0, col2 HAVING ( + col2 ) IS NOT NULL
----
1

skipif mysql # not compatible
query I rowsort label-5045
SELECT DISTINCT + COUNT ( * ) FROM tab1 GROUP BY col0, col2 HAVING ( + col2 ) IS NOT NULL
----
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST( NULL AS SIGNED ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST ( NULL AS INTEGER ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5047
SELECT ALL 2 FROM tab2 GROUP BY col1, col0 HAVING NOT COUNT( * ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-5047
SELECT ALL 2 FROM tab2 GROUP BY col1, col0 HAVING NOT COUNT ( * ) <> NULL
----

query I rowsort
SELECT DISTINCT - 97 AS col2 FROM tab0 GROUP BY col1, col0, col0
----
-97

onlyif mysql # aggregate syntax: 
query I rowsort label-5049
SELECT + SUM( 40 ) AS col2 FROM tab1 AS cor0 WHERE 32 NOT BETWEEN ( col1 ) AND ( col2 * + 23 - - 38 ) GROUP BY col0 HAVING NOT + 85 IS NULL
----
40
40

skipif mysql # not compatible
query I rowsort label-5049
SELECT + SUM ( 40 ) AS col2 FROM tab1 AS cor0 WHERE 32 NOT BETWEEN ( col1 ) AND ( col2 * + 23 - - 38 ) GROUP BY col0 HAVING NOT + 85 IS NULL
----
40
40

onlyif mysql # aggregate syntax: 
query I rowsort label-5050
SELECT DISTINCT - + col1 * col1 + COUNT( col1 + col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-6560
2

skipif mysql # not compatible
query I rowsort label-5050
SELECT DISTINCT - + col1 * col1 + COUNT ( col1 + col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-6560
2

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

onlyif mysql # aggregate syntax: 
query I rowsort label-5052
SELECT - + SUM( ALL ( ( 22 ) ) ) FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT ( + COUNT( * ) ) IS NULL
----
-22
-22
-22

skipif mysql # not compatible
query I rowsort label-5052
SELECT - + SUM ( ALL ( ( 22 ) ) ) FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT ( + COUNT ( * ) ) IS NULL
----
-22
-22
-22

onlyif mysql # aggregate syntax: 
query I rowsort label-5053
SELECT + col0 * - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING + col0 * + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5053
SELECT + col0 * - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING + col0 * + COUNT ( * ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5054
SELECT DISTINCT + 61 AS col0 FROM tab1 AS cor0 WHERE ( CAST( NULL AS SIGNED ) ) IS NOT NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-5054
SELECT DISTINCT + 61 AS col0 FROM tab1 AS cor0 WHERE ( CAST ( NULL AS INTEGER ) ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - 59 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
-59
-59
-59

query II rowsort
SELECT - col1, col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT ALL + col1 + col1 + + col1 * - + col1 * col1 FROM tab1 GROUP BY col1 HAVING NOT ( NOT + col1 = - 63 )
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5059
SELECT CAST( NULL AS SIGNED ), ( - - col2 ) FROM tab1 AS cor0 WHERE NULL NOT IN ( - col1 * - 71, col1 * - - col1, - 96 * col2, + col1, - col2 ) GROUP BY col1, col2 HAVING + col2 IS NULL
----

skipif mysql # not compatible
query II rowsort label-5059
SELECT CAST ( NULL AS INTEGER ), ( - - col2 ) FROM tab1 AS cor0 WHERE NULL NOT IN ( - col1 * - 71, col1 * - - col1, - 96 * col2, + col1, - col2 ) GROUP BY col1, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + ( - 5 ) FROM tab0 GROUP BY col0, col2
----
-5
-5
-5

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5063
SELECT COUNT( * ) / 30 AS col0 FROM tab1 GROUP BY col1, col2 HAVING + col2 = - CAST( + col1 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5063
SELECT COUNT ( * ) / 30 AS col0 FROM tab1 GROUP BY col1, col2 HAVING + col2 = - CAST ( + col1 AS INTEGER )
----

query II rowsort
SELECT DISTINCT col1 AS col1, - 95 * - + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
0
2470
0
7885
81
4085

query I rowsort
SELECT ALL + 79 FROM tab0 GROUP BY col0, col2 HAVING NOT + 50 * 15 / + + 46 + + col2 IS NULL
----
79
79
79

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5066
SELECT - 55 * + col2 + + col0 + + - col2 - - col0 * + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + COUNT( * ) + + CAST( NULL AS SIGNED ) - + col2 / col0 IS NULL
----
-1232
-250
1928

skipif mysql # not compatible
query I rowsort label-5066
SELECT - 55 * + col2 + + col0 + + - col2 - - col0 * + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + COUNT ( * ) + + CAST ( NULL AS INTEGER ) - + col2 / col0 IS NULL
----
-1232
-250
1928

query I rowsort
SELECT + + ( - col2 ) * + - 15 + 91 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
1276
1396
961

query I rowsort
SELECT DISTINCT - col1 * + 38 * - ( + - col1 ) * + 63 * + + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT ( + + 54 ) IS NOT NULL
----

query I rowsort
SELECT 1 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT 17 <> - col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5070
SELECT COUNT( * ) AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5070
SELECT COUNT ( * ) AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5071
SELECT + col2 FROM tab1 WHERE NOT - CAST( col2 AS SIGNED ) IS NOT NULL GROUP BY col2 HAVING NOT CAST( col2 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5071
SELECT + col2 FROM tab1 WHERE NOT - CAST ( col2 AS INTEGER ) IS NOT NULL GROUP BY col2 HAVING NOT CAST ( col2 AS INTEGER ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5072
SELECT ALL + ( - col0 ) / col0 + + CAST( NULL AS SIGNED ) * 42 AS col1 FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5072
SELECT ALL + ( - col0 ) / col0 + + CAST ( NULL AS INTEGER ) * 42 AS col1 FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT - 74 AS col2 FROM tab0 GROUP BY col0, col2, col1
----
-74
-74
-74

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5074
SELECT MIN( ALL + CAST( - col1 AS DECIMAL ) ) + + col1 FROM tab2 GROUP BY col2, col2, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5074
SELECT MIN ( ALL + CAST ( - col1 AS REAL ) ) + + col1 FROM tab2 GROUP BY col2, col2, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5075
SELECT DISTINCT + col0 * COUNT( DISTINCT + col0 ) AS col1 FROM tab2 WHERE ( NULL ) <> CAST( - 13 AS SIGNED ) GROUP BY col0 HAVING + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5075
SELECT DISTINCT + col0 * COUNT ( DISTINCT + col0 ) AS col1 FROM tab2 WHERE ( NULL ) <> CAST ( - 13 AS INTEGER ) GROUP BY col0 HAVING + COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5076
SELECT COUNT( * ) DIV + 19 FROM tab2 GROUP BY col2 HAVING NOT ( COUNT( * ) ) IS NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-5076
SELECT COUNT ( * ) / + 19 FROM tab2 GROUP BY col2 HAVING NOT ( COUNT ( * ) ) IS NULL
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5077
SELECT DISTINCT + col0 + + MAX( DISTINCT 43 - 24 ) FROM tab0 GROUP BY col2, col0
----
102
45
62

skipif mysql # not compatible
query I rowsort label-5077
SELECT DISTINCT + col0 + + MAX ( DISTINCT 43 - 24 ) FROM tab0 GROUP BY col2, col0
----
102
45
62

query I rowsort
SELECT DISTINCT + 40 / col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5079
SELECT DISTINCT - SUM( ALL col0 ) col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5079
SELECT DISTINCT - SUM ( ALL col0 ) col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + 11 * ( - 52 ) FROM tab2 GROUP BY col0, col0
----
-572

query I rowsort
SELECT ALL col1 * + col1 AS col2 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL col0 * - col1 FROM tab2 GROUP BY col1, col0 HAVING - col1 + AVG ( - col1 ) IS NOT NULL
----
-3772
-5369
-915

query I rowsort
SELECT + 97 * + col1 FROM tab0 GROUP BY col1
----
0
7857

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5084
SELECT ALL + MAX( + col1 ) DIV - col1 FROM tab1 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5084
SELECT ALL + MAX ( + col1 ) / - col1 FROM tab1 GROUP BY col1
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-5085
SELECT DISTINCT COUNT( * ) FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN + col1 AND ( 10 )
----

skipif mysql # not compatible
query I rowsort label-5085
SELECT DISTINCT COUNT ( * ) FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN + col1 AND ( 10 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5086
SELECT DISTINCT - col2 * + col2 FROM tab1 GROUP BY col2 HAVING COUNT( * ) NOT IN ( - 46 + - COUNT( * ) )
----
-2025
-5041
-64

skipif mysql # not compatible
query I rowsort label-5086
SELECT DISTINCT - col2 * + col2 FROM tab1 GROUP BY col2 HAVING COUNT ( * ) NOT IN ( - 46 + - COUNT ( * ) )
----
-2025
-5041
-64

onlyif mysql # aggregate syntax: 
query I rowsort label-5087
SELECT DISTINCT + SUM( + col1 ) FROM tab0 WHERE 70 IS NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND ( + COALESCE ( SUM( ALL - ( - col0 ) ), - ( - COUNT( ALL - col2 ) ) ) * - col1 )
----

skipif mysql # not compatible
query I rowsort label-5087
SELECT DISTINCT + SUM ( + col1 ) FROM tab0 WHERE 70 IS NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND ( + COALESCE ( SUM ( ALL - ( - col0 ) ), - ( - COUNT ( ALL - col2 ) ) ) * - col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5088
SELECT ALL 73 * COUNT( * ) - col1 FROM tab2 GROUP BY col1, col0, col1 HAVING ( NULL ) NOT IN ( col0 )
----

skipif mysql # not compatible
query I rowsort label-5088
SELECT ALL 73 * COUNT ( * ) - col1 FROM tab2 GROUP BY col1, col0, col1 HAVING ( NULL ) NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT col2 * 19 <= ( 28 )
----
58
79
87

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 + + 38 * ( + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
0
3159

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5092
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT CASE CAST( NULL AS SIGNED ) WHEN COUNT( * ) + ( 74 ) * - 86 THEN MIN( 68 ) ELSE NULL END BETWEEN 4 AND ( 41 ) * - MAX( col0 + col1 * col1 )
----

skipif mysql # not compatible
query I rowsort label-5092
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT CASE CAST ( NULL AS INTEGER ) WHEN COUNT ( * ) + ( 74 ) * - 86 THEN MIN ( 68 ) ELSE NULL END BETWEEN 4 AND ( 41 ) * - MAX ( col0 + col1 * col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5093
SELECT COUNT( * ) * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5093
SELECT COUNT ( * ) * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5094
SELECT - CAST( 60 AS DECIMAL ) FROM tab2 WHERE NOT col2 IS NOT NULL GROUP BY col0, col0
----

skipif mysql # not compatible
query I rowsort label-5094
SELECT - CAST ( 60 AS REAL ) FROM tab2 WHERE NOT col2 IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT - 79 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-79
-79

query I rowsort
SELECT DISTINCT - - 78 * + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
3198
4602
4758

onlyif mysql # aggregate syntax: 
query I rowsort label-5097
SELECT ALL COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5097
SELECT ALL COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE ( col0 ) BETWEEN col2 * - col0 AND - col2 GROUP BY col0, col0
----

query I rowsort
SELECT ALL 18 * + col2 + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1349
152
855

query I rowsort
SELECT - col1 * - col1 + + 15 FROM tab2 cor0 WHERE NULL NOT IN ( col2 ) GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 + col2 / col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + 9 AS col0 FROM tab2 AS cor0 WHERE col2 IN ( + col0 ) GROUP BY col1 HAVING NOT ( 81 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5103
SELECT ALL col0 * COUNT( * ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT ( - MAX( col2 ) ) NOT BETWEEN ( NULL ) AND ( - col2 )
----

skipif mysql # not compatible
query I rowsort label-5103
SELECT ALL col0 * COUNT ( * ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT ( - MAX ( col2 ) ) NOT BETWEEN ( NULL ) AND ( - col2 )
----

query I rowsort
SELECT DISTINCT col2 * + + col0 * + col2 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN NULL AND 55 + 48
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5105
SELECT ALL + 29 FROM tab0 AS cor0 WHERE col1 + 14 IN ( col0 * 17 ) AND - 67 = CAST( NULL AS SIGNED ) GROUP BY col0, col1 HAVING - col0 / - COUNT( * ) + 38 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5105
SELECT ALL + 29 FROM tab0 AS cor0 WHERE col1 + 14 IN ( col0 * 17 ) AND - 67 = CAST ( NULL AS INTEGER ) GROUP BY col0, col1 HAVING - col0 / - COUNT ( * ) + 38 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5106
SELECT - COUNT( * ) * col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-5106
SELECT - COUNT ( * ) * col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT + - col0 + + col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-5109
SELECT ALL - col0 + - col0 * 88 + + COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING 25 BETWEEN ( + 49 / col0 + + 52 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-5109
SELECT ALL - col0 + - col0 * 88 + + COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING 25 BETWEEN ( + 49 / col0 + + 52 ) AND NULL
----

query I rowsort
SELECT ALL + 58 AS col2 FROM tab2 cor0 GROUP BY col1
----
58
58
58

query I rowsort
SELECT DISTINCT + col1 * + + 16 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
1003
1037
697

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5112
SELECT ALL col1 * COUNT( + + 45 ) - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5112
SELECT ALL col1 * COUNT ( + + 45 ) - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ( + col0 ) * + 16 FROM tab2 GROUP BY col0
----
1456
1472
240

onlyif mysql # aggregate syntax: 
query I rowsort label-5114
SELECT - col0 + MAX( - - col0 ) * col0 FROM tab0 GROUP BY col0
----
1806
650
6806

skipif mysql # not compatible
query I rowsort label-5114
SELECT - col0 + MAX ( - - col0 ) * col0 FROM tab0 GROUP BY col0
----
1806
650
6806

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + 22 - 72 * + col2 + - - col2 FROM tab1 GROUP BY col2 HAVING NULL > ( NULL )
----

query I rowsort
SELECT DISTINCT ( - 91 ) AS col1 FROM tab2 GROUP BY col2
----
-91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 71 col2 FROM tab0 GROUP BY col1
----
71
71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5119
SELECT ALL ( - ( col2 ) ) + - col2 + - ( CAST( + 80 AS SIGNED ) ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5119
SELECT ALL ( - ( col2 ) ) + - col2 + - ( CAST ( + 80 AS INTEGER ) ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN ( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5121
SELECT DISTINCT + col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= ( CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-5121
SELECT DISTINCT + col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( - CAST ( NULL AS INTEGER ) ) <= ( CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT ALL + + col0 * + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query II rowsort
SELECT DISTINCT + - col0 * + col0, col0 FROM tab2 cor0 GROUP BY col0
----
-225
15
-8281
91
-8464
92

query I rowsort
SELECT - ( - col2 ) - - CASE CASE 55 WHEN col2 THEN col1 / 55 END WHEN col1 THEN 57 END * col1 AS col2 FROM tab1 AS cor0 WHERE NOT col2 < + col1 GROUP BY col2, col1 HAVING 47 + + col2 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5125
SELECT + + MAX( - 5 ) col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-5
-5
-5

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5125
SELECT + + MAX ( - 5 ) col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-5
-5
-5

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5126
SELECT col1 * - COUNT( * ) FROM tab0 cor0 WHERE + col2 NOT IN ( + col2 ) GROUP BY col1, col0 HAVING + SUM( ALL CAST( + 71 AS SIGNED ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5126
SELECT col1 * - COUNT ( * ) FROM tab0 cor0 WHERE + col2 NOT IN ( + col2 ) GROUP BY col1, col0 HAVING + SUM ( ALL CAST ( + 71 AS INTEGER ) ) IS NOT NULL
----

query I rowsort
SELECT ALL + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 + - col2 AS col0 FROM tab1 GROUP BY col2, col2
----
-142
-16
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 6 col2 FROM tab1 GROUP BY col1, col2
----
6
6
6

query I rowsort
SELECT DISTINCT 79 AS col1 FROM tab2 GROUP BY col1, col2
----
79

query I rowsort
SELECT col0 * - - 17 * 14 * col0 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
1970878
2014432
53550

query I rowsort
SELECT DISTINCT 75 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND col2 GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5133
SELECT - - col1 AS col0, - col1 + - COUNT( * ) - + - col1 * + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
-2
81
-6643

skipif mysql # not compatible
query II rowsort label-5133
SELECT - - col1 AS col0, - col1 + - COUNT ( * ) - + - col1 * + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
-2
81
-6643

onlyif mysql # aggregate syntax: 
query II rowsort label-5134
SELECT DISTINCT - - col2 AS col1, + 61 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - + col2 * + 23 + SUM( DISTINCT + ( col2 ) ) NOT BETWEEN ( NULL ) AND COUNT( DISTINCT 63 ) )
----

skipif mysql # not compatible
query II rowsort label-5134
SELECT DISTINCT - - col2 AS col1, + 61 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - + col2 * + 23 + SUM ( DISTINCT + ( col2 ) ) NOT BETWEEN ( NULL ) AND COUNT ( DISTINCT 63 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab2 GROUP BY col2
----
-58
-79
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-5136
SELECT + + 37 * + col1 / COUNT( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = - ( SUM( + col1 ) )
----

skipif mysql # not compatible
query I rowsort label-5136
SELECT + + 37 * + col1 / COUNT ( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = - ( SUM ( + col1 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5137
SELECT ALL - 92 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( + SUM( DISTINCT col2 ) ) = ( + col0 )
----
-1
-77
0

skipif mysql # not compatible
query I rowsort label-5137
SELECT ALL - 92 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( + SUM ( DISTINCT col2 ) ) = ( + col0 )
----
-1
-77
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5138
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 WHERE NOT NULL IN ( col1 ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5138
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 WHERE NOT NULL IN ( col1 ) GROUP BY col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL 40 - - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT ( - + col1 * + col0 ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT col0 * + + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT - + 26 IS NOT NULL
----

query I rowsort
SELECT + col2 * - col2 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - 27 AS col0 FROM tab0 GROUP BY col1, col2, col2
----
-27

onlyif mysql # aggregate syntax: 
query I rowsort label-5143
SELECT ALL SUM( + col1 ) FROM tab0 GROUP BY col1 HAVING NOT ( + ( MAX( + col2 ) ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5143
SELECT ALL SUM ( + col1 ) FROM tab0 GROUP BY col1 HAVING NOT ( + ( MAX ( + col2 ) ) ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5144
SELECT col0 DIV 62 FROM tab1 GROUP BY col0, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-5144
SELECT col0 / 62 FROM tab1 GROUP BY col0, col0
----
0
0
1

query I rowsort
SELECT - 99 - - ( - col0 ) FROM tab1 WHERE NOT - - col1 BETWEEN NULL AND 30 GROUP BY col0
----
-127
-181

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * - col0 col1 FROM tab2 GROUP BY col1, col0, col1 HAVING ( NOT - col1 * - 41 * + ( NULLIF ( AVG ( + col1 ), col0 ) ) NOT IN ( - 4 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5147
SELECT - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1 HAVING NOT ( + 7 * + - col1 + - - 69 ) NOT IN ( CASE + COUNT( * ) WHEN - 93 THEN 43 - ( 13 ) ELSE NULL END )
----

skipif mysql # not compatible
query I rowsort label-5147
SELECT - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1 HAVING NOT ( + 7 * + - col1 + - - 69 ) NOT IN ( CASE + COUNT ( * ) WHEN - 93 THEN 43 - ( 13 ) ELSE NULL END )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5148
SELECT DISTINCT - COUNT( * ) + + + 60 FROM tab2 cor0 GROUP BY col2, col1 HAVING ( + + CAST( col2 AS SIGNED ) * - + col1 * - 87 + col1 ) IS NOT NULL
----
59

skipif mysql # not compatible
query I rowsort label-5148
SELECT DISTINCT - COUNT ( * ) + + + 60 FROM tab2 cor0 GROUP BY col2, col1 HAVING ( + + CAST ( col2 AS INTEGER ) * - + col1 * - 87 + col1 ) IS NOT NULL
----
59

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - NULLIF ( + 0, + 90 ) col1 FROM tab2 GROUP BY col0 HAVING NULL >= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5150
SELECT + 42 FROM tab2 GROUP BY col2, col2 HAVING NOT + 8 > - SUM( ALL col1 )
----

skipif mysql # not compatible
query I rowsort label-5150
SELECT + 42 FROM tab2 GROUP BY col2, col2 HAVING NOT + 8 > - SUM ( ALL col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5151
SELECT 37 * + COUNT( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT( * ) ) AND ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5151
SELECT 37 * + COUNT ( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT ( * ) ) AND ( NULL )
----

query I rowsort
SELECT ALL + + col0 + + + 86 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IN ( 73 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5153
SELECT ALL COALESCE ( 51, + col1 ) / - col2, - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING - COUNT( * ) <> CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query II rowsort label-5153
SELECT ALL COALESCE ( 51, + col1 ) / - col2, - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING - COUNT ( * ) <> CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL + 76 AS col1 FROM tab2 GROUP BY col2
----
76
76
76

onlyif mysql # aggregate syntax: 
query I rowsort label-5155
SELECT ALL + MIN( ALL CASE 91 WHEN col0 THEN + 46 WHEN ( + 52 ) THEN NULL WHEN - 44 * col2 THEN NULL END ) col1 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5155
SELECT ALL + MIN ( ALL CASE 91 WHEN col0 THEN + 46 WHEN ( + 52 ) THEN NULL WHEN - 44 * col2 THEN NULL END ) col1 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5156
SELECT - col2 + - - 56 - - - COUNT( * ), - col0 col0 FROM tab0 GROUP BY col0, col2, col2 HAVING NOT - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5156
SELECT - col2 + - - 56 - - - COUNT ( * ), - col0 col0 FROM tab0 GROUP BY col0, col2, col2 HAVING NOT - COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5157
SELECT DISTINCT + col0 - COUNT( * ) FROM tab1 GROUP BY col0
----
21
27
81

skipif mysql # not compatible
query I rowsort label-5157
SELECT DISTINCT + col0 - COUNT ( * ) FROM tab1 GROUP BY col0
----
21
27
81

onlyif mysql # aggregate syntax: 
query I rowsort label-5158
SELECT - COUNT( * ) + + + col1 FROM tab1 GROUP BY col0, col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-5158
SELECT - COUNT ( * ) + + + col1 FROM tab1 GROUP BY col0, col1
----
43
5
56

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5159
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( + ( - - MAX( - - ( - col0 ) ) ) ) IN ( 19 )
----
NULL

skipif mysql # not compatible
query I rowsort label-5159
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( + ( - - MAX ( - - ( - col0 ) ) ) ) IN ( 19 )
----
NULL

onlyif mysql # aggregate syntax: 
query II rowsort label-5160
SELECT ALL - col2 + MIN( DISTINCT - col2 ) AS col1, + col2 * + 81 AS col0 FROM tab2 cor0 WHERE NOT + col1 IS NULL GROUP BY col2, col2
----
-116
4698
-158
6399
-174
7047

skipif mysql # not compatible
query II rowsort label-5160
SELECT ALL - col2 + MIN ( DISTINCT - col2 ) AS col1, + col2 * + 81 AS col0 FROM tab2 cor0 WHERE NOT + col1 IS NULL GROUP BY col2, col2
----
-116
4698
-158
6399
-174
7047

query I rowsort
SELECT - 74 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( - 18 <= - - 40 )
----

query I rowsort
SELECT + ( + - col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-5163
SELECT DISTINCT COUNT( * ) FROM tab2 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-5163
SELECT DISTINCT COUNT ( * ) FROM tab2 GROUP BY col1
----
1

query I rowsort
SELECT 40 AS col0 FROM tab1 WHERE NOT + col1 + col0 IS NOT NULL GROUP BY col2 HAVING NOT + 52 IS NULL
----

query I rowsort
SELECT col1 + + col1 AS col1 FROM tab2 GROUP BY col1
----
118
122
82

onlyif mysql # aggregate syntax: 
query I rowsort label-5166
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT( * ) * 30 IS NULL
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-5166
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT ( * ) * 30 IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + col0 > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5168
SELECT ALL + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0 HAVING 24 - + - 3 IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5168
SELECT ALL + - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0 HAVING 24 - + - 3 IS NOT NULL
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-5169
SELECT - COUNT( * ) AS col1 FROM tab2 cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5169
SELECT - COUNT ( * ) AS col1 FROM tab2 cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + 46 AS col2 FROM tab0 GROUP BY col2
----
46

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: DIV for integer division: 
query I rowsort label-5171
SELECT + 84 * - - 60 + NULLIF ( + 82, + 29 * - 51 + - + SUM( ALL + COALESCE ( - CASE - 11 WHEN + col2 * - + col0 THEN + 16 END, + col0 * col0 ) ) * + CAST( NULL AS DECIMAL ) + col1 * col1 ) DIV + col1 FROM tab1 GROUP BY col1
----
5041
5041
5053

skipif mysql # not compatible
query I rowsort label-5171
SELECT + 84 * - - 60 + NULLIF ( + 82, + 29 * - 51 + - + SUM ( ALL + COALESCE ( - CASE - 11 WHEN + col2 * - + col0 THEN + 16 END, + col0 * col0 ) ) * + CAST ( NULL AS REAL ) + col1 * col1 ) / + col1 FROM tab1 GROUP BY col1
----
5041
5041
5053

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - - col1 / 1, col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5174
SELECT DISTINCT + 17 AS col1 FROM tab2 AS cor0 WHERE + col1 * - col2 + col1 + - col0 IN ( ( 82 ) + - CAST( - + col0 AS DECIMAL ) ) GROUP BY col0 HAVING NOT ( - col0 * + MIN( 31 ) ) NOT BETWEEN NULL AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5174
SELECT DISTINCT + 17 AS col1 FROM tab2 AS cor0 WHERE + col1 * - col2 + col1 + - col0 IN ( ( 82 ) + - CAST ( - + col0 AS REAL ) ) GROUP BY col0 HAVING NOT ( - col0 * + MIN ( 31 ) ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-26
-43
-83

query II rowsort
SELECT ALL col1 AS col2, col1 AS col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
41
59
59
61
61

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col2, col1, col2 HAVING - col2 IS NOT NULL
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-5178
SELECT - 83 + - COALESCE ( - 55, - MIN( DISTINCT col1 ), col1 * 33 ) + - col1 * + - 79 FROM tab1 AS cor0 GROUP BY col1, col0
----
3448
446
4475

skipif mysql # not compatible
query I rowsort label-5178
SELECT - 83 + - COALESCE ( - 55, - MIN ( DISTINCT col1 ), col1 * 33 ) + - col1 * + - 79 FROM tab1 AS cor0 GROUP BY col1, col0
----
3448
446
4475

onlyif mysql # aggregate syntax: 
query I rowsort label-5179
SELECT - COUNT( * ) + + - col1 - - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5179
SELECT - COUNT ( * ) + + - col1 - - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1
-1
-1

query I rowsort
SELECT ALL + 72 FROM tab0 GROUP BY col0
----
72
72
72

onlyif mysql # aggregate syntax: 
query I rowsort label-5181
SELECT + + COUNT( ( - + col0 ) ) * + col0 * col0 - 56 * - col0 - col0 * 4 * COUNT( ALL col0 ) FROM tab1 AS cor0 GROUP BY col0
----
10988
1628
2240

skipif mysql # not compatible
query I rowsort label-5181
SELECT + + COUNT ( ( - + col0 ) ) * + col0 * col0 - 56 * - col0 - col0 * 4 * COUNT ( ALL col0 ) FROM tab1 AS cor0 GROUP BY col0
----
10988
1628
2240

onlyif mysql # aggregate syntax: 
query I rowsort label-5182
SELECT 41 / ( - + col1 ) AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5182
SELECT 41 / ( - + col1 ) AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + + COUNT ( * ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 * col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

onlyif mysql # aggregate syntax: 
query I rowsort label-5184
SELECT ALL - col1 * COUNT( * ) + + - COUNT( * ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col1, col0 HAVING - col1 = NULL
----

skipif mysql # not compatible
query I rowsort label-5184
SELECT ALL - col1 * COUNT ( * ) + + - COUNT ( * ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col1, col0 HAVING - col1 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5186
SELECT COUNT( * ) * col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
58
79
87

skipif mysql # not compatible
query I rowsort label-5186
SELECT COUNT ( * ) * col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-5187
SELECT ALL col0 FROM tab2 GROUP BY col0, col0 HAVING NOT + COUNT( * ) + - - 90 IS NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-5187
SELECT ALL col0 FROM tab2 GROUP BY col0, col0 HAVING NOT + COUNT ( * ) + - - 90 IS NULL
----
15
91
92

query II rowsort
SELECT + ( - col0 ) AS col2, col0 + - col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5189
SELECT DISTINCT + 68 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING AVG ( - + col0 ) + - 53 * + + COUNT( * ) IS NOT NULL
----
68

skipif mysql # not compatible
query I rowsort label-5189
SELECT DISTINCT + 68 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING AVG ( - + col0 ) + - 53 * + + COUNT ( * ) IS NOT NULL
----
68

query II rowsort
SELECT DISTINCT col0 - + - col0, col0 FROM tab2 GROUP BY col0
----
182
91
184
92
30
15

query I rowsort
SELECT - 87 AS col0 FROM tab1 AS cor0 WHERE - col0 - + + col2 * + - col0 < - 99 GROUP BY col2, col1, col1
----

query I rowsort
SELECT DISTINCT 10 FROM tab0 cor0 WHERE - col0 NOT BETWEEN + col1 * - col0 AND - - col1 GROUP BY col1
----
10

query I rowsort
SELECT + 77 + + 93 FROM tab2 AS cor0 GROUP BY col2
----
170
170
170

query I rowsort
SELECT DISTINCT 28 FROM tab1 AS cor0 GROUP BY col1, col0
----
28

onlyif mysql # aggregate syntax: 
query I rowsort label-5195
SELECT 79 AS col1 FROM tab0 GROUP BY col1 HAVING ( COUNT( * ) ) <= - COUNT( * ) / 72
----

skipif mysql # not compatible
query I rowsort label-5195
SELECT 79 AS col1 FROM tab0 GROUP BY col1 HAVING ( COUNT ( * ) ) <= - COUNT ( * ) / 72
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5196
SELECT DISTINCT - 5 AS col1 FROM tab1 GROUP BY col2 HAVING + col2 * COUNT( * ) IS NOT NULL
----
-5

skipif mysql # not compatible
query I rowsort label-5196
SELECT DISTINCT - 5 AS col1 FROM tab1 GROUP BY col2 HAVING + col2 * COUNT ( * ) IS NOT NULL
----
-5

query I rowsort
SELECT DISTINCT col0 * - col1 FROM tab0 WHERE + - 84 - + col0 + - 68 * - 3 IS NOT NULL GROUP BY col0, col1
----
-3483
0

query I rowsort
SELECT DISTINCT 53 * - 53 AS col2 FROM tab0 AS cor0 WHERE ( NULL IS NULL ) GROUP BY col0, col0 HAVING NOT + 29 IS NOT NULL
----

query II rowsort
SELECT col1, + 71 * - col1 FROM tab2 AS cor0 WHERE NOT ( NULL IS NULL ) GROUP BY col2, col1 HAVING col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 cor0 WHERE NOT col1 IN ( - - col0, + ( + col2 ) ) GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 * ( - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL 30 FROM tab2 GROUP BY col1
----
30
30
30

query I rowsort
SELECT + 18 AS col0 FROM tab1 GROUP BY col1, col2
----
18
18
18

query I rowsort
SELECT 23 FROM tab0 GROUP BY col1, col2
----
23
23
23

onlyif mysql # aggregate syntax: 
query I rowsort label-5205
SELECT DISTINCT + 24 * + col1 + - col2 + MIN( col1 ) FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col1, col2
----

skipif mysql # not compatible
query I rowsort label-5205
SELECT DISTINCT + 24 * + col1 + - col2 + MIN ( col1 ) FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col1, col2
----

query I rowsort
SELECT + 30 FROM tab1 GROUP BY col2, col0
----
30
30
30

query I rowsort
SELECT 15 + - 76 FROM tab0 GROUP BY col2, col0 HAVING NULL < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5208
SELECT ALL - - COUNT( * ) + + 40 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
41
41
41

skipif mysql # not compatible
query I rowsort label-5208
SELECT ALL - - COUNT ( * ) + + 40 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
41
41
41

onlyif mysql # aggregate syntax: 
query II rowsort label-5209
SELECT ALL COUNT( * ), + col2 * 0 + - 36 / + + 93 + 9 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING - col2 NOT IN ( - + col2 )
----

skipif mysql # not compatible
query II rowsort label-5209
SELECT ALL COUNT ( * ), + col2 * 0 + - 36 / + + 93 + 9 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING - col2 NOT IN ( - + col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5210
SELECT - + COUNT( * ) col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5210
SELECT - + COUNT ( * ) col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-5211
SELECT SUM( 95 ) FROM tab1 GROUP BY col2, col2
----
95
95
95

skipif mysql # not compatible
query I rowsort label-5211
SELECT SUM ( 95 ) FROM tab1 GROUP BY col2, col2
----
95
95
95

onlyif mysql # aggregate syntax: 
query I rowsort label-5212
SELECT DISTINCT - MAX( ALL COALESCE ( col2, + col0, + col1 ) ) + - col2 - - + col2 * + - col1 + - 21 * - col1 * + ( - + 27 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( ( col1 ) BETWEEN NULL AND COUNT( * ) + 40 )
----
-28214
-34974

skipif mysql # not compatible
query I rowsort label-5212
SELECT DISTINCT - MAX ( ALL COALESCE ( col2, + col0, + col1 ) ) + - col2 - - + col2 * + - col1 + - 21 * - col1 * + ( - + 27 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( ( col1 ) BETWEEN NULL AND COUNT ( * ) + 40 )
----
-28214
-34974

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 39, col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
39
41
39
59
39
61

onlyif mysql # aggregate syntax: 
query I rowsort label-5214
SELECT - COUNT( * ) + col1 * col1 + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-2
6641

skipif mysql # not compatible
query I rowsort label-5214
SELECT - COUNT ( * ) + col1 * col1 + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-2
6641

query II rowsort
SELECT col2 * + + col2 / + - AVG ( DISTINCT + ( + - col2 ) ) + col2 * - ( col2 ), + 58 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5216
SELECT DISTINCT col1 DIV - - ( - - col1 ) col0 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5216
SELECT DISTINCT col1 / - - ( - - col1 ) col0 FROM tab1 GROUP BY col1
----
1

query I rowsort
SELECT ALL + 64 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
64
64

query I rowsort
SELECT + col0 AS col2 FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5219
SELECT - MAX( + - 79 ) FROM tab1 AS cor0 GROUP BY col1, col2
----
79
79
79

skipif mysql # not compatible
query I rowsort label-5219
SELECT - MAX ( + - 79 ) FROM tab1 AS cor0 GROUP BY col1, col2
----
79
79
79

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT + ( col2 ) AS col2 FROM tab2 GROUP BY col2
----
58
79
87

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5222
SELECT ALL + col2 + - + COUNT( * ) FROM tab0 GROUP BY col2, col2 HAVING NOT - 86 + - col2 NOT BETWEEN - NULLIF ( ( col2 ), - + 49 + 95 + AVG ( ALL + col1 ) + + 60 + - 43 * - COUNT( * ) / - + 6 ) + + 59 AND ( + CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-5222
SELECT ALL + col2 + - + COUNT ( * ) FROM tab0 GROUP BY col2, col2 HAVING NOT - 86 + - col2 NOT BETWEEN - NULLIF ( ( col2 ), - + 49 + 95 + AVG ( ALL + col1 ) + + 60 + - 43 * - COUNT ( * ) / - + 6 ) + + 59 AND ( + CAST ( NULL AS REAL ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5223
SELECT SUM( ALL col0 ) FROM tab2 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-5223
SELECT SUM ( ALL col0 ) FROM tab2 GROUP BY col0
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-5224
SELECT DISTINCT - ( + COUNT( * ) ) FROM tab0 GROUP BY col0, col0
----
-1

skipif mysql # not compatible
query I rowsort label-5224
SELECT DISTINCT - ( + COUNT ( * ) ) FROM tab0 GROUP BY col0, col0
----
-1

query I rowsort
SELECT ALL - 19 FROM tab2 WHERE NULL IS NULL GROUP BY col1, col2, col1
----
-19
-19
-19

query I rowsort
SELECT ALL col0 + 91 FROM tab0 GROUP BY col0 HAVING 51 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5227
SELECT - CAST( NULL AS SIGNED ), + col1 * + CAST( - 76 AS SIGNED ) AS col0 FROM tab1 GROUP BY col1
----
NULL
-3344
NULL
-4332
NULL
-456

skipif mysql # not compatible
query II rowsort label-5227
SELECT - CAST ( NULL AS INTEGER ), + col1 * + CAST ( - 76 AS INTEGER ) AS col0 FROM tab1 GROUP BY col1
----
NULL
-3344
NULL
-4332
NULL
-456

onlyif mysql # aggregate syntax: 
query I rowsort label-5228
SELECT ALL + SUM( DISTINCT - col1 ) col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5228
SELECT ALL + SUM ( DISTINCT - col1 ) col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + ( + col2 ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - - 39 AS col2 FROM tab1 WHERE NOT - NULLIF ( col1, col1 ) * + + col0 BETWEEN + + col0 AND NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5231
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING + MAX( DISTINCT + 17 ) IS NOT NULL
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-5231
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING + MAX ( DISTINCT + 17 ) IS NOT NULL
----
-44
-57
-6

onlyif mysql # aggregate syntax: 
query I rowsort label-5232
SELECT DISTINCT + COUNT( * ) - - + COUNT( * ) FROM tab1 GROUP BY col2, col0
----
2

skipif mysql # not compatible
query I rowsort label-5232
SELECT DISTINCT + COUNT ( * ) - - + COUNT ( * ) FROM tab1 GROUP BY col2, col0
----
2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5233
SELECT CAST( 7 AS SIGNED ) * + col2 FROM tab0 AS cor0 WHERE NOT - col0 * - 45 + + + col1 IN ( 51 * + 56 - - NULLIF ( - col2, - col1 + + + col2 ), 79 ) GROUP BY col0, col0, col2
----
168
266
553

skipif mysql # not compatible
query I rowsort label-5233
SELECT CAST ( 7 AS INTEGER ) * + col2 FROM tab0 AS cor0 WHERE NOT - col0 * - 45 + + + col1 IN ( 51 * + 56 - - NULLIF ( - col2, - col1 + + + col2 ), 79 ) GROUP BY col0, col0, col2
----
168
266
553

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5234
SELECT - 5 + + ( - - 45 ) * 58 - + + col2 - + ( + 31 ) + ( + COUNT( * ) ) + col2 + COUNT( * ) * - + 92 * - COUNT( + 70 ) * col2 DIV - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + 80 + - col2 - col2 IS NOT NULL
----
2667
2667
2667

skipif mysql # not compatible
query I rowsort label-5234
SELECT - 5 + + ( - - 45 ) * 58 - + + col2 - + ( + 31 ) + ( + COUNT ( * ) ) + col2 + COUNT ( * ) * - + 92 * - COUNT ( + 70 ) * col2 / - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + 80 + - col2 - col2 IS NOT NULL
----
2667
2667
2667

onlyif mysql # aggregate syntax: 
query I rowsort label-5235
SELECT ALL + COUNT( * ) * - - col2 * - 15 FROM tab1 AS cor0 GROUP BY col2
----
-1065
-120
-675

skipif mysql # not compatible
query I rowsort label-5235
SELECT ALL + COUNT ( * ) * - - col2 * - 15 FROM tab1 AS cor0 GROUP BY col2
----
-1065
-120
-675

onlyif mysql # aggregate syntax: 
query I rowsort label-5236
SELECT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col0, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5236
SELECT + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0, col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * + 24 col1 FROM tab2 GROUP BY col0
----
2184
2208
360

query I rowsort
SELECT ALL 49 FROM tab1 AS cor0 GROUP BY col1, col0
----
49
49
49

query I rowsort
SELECT DISTINCT + ( 47 ) AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
47

query I rowsort
SELECT DISTINCT - - col1 + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
126
28
85

onlyif mysql # DIV for integer division: 
query II rowsort label-5241
SELECT DISTINCT - - 81 DIV - - col2 col1, col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING ( + col2 DIV + 58 ) <> 48
----
1
0
2
0
3
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5241
SELECT DISTINCT - - 81 / - - col2 col1, col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING ( + col2 / + 58 ) <> 48
----
1
0
2
0
3
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5242
SELECT 9 * + + 1 * - + CAST( NULL AS SIGNED ) * + - col0 FROM tab1 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5242
SELECT 9 * + + 1 * - + CAST ( NULL AS INTEGER ) * + - col0 FROM tab1 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col1 + - col2 * col1 FROM tab2 GROUP BY col2, col1
----
-2337
-4602
-5246

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col2, col0, col2 HAVING + 7 * - 81 > NULL
----

query I rowsort
SELECT ALL - - 22 FROM tab1 cor0 GROUP BY col1
----
22
22
22

query I rowsort
SELECT - 31 * + 14 AS col2 FROM tab0 AS cor0 WHERE NOT NULL = 25 GROUP BY col2, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5247
SELECT - + col2 * + MAX( ALL + - col2 ) * + + COUNT( * ) * - - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

skipif mysql # not compatible
query I rowsort label-5247
SELECT - + col2 * + MAX ( ALL + - col2 ) * + + COUNT ( * ) * - - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

onlyif mysql # aggregate syntax: 
query I rowsort label-5248
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + 82 * col1 + - COUNT( * ) IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-5248
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + 82 * col1 + - COUNT ( * ) IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + + 62 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
62

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 WHERE - ( + col2 ) IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 78 AS col0 FROM tab2 GROUP BY col1, col1
----
78
78
78

onlyif mysql # aggregate syntax: 
query I rowsort label-5253
SELECT - NULLIF ( + col1, - COUNT( * ) ) AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL > + COUNT( * ) + col0
----

skipif mysql # not compatible
query I rowsort label-5253
SELECT - NULLIF ( + col1, - COUNT ( * ) ) AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL > + COUNT ( * ) + col0
----

query I rowsort
SELECT + 17 + - 67 AS col1 FROM tab0 GROUP BY col0, col1 HAVING + col0 < + - col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5255
SELECT ( SUM( + 65 ) ) * - col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5255
SELECT ( SUM ( + 65 ) ) * - col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5256
SELECT col2 * - 96 + - col2 FROM tab2 GROUP BY col2 HAVING NOT + - COUNT( * ) * 9 BETWEEN AVG ( ALL - - 13 ) AND ( NULL )
----
-5626
-7663
-8439

skipif mysql # not compatible
query I rowsort label-5256
SELECT col2 * - 96 + - col2 FROM tab2 GROUP BY col2 HAVING NOT + - COUNT ( * ) * 9 BETWEEN AVG ( ALL - - 13 ) AND ( NULL )
----
-5626
-7663
-8439

query I rowsort
SELECT ALL - - 91 FROM tab0 AS cor0 GROUP BY col0, col1
----
91
91
91

query I rowsort
SELECT + col1 * - 26 - - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-2187
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5259
SELECT - COUNT( * ) FROM tab2 GROUP BY col1, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5259
SELECT - COUNT ( * ) FROM tab2 GROUP BY col1, col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + 53 FROM tab2 GROUP BY col2, col1
----
53

query I rowsort
SELECT ALL + col2 + + 37 - + col2 * col1 * - + 55 FROM tab2 GROUP BY col2, col1
----
130885
256471
292009

onlyif mysql # aggregate syntax: 
query I rowsort label-5262
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL >= - - COUNT( * ) * - 78
----

skipif mysql # not compatible
query I rowsort label-5262
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL >= - - COUNT ( * ) * - 78
----

query I rowsort
SELECT DISTINCT + - 42 + - + 8 FROM tab0 AS cor0 GROUP BY col0
----
-50

query I rowsort
SELECT DISTINCT + 69 FROM tab0 GROUP BY col0 HAVING - col0 * - - 25 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5265
SELECT + COUNT( * ) AS col2, - COUNT( * ) / + col0 FROM tab2 GROUP BY col0 HAVING + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-5265
SELECT + COUNT ( * ) AS col2, - COUNT ( * ) / + col0 FROM tab2 GROUP BY col0 HAVING + COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5266
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5266
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT COUNT ( * ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 51 / col2 + - - 60 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5268
SELECT ALL + col2 + + - CAST( 82 AS SIGNED ) FROM tab1 cor0 GROUP BY col2
----
-11
-37
-74

skipif mysql # not compatible
query I rowsort label-5268
SELECT ALL + col2 + + - CAST ( 82 AS INTEGER ) FROM tab1 cor0 GROUP BY col2
----
-11
-37
-74

onlyif mysql # aggregate syntax: 
query I rowsort label-5269
SELECT ( - 0 ) * - COUNT( * ) + + col1 - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5269
SELECT ( - 0 ) * - COUNT ( * ) + + col1 - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5270
SELECT ALL + COUNT( col2 ) * - + MAX( DISTINCT + col2 ) + + COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-23
-37
-78

skipif mysql # not compatible
query I rowsort label-5270
SELECT ALL + COUNT ( col2 ) * - + MAX ( DISTINCT + col2 ) + + COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-23
-37
-78

onlyif mysql # aggregate syntax: 
query II rowsort label-5271
SELECT DISTINCT - col0 + + - col1 * col1 * + COUNT( * ), COUNT( * ) * + 85 * COUNT( * ) + - 31 AS col2 FROM tab1 GROUP BY col0, col1
----
-2018
54
-3277
54
-58
54

skipif mysql # not compatible
query II rowsort label-5271
SELECT DISTINCT - col0 + + - col1 * col1 * + COUNT ( * ), COUNT ( * ) * + 85 * COUNT ( * ) + - 31 AS col2 FROM tab1 GROUP BY col0, col1
----
-2018
54
-3277
54
-58
54

onlyif mysql # DIV for integer division: 
query I rowsort label-5272
SELECT DISTINCT + 87 DIV - col0 AS col1 FROM tab1 GROUP BY col0, col1
----
-1
-3

skipif mysql # not compatible
query I rowsort label-5272
SELECT DISTINCT + 87 / - col0 AS col1 FROM tab1 GROUP BY col0, col1
----
-1
-3

query II rowsort
SELECT + col1 + - col1, + col1 FROM tab2 GROUP BY col1
----
0
41
0
59
0
61

query I rowsort
SELECT DISTINCT - AVG ( - + col0 ) * - col1 * - col1 + + + 1 FROM tab0 GROUP BY col0, col1 HAVING NOT - 0 NOT BETWEEN - col0 + AVG ( ALL - 15 ) * col0 * + 49 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5275
SELECT - col2 * - 12 FROM tab1 GROUP BY col2 HAVING NOT NULL = + SUM( DISTINCT - col0 ) / - - 4
----

skipif mysql # not compatible
query I rowsort label-5275
SELECT - col2 * - 12 FROM tab1 GROUP BY col2 HAVING NOT NULL = + SUM ( DISTINCT - col0 ) / - - 4
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0, col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
81

query I rowsort
SELECT - 24 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5279
SELECT DISTINCT + + MIN( - 30 ) FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-30

skipif mysql # not compatible
query I rowsort label-5279
SELECT DISTINCT + + MIN ( - 30 ) FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-30

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5280
SELECT + 43 DIV - COUNT( * ) FROM tab0 AS cor0 GROUP BY col0, col2
----
-43
-43
-43

skipif mysql # not compatible
query I rowsort label-5280
SELECT + 43 / - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0, col2
----
-43
-43
-43

onlyif mysql # aggregate syntax: 
query I rowsort label-5281
SELECT - ( COUNT( * ) ) FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5281
SELECT - ( COUNT ( * ) ) FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT - - col1 + + 98 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5283
SELECT 21 AS col1 FROM tab0 GROUP BY col2 HAVING + AVG ( - col1 ) * - + col2 <> + COUNT( * )
----
21
21
21

skipif mysql # not compatible
query I rowsort label-5283
SELECT 21 AS col1 FROM tab0 GROUP BY col2 HAVING + AVG ( - col1 ) * - + col2 <> + COUNT ( * )
----
21
21
21

query I rowsort
SELECT DISTINCT + 0 * + col0 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
0

query I rowsort
SELECT - col2 * + - 78 FROM tab1 GROUP BY col2 HAVING NOT + 50 * col2 >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5286
SELECT DISTINCT COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5286
SELECT DISTINCT COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + 51 AS col0 FROM tab0 cor0 GROUP BY col1, col2, col2
----
51
51
51

query I rowsort
SELECT ALL + 25 FROM tab1 AS cor0 GROUP BY col2
----
25
25
25

onlyif mysql # aggregate syntax: 
query I rowsort label-5289
SELECT ALL + + COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5289
SELECT ALL + + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( 77 ) col2 FROM tab0 GROUP BY col0
----
77
77
77

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab0 GROUP BY col0, col0
----
-1849
-676
-6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5292
SELECT + CAST( NULL AS SIGNED ) + - col0 AS col2 FROM tab1 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5292
SELECT + CAST ( NULL AS INTEGER ) + - col0 AS col2 FROM tab1 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT - col1 * + col1 * + - 34 FROM tab2 cor0 GROUP BY col1
----
118354
126514
57154

query I rowsort
SELECT ALL col0 * + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5296
SELECT - col2 * COUNT( * ) FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-5296
SELECT - col2 * COUNT ( * ) FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL + ( 12 ) FROM tab2 GROUP BY col0
----
12
12
12

onlyif mysql # DIV for integer division: 
query I rowsort label-5298
SELECT 80 DIV - col0 AS col1 FROM tab1 GROUP BY col0
----
-2
-3
0

skipif mysql # not compatible
query I rowsort label-5298
SELECT 80 / - col0 AS col1 FROM tab1 GROUP BY col0
----
-2
-3
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5299
SELECT DISTINCT COUNT( * ) FROM tab1 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-5299
SELECT DISTINCT COUNT ( * ) FROM tab1 GROUP BY col0
----
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT( * ) * - col1 + + 1 WHEN - CAST( NULL AS SIGNED ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT ( * ) * - col1 + + 1 WHEN - CAST ( NULL AS INTEGER ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

query II rowsort
SELECT ALL + col1, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT - 76 * - + 16 FROM tab0 AS cor0 GROUP BY col1
----
1216
1216

onlyif mysql # aggregate syntax: 
query II rowsort label-5303
SELECT - + col1 * - 11 AS col2, COUNT( * ) FROM tab1 cor0 GROUP BY col1
----
484
1
627
1
66
1

skipif mysql # not compatible
query II rowsort label-5303
SELECT - + col1 * - 11 AS col2, COUNT ( * ) FROM tab1 cor0 GROUP BY col1
----
484
1
627
1
66
1

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT ALL - 94 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-94
-94

query I rowsort
SELECT ( - + col2 ) FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-5307
SELECT DISTINCT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT COUNT( * ) IS NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-5307
SELECT DISTINCT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT COUNT ( * ) IS NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query II rowsort label-5308
SELECT + - COUNT( * ), 38 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL > col1 + - + col1
----

skipif mysql # not compatible
query II rowsort label-5308
SELECT + - COUNT ( * ), 38 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL > col1 + - + col1
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1 HAVING 58 IS NOT NULL
----
-81
0

query I rowsort
SELECT + ( + + 6 ) FROM tab1 GROUP BY col2 HAVING NOT 5 IS NULL
----
6
6
6

query I rowsort
SELECT ALL 54 - + + 93 FROM tab1 GROUP BY col2
----
-39
-39
-39

query I rowsort
SELECT ALL - - 97 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL = + 59
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5313
SELECT DISTINCT - COUNT( ( - col2 ) ) FROM tab2 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-5313
SELECT DISTINCT - COUNT ( ( - col2 ) ) FROM tab2 AS cor0 GROUP BY col2
----
-1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5314
SELECT + 78, + 86 + SUM( + CAST( NULL AS SIGNED ) ) * 45 / col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
78
NULL
78
NULL
78
NULL

skipif mysql # not compatible
query II rowsort label-5314
SELECT + 78, + 86 + SUM ( + CAST ( NULL AS INTEGER ) ) * 45 / col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
78
NULL
78
NULL
78
NULL

query I rowsort
SELECT DISTINCT + 77 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL >= + col2
----

query I rowsort
SELECT - col0 / + + col0 + + col0 * 81 AS col1 FROM tab2 GROUP BY col0 HAVING NOT + - col0 IS NOT NULL
----

query I rowsort
SELECT ( - col1 ) * 89 FROM tab1 GROUP BY col1
----
-3916
-5073
-534

query I rowsort
SELECT - col1 + + - ( - - 6 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-47
-65
-67

onlyif mysql # aggregate syntax: 
query I rowsort label-5319
SELECT DISTINCT - 67 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + SUM( ALL col1 ) + - - 59 - ( 27 ) * - + COUNT( * ) + + + col0 * - - 69 <> - - COUNT( * ) * - - COUNT( * ) + - ( col1 )
----

skipif mysql # not compatible
query I rowsort label-5319
SELECT DISTINCT - 67 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + SUM ( ALL col1 ) + - - 59 - ( 27 ) * - + COUNT ( * ) + + + col0 * - - 69 <> - - COUNT ( * ) * - - COUNT ( * ) + - ( col1 )
----

query I rowsort
SELECT + 12 FROM tab0 AS cor0 WHERE NULL > 76 GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5321
SELECT + + ( - COUNT( * ) ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5321
SELECT + + ( - COUNT ( * ) ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query II rowsort label-5322
SELECT - ( col2 ) + - col2 + + COUNT( * ) AS col0, col1 + + + col1 * - - 98 FROM tab2 AS cor0 GROUP BY col2, col1
----
-115
4059
-157
5841
-173
6039

skipif mysql # not compatible
query II rowsort label-5322
SELECT - ( col2 ) + - col2 + + COUNT ( * ) AS col0, col1 + + + col1 * - - 98 FROM tab2 AS cor0 GROUP BY col2, col1
----
-115
4059
-157
5841
-173
6039

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
26
43
83

query I rowsort
SELECT ALL - + col0 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN col0 AND + col0 + col2 / + col0 GROUP BY col0
----

query I rowsort
SELECT ALL - 70 + 7 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-63
-63
-63

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-5326
SELECT ( 87 ) + - + col0 + - CAST( + + 83 AS SIGNED ) + col0 DIV col0 AS col1 FROM tab1 GROUP BY col0
----
-17
-23
-77

skipif mysql # not compatible
query I rowsort label-5326
SELECT ( 87 ) + - + col0 + - CAST ( + + 83 AS INTEGER ) + col0 / col0 AS col1 FROM tab1 GROUP BY col0
----
-17
-23
-77

onlyif mysql # aggregate syntax: 
query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX ( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5328
SELECT DISTINCT - 48 + - col1 * + 71 + + - 11 * - 27 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN - col1 AND + col1 * CAST( 13 AS SIGNED ) + + 72 + 65 * - 24
----

skipif mysql # not compatible
query I rowsort label-5328
SELECT DISTINCT - 48 + - col1 * + 71 + + - 11 * - 27 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN - col1 AND + col1 * CAST ( 13 AS INTEGER ) + + 72 + 65 * - 24
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5329
SELECT + + col2 / + COUNT( * ) + 63 + - ( - col2 ) / - col2 AS col0, - col2 * + COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
120
-58
141
-79
149
-87

skipif mysql # not compatible
query II rowsort label-5329
SELECT + + col2 / + COUNT ( * ) + 63 + - ( - col2 ) / - col2 AS col0, - col2 * + COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
120
-58
141
-79
149
-87

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5330
SELECT + CAST( NULL AS DECIMAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5330
SELECT + CAST ( NULL AS REAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

query I rowsort
SELECT DISTINCT - 11 FROM tab1 GROUP BY col2, col1
----
-11

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN ( NULL ) AND col1
----

query I rowsort
SELECT ALL col0 FROM tab0 WHERE NOT - col1 <= 95 GROUP BY col0
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5335
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NOT ( CAST( NULL AS SIGNED ) * - 90 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5335
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NOT ( CAST ( NULL AS INTEGER ) * - 90 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL + 59 + + 16 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IN ( - 70 )
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE ( + 40 * col1 ) IS NOT NULL GROUP BY col0, col1
----
15
91
92

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5340
SELECT COUNT( DISTINCT + CAST( NULL AS SIGNED ) ) + 93 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( COUNT( * ) ) = 94 / COUNT( * )
----
93
93
93

skipif mysql # not compatible
query I rowsort label-5340
SELECT COUNT ( DISTINCT + CAST ( NULL AS INTEGER ) ) + 93 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( COUNT ( * ) ) = 94 / COUNT ( * )
----
93
93
93

onlyif mysql # aggregate syntax: 
query I rowsort label-5341
SELECT DISTINCT col2 * COUNT( * ) + 9 col1 FROM tab0 GROUP BY col0, col2
----
33
47
88

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5341
SELECT DISTINCT col2 * COUNT ( * ) + 9 col1 FROM tab0 GROUP BY col0, col2
----
33
47
88

onlyif mysql # aggregate syntax: 
query I rowsort label-5342
SELECT ALL COUNT( * ) * 12 FROM tab2 GROUP BY col1
----
12
12
12

skipif mysql # not compatible
query I rowsort label-5342
SELECT ALL COUNT ( * ) * 12 FROM tab2 GROUP BY col1
----
12
12
12

query I rowsort
SELECT + 41 FROM tab1 AS cor0 WHERE NULL = NULLIF ( NULLIF ( col2, + ( col2 ) ), COALESCE ( col0, - col0 ) ) GROUP BY col1
----

query I rowsort
SELECT ALL + 65 FROM tab0 AS cor0 WHERE 11 IS NOT NULL GROUP BY col2
----
65
65
65

query I rowsort
SELECT 22 FROM tab1 AS cor0 WHERE + 4 NOT BETWEEN 61 AND ( - col2 + col2 / 67 ) GROUP BY col0, col1, col2
----
22
22
22

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5346
SELECT - 34 - CAST( + CAST( col1 AS SIGNED ) AS SIGNED ) FROM tab0 GROUP BY col1, col1 HAVING NOT - 76 IS NULL
----
-115
-34

skipif mysql # not compatible
query I rowsort label-5346
SELECT - 34 - CAST ( + CAST ( col1 AS INTEGER ) AS INTEGER ) FROM tab0 GROUP BY col1, col1 HAVING NOT - 76 IS NULL
----
-115
-34

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT + 86 - + col2 * col2 FROM tab0 GROUP BY col2 HAVING NOT - AVG ( - 80 ) >= - 60
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5349
SELECT COUNT( * ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT IN ( NULLIF ( 33, ( COUNT( * ) ) ) )
----

skipif mysql # not compatible
query I rowsort label-5349
SELECT COUNT ( * ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT IN ( NULLIF ( 33, ( COUNT ( * ) ) ) )
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT col0 + - col0 * col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT - 56 IS NULL
----
-462
-6642
-756

query I rowsort
SELECT DISTINCT + 86 AS col1 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
86

onlyif mysql # aggregate syntax: 
query I rowsort label-5353
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT + MAX( DISTINCT col0 ) IN ( - 3 )
----
44
57
6

skipif mysql # not compatible
query I rowsort label-5353
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT + MAX ( DISTINCT col0 ) IN ( - 3 )
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 * - col1 / 31 - - ( + col1 + + col1 * col1 ) FROM tab1 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NOT col0 >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5356
SELECT ALL COUNT( + 0 ) + 36 FROM tab0 AS cor0 GROUP BY col1
----
37
38

skipif mysql # not compatible
query I rowsort label-5356
SELECT ALL COUNT ( + 0 ) + 36 FROM tab0 AS cor0 GROUP BY col1
----
37
38

onlyif mysql # aggregate syntax: 
query I rowsort label-5357
SELECT + + COUNT( * ) FROM tab2 cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5357
SELECT + + COUNT ( * ) FROM tab2 cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT 75 FROM tab2 AS cor0 GROUP BY col1
----
75

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5359
SELECT CAST( NULL AS DECIMAL ) + - col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5359
SELECT CAST ( NULL AS REAL ) + - col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5360
SELECT ( - NULLIF ( + + ( - col2 ), MAX( + col1 ) ) ) AS col1 FROM tab1 GROUP BY col2 HAVING + 52 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5360
SELECT ( - NULLIF ( + + ( - col2 ), MAX ( + col1 ) ) ) AS col1 FROM tab1 GROUP BY col2 HAVING + 52 IS NULL
----

query I rowsort
SELECT ALL + 38 AS col0 FROM tab1 GROUP BY col1, col2 HAVING col1 * + col1 IS NOT NULL
----
38
38
38

onlyif mysql # aggregate syntax: 
query II rowsort label-5362
SELECT DISTINCT col2, ( + COUNT( * ) ) AS col1 FROM tab0 GROUP BY col2, col2
----
24
1
38
1
79
1

skipif mysql # not compatible
query II rowsort label-5362
SELECT DISTINCT col2, ( + COUNT ( * ) ) AS col1 FROM tab0 GROUP BY col2, col2
----
24
1
38
1
79
1

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5363
SELECT DISTINCT + ( + ( - COUNT( * ) ) ) DIV 41 FROM tab0 AS cor0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-5363
SELECT DISTINCT + ( + ( - COUNT ( * ) ) ) / 41 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT 34 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-10
-23
28

onlyif mysql # aggregate syntax: 
query I rowsort label-5365
SELECT DISTINCT + + 37 + + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= - 63 / 26 + + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5365
SELECT DISTINCT + + 37 + + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= - 63 / 26 + + COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5366
SELECT DISTINCT - MAX( + + 18 ) FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col2 HAVING NOT 39 * 29 + 98 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5366
SELECT DISTINCT - MAX ( + + 18 ) FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col2 HAVING NOT 39 * 29 + 98 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5367
SELECT + 56 + col1 FROM tab0 AS cor0 WHERE 95 IS NULL GROUP BY col1 HAVING NOT ( - CAST( NULL AS SIGNED ) ) < + col1
----

skipif mysql # not compatible
query I rowsort label-5367
SELECT + 56 + col1 FROM tab0 AS cor0 WHERE 95 IS NULL GROUP BY col1 HAVING NOT ( - CAST ( NULL AS INTEGER ) ) < + col1
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5368
SELECT ALL CAST( + CAST( NULL AS SIGNED ) AS DECIMAL ) FROM tab1 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5368
SELECT ALL CAST ( + CAST ( NULL AS INTEGER ) AS REAL ) FROM tab1 GROUP BY col0, col1
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5369
SELECT MIN( - NULLIF ( + col1, + 10 ) ) * - 78 - - col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
676
6889
8167

skipif mysql # not compatible
query I rowsort label-5369
SELECT MIN ( - NULLIF ( + col1, + 10 ) ) * - 78 - - col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
676
6889
8167

query II rowsort
SELECT - 25 * + + col0 AS col2, col2 FROM tab2 GROUP BY col0, col2 HAVING + NULLIF ( + 86, col2 ) IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING NOT ( NULL ) BETWEEN ( 17 ) AND ( NULL )
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NULL NOT BETWEEN col0 AND NULL GROUP BY col1 HAVING NULL <> NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5374
SELECT ALL - COUNT( * ) + 25 * + CAST( NULL AS SIGNED ) / + - col1 * 77 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5374
SELECT ALL - COUNT ( * ) + 25 * + CAST ( NULL AS INTEGER ) / + - col1 * 77 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5375
SELECT DISTINCT 9 + + col0 * col0 FROM tab1 WHERE + CAST( + + col2 AS SIGNED ) > ( NULL ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-5375
SELECT DISTINCT 9 + + col0 * col0 FROM tab1 WHERE + CAST ( + + col2 AS INTEGER ) > ( NULL ) GROUP BY col0
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5376
SELECT ALL - MIN( + - CAST( NULL AS SIGNED ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( ( NULL ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-5376
SELECT ALL - MIN ( + - CAST ( NULL AS INTEGER ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( ( NULL ) IS NULL )
----

query II rowsort
SELECT + col1, + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT 67 + 63 FROM tab0 AS cor0 GROUP BY col1
----
130
130

query I rowsort
SELECT DISTINCT - 59 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-59

onlyif mysql # aggregate syntax: 
query I rowsort label-5380
SELECT DISTINCT + col1 + 16 FROM tab0 GROUP BY col1, col1 HAVING + COUNT( * ) * + col1 IS NOT NULL
----
16
97

skipif mysql # not compatible
query I rowsort label-5380
SELECT DISTINCT + col1 + 16 FROM tab0 GROUP BY col1, col1 HAVING + COUNT ( * ) * + col1 IS NOT NULL
----
16
97

query II rowsort
SELECT - col2 AS col2, - col2 AS col0 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0, col2
----
-45
-45
-71
-71
-8
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-5382
SELECT + - SUM( + col1 ) + 78 - + col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING col1 BETWEEN COUNT( * ) AND ( col2 )
----

skipif mysql # not compatible
query I rowsort label-5382
SELECT + - SUM ( + col1 ) + 78 - + col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING col1 BETWEEN COUNT ( * ) AND ( col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5383
SELECT - COUNT( * ) + - COUNT( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-2
-2
-2

skipif mysql # not compatible
query I rowsort label-5383
SELECT - COUNT ( * ) + - COUNT ( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-2
-2
-2

onlyif mysql # aggregate syntax: 
query I rowsort label-5384
SELECT + - col2 + + ( + COUNT( * ) ) AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1 HAVING NOT - col1 * - col1 BETWEEN NULL AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5384
SELECT + - col2 + + ( + COUNT ( * ) ) AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1 HAVING NOT - col1 * - col1 BETWEEN NULL AND ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5385
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + CAST( NULL AS SIGNED ) IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-5385
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + CAST ( NULL AS INTEGER ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT ( NOT ( 71 ) <> NULL )
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - - col2 IS NULL
----
45
71
8

query I rowsort
SELECT col0 + - - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
164
44
56

onlyif mysql # aggregate syntax: 
query I rowsort label-5389
SELECT DISTINCT - 14 + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IN ( - SUM( - - col1 ) )
----

skipif mysql # not compatible
query I rowsort label-5389
SELECT DISTINCT - 14 + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IN ( - SUM ( - - col1 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5390
SELECT + col1 + 19 / + - 86 * - 88 + col1 + col1 / col1 - + - COUNT( * ) / - col1 * col1 FROM tab2 GROUP BY col1, col1, col1 HAVING ( - COUNT( * ) ) > NULL
----

skipif mysql # not compatible
query I rowsort label-5390
SELECT + col1 + 19 / + - 86 * - 88 + col1 + col1 / col1 - + - COUNT ( * ) / - col1 * col1 FROM tab2 GROUP BY col1, col1, col1 HAVING ( - COUNT ( * ) ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( col2 ) col0 FROM tab1 GROUP BY col2
----
45
71
8

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5392
SELECT ALL + 29 col0, 33 * - MIN( CAST( + CASE col1 WHEN + 26 THEN + col1 END AS SIGNED ) ) - col2 * - NULLIF ( 6, col0 ) FROM tab2 GROUP BY col2, col0, col2
----
29
NULL
29
NULL
29
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5392
SELECT ALL + 29 col0, 33 * - MIN ( CAST ( + CASE col1 WHEN + 26 THEN + col1 END AS INTEGER ) ) - col2 * - NULLIF ( 6, col0 ) FROM tab2 GROUP BY col2, col0, col2
----
29
NULL
29
NULL
29
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5393
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING + - COUNT( DISTINCT 56 ) + - AVG ( ALL - + col2 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5393
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING + - COUNT ( DISTINCT 56 ) + - AVG ( ALL - + col2 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST( NULL AS SIGNED ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST ( NULL AS INTEGER ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5395
SELECT ALL + - COALESCE ( + col1, + - col0 DIV COUNT( * ) * - + col1 * 21 + MIN( + 23 ), - col0 * 53 + - ( col1 ) * - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

skipif mysql # not compatible
query I rowsort label-5395
SELECT ALL + - COALESCE ( + col1, + - col0 / COUNT ( * ) * - + col1 * 21 + MIN ( + 23 ), - col0 * 53 + - ( col1 ) * - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT col0 - + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
0

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5398
SELECT DISTINCT col0, - col0 FROM tab2 WHERE col0 + + + col0 * - - CAST( NULL AS SIGNED ) + - 21 = NULL GROUP BY col0 HAVING ( col0 ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-5398
SELECT DISTINCT col0, - col0 FROM tab2 WHERE col0 + + + col0 * - - CAST ( NULL AS INTEGER ) + - 21 = NULL GROUP BY col0 HAVING ( col0 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5399
SELECT DISTINCT MAX( ALL - NULLIF ( - 53, + col0 ) ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
53

skipif mysql # not compatible
query I rowsort label-5399
SELECT DISTINCT MAX ( ALL - NULLIF ( - 53, + col0 ) ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
53

query I rowsort
SELECT + + 12 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > 97 * col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5401
SELECT - ( COUNT( * ) ) + - - col1 + - 19 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
21
39
41

skipif mysql # not compatible
query I rowsort label-5401
SELECT - ( COUNT ( * ) ) + - - col1 + - 19 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
21
39
41

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-5402
SELECT DISTINCT + COUNT( * ) * - col0 AS col2, + 85 * - 44 * - 7 * + + col0 * - - 59 + 78 DIV + + 89 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( COUNT( * ) + - col0 * col0 ) IS NOT NULL
----
-15
23169300
-91
140560420
-92
142105040

skipif mysql # not compatible
query II rowsort label-5402
SELECT DISTINCT + COUNT ( * ) * - col0 AS col2, + 85 * - 44 * - 7 * + + col0 * - - 59 + 78 / + + 89 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( COUNT ( * ) + - col0 * col0 ) IS NOT NULL
----
-15
23169300
-91
140560420
-92
142105040

query I rowsort
SELECT DISTINCT + col0 + + col0 + + 61 + 12 FROM tab1 AS cor0 GROUP BY col0
----
117
129
237

onlyif mysql # aggregate syntax: 
query I rowsort label-5404
SELECT ALL + + MIN( + + 71 ) FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col2, col1 HAVING NOT - COUNT( * ) <= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5404
SELECT ALL + + MIN ( + + 71 ) FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col2, col1 HAVING NOT - COUNT ( * ) <= ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5405
SELECT + col0 - + CAST( col1 AS SIGNED ) - + - col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING ( CAST( NULL AS SIGNED ) >= NULL )
----

skipif mysql # not compatible
query I rowsort label-5405
SELECT + col0 - + CAST ( col1 AS INTEGER ) - + - col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING ( CAST ( NULL AS INTEGER ) >= NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 35 * + + ( - + col0 ) * + col0 col2 FROM tab2 GROUP BY col1, col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 62 AS col1 FROM tab1 GROUP BY col0, col2
----
-62
-62
-62

query I rowsort
SELECT + 89 AS col2 FROM tab0 GROUP BY col0
----
89
89
89

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5409
SELECT DISTINCT + CAST( NULL AS SIGNED ) * - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-5409
SELECT DISTINCT + CAST ( NULL AS INTEGER ) * - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5410
SELECT ALL + - 2 FROM tab1 WHERE NOT 59 IS NULL GROUP BY col0 HAVING NULL < COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5410
SELECT ALL + - 2 FROM tab1 WHERE NOT 59 IS NULL GROUP BY col0 HAVING NULL < COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5411
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <> - COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5411
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <> - COUNT ( * )
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 WHERE NULL IN ( COALESCE ( - 51, + col1 ), col1 ) GROUP BY col1
----

query I rowsort
SELECT + - 0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5414
SELECT - 63 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING ( CAST( + + 42 AS SIGNED ) * + ( + 9 ) ) IN ( + ( - - CAST( NULL AS SIGNED ) ) )
----

skipif mysql # not compatible
query I rowsort label-5414
SELECT - 63 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING ( CAST ( + + 42 AS INTEGER ) * + ( + 9 ) ) IN ( + ( - - CAST ( NULL AS INTEGER ) ) )
----

query II rowsort
SELECT ALL - - col0, 31 + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT ALL col0 AS col2, + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
22
28
28
82
82

query II rowsort
SELECT + col2 AS col0, + col2 * + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
576
38
1444
79
6241

onlyif mysql # DIV for integer division: 
query I rowsort label-5419
SELECT DISTINCT 14 DIV - 96 AS col0 FROM tab1 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-5419
SELECT DISTINCT 14 / - 96 AS col0 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT ALL 91 * - 8 AS col1 FROM tab2 WHERE NULL = ( + ( + - 11 ) ) GROUP BY col1, col2 HAVING NOT col1 >= - + col1 / + 34 + - + col1 * col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5421
SELECT ALL 29 DIV col0 * + - col0 col0 FROM tab1 GROUP BY col0
----
-22
-28
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5421
SELECT ALL 29 / col0 * + - col0 col0 FROM tab1 GROUP BY col0
----
-22
-28
0

onlyif mysql # aggregate syntax: 
query II rowsort label-5422
SELECT col0 * + col0 * + COUNT( * ), - col0 AS col0 FROM tab1 GROUP BY col0
----
484
-22
6724
-82
784
-28

skipif mysql # not compatible
query II rowsort label-5422
SELECT col0 * + col0 * + COUNT ( * ), - col0 AS col0 FROM tab1 GROUP BY col0
----
484
-22
6724
-82
784
-28

onlyif mysql # aggregate syntax: 
query I rowsort label-5423
SELECT DISTINCT + COUNT( * ) * + 26 FROM tab2 AS cor0 GROUP BY col1
----
26

skipif mysql # not compatible
query I rowsort label-5423
SELECT DISTINCT + COUNT ( * ) * + 26 FROM tab2 AS cor0 GROUP BY col1
----
26

query I rowsort
SELECT 12 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
12
12
12

query I rowsort
SELECT DISTINCT - AVG ( - 31 ) / col0 / + + col0 + + - col0 * + col0 + + + ( col0 ) FROM tab0 cor0 GROUP BY col0 HAVING + col0 > NULL
----

query I rowsort
SELECT col2 * + col2 * + col2 * 92 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1271808
45359588
5048224

query I rowsort
SELECT + ( col0 ) FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + 46 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = ( col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5429
SELECT DISTINCT - CAST( NULL AS SIGNED ) + - + 54 FROM tab1 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-5429
SELECT DISTINCT - CAST ( NULL AS INTEGER ) + - + 54 FROM tab1 AS cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT + col2 + + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL + ( + col0 ) + - col0 AS col2 FROM tab2 GROUP BY col0, col2
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5433
SELECT MIN( ALL - - col0 ) AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
22
28
82

skipif mysql # not compatible
query I rowsort label-5433
SELECT MIN ( ALL - - col0 ) AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-5435
SELECT ALL 90 DIV col1 * 41 AS col0 FROM tab1 GROUP BY col1, col2
----
41
615
82

skipif mysql # not compatible
query I rowsort label-5435
SELECT ALL 90 / col1 * 41 AS col0 FROM tab1 GROUP BY col1, col2
----
41
615
82

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) < 43
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING - + 87 IS NULL
----

query II rowsort
SELECT ALL - col0, - col0 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-26
-26
-43
-43
-83
-83

query II rowsort
SELECT + 75 AS col2, - 48 * - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
75
1968
75
2832
75
2928

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5440
SELECT DISTINCT - CAST( + CAST( + col0 AS SIGNED ) AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-5440
SELECT DISTINCT - CAST ( + CAST ( + col0 AS INTEGER ) AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5441
SELECT - - CAST( + ( - 61 ) AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col1
----
-61
-61
-61

skipif mysql # not compatible
query I rowsort label-5441
SELECT - - CAST ( + ( - 61 ) AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col1
----
-61
-61
-61

query I rowsort
SELECT 91 * + - 47 * - col1 FROM tab2 GROUP BY col1, col1
----
175357
252343
260897

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5443
SELECT + col2 * + 29 DIV + COUNT( DISTINCT col2 ) AS col0 FROM tab0 GROUP BY col2
----
1102
2291
696

skipif mysql # not compatible
query I rowsort label-5443
SELECT + col2 * + 29 / + COUNT ( DISTINCT col2 ) AS col0 FROM tab0 GROUP BY col2
----
1102
2291
696

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5444
SELECT - col2 * - CAST( NULL AS SIGNED ) + + col2 + - col2 + + 42 + - col2 + + col2 + col2 * + + col2 * + 38 * + - col2 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5444
SELECT - col2 * - CAST ( NULL AS INTEGER ) + + col2 + - col2 + + 42 + - col2 + + col2 + col2 * + + col2 * + 38 * + - col2 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col2 + + col2 AS col0 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT + col2 + - - col1 AS col0 FROM tab0 AS cor0 WHERE NOT NULL < + col2 GROUP BY col1, col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5447
SELECT DISTINCT + col0 + + CAST( + - COUNT( * ) AS SIGNED ) * + 94 * - + col0 FROM tab0 AS cor0 GROUP BY col0
----
2470
4085
7885

skipif mysql # not compatible
query I rowsort label-5447
SELECT DISTINCT + col0 + + CAST ( + - COUNT ( * ) AS INTEGER ) * + 94 * - + col0 FROM tab0 AS cor0 GROUP BY col0
----
2470
4085
7885

onlyif mysql # aggregate syntax: 
query I rowsort label-5448
SELECT COUNT( * ) FROM tab1 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5448
SELECT COUNT ( * ) FROM tab1 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5449
SELECT ALL - + COUNT( * ) * + + ( + + 2 ) - + col0 DIV + col0 + - 18 + + COUNT( * ) + - col0 * + 79 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-2074
-3417
-6577

skipif mysql # not compatible
query I rowsort label-5449
SELECT ALL - + COUNT ( * ) * + + ( + + 2 ) - + col0 / + col0 + - 18 + + COUNT ( * ) + - col0 * + 79 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-2074
-3417
-6577

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5450
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <> COUNT( * ) * + CAST( NULL AS SIGNED ) + + col1 + + + CAST( NULL AS SIGNED ) * - - ( col1 )
----

skipif mysql # not compatible
query I rowsort label-5450
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <> COUNT ( * ) * + CAST ( NULL AS INTEGER ) + + col1 + + + CAST ( NULL AS INTEGER ) * - - ( col1 )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5451
SELECT DISTINCT + 53 - + col0 + - col0 * - col0 AS col1 FROM tab0 AS cor0 WHERE NOT col1 BETWEEN - - col2 AND - 85 * - CAST( NULL AS DECIMAL ) + 43 + - col1 * + + col1 GROUP BY col0
----
6859
703

skipif mysql # not compatible
query I rowsort label-5451
SELECT DISTINCT + 53 - + col0 + - col0 * - col0 AS col1 FROM tab0 AS cor0 WHERE NOT col1 BETWEEN - - col2 AND - 85 * - CAST ( NULL AS REAL ) + 43 + - col1 * + + col1 GROUP BY col0
----
6859
703

query I rowsort
SELECT ALL - ( col1 ) * + ( + + col1 ) * + - col1 + + col1 FROM tab1 cor0 GROUP BY col1
----
185250
222
85228

onlyif mysql # aggregate syntax: 
query I rowsort label-5453
SELECT - COUNT( * ) FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5453
SELECT - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-5454
SELECT DISTINCT - COUNT( * ) FROM tab1 GROUP BY col2, col0
----
-1

skipif mysql # not compatible
query I rowsort label-5454
SELECT DISTINCT - COUNT ( * ) FROM tab1 GROUP BY col2, col0
----
-1

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT + - 76 IS NULL
----
58
79
87

query I rowsort
SELECT COALESCE ( + 97, + col1 ) * - - 67 * ( - col1 ) * + - 16 - + col1 * + 56 FROM tab0 GROUP BY col1
----
0
8418168

onlyif mysql # aggregate syntax: 
query I rowsort label-5457
SELECT + col0 * COUNT( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING col0 NOT BETWEEN - ( col0 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-5457
SELECT + col0 * COUNT ( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING col0 NOT BETWEEN - ( col0 ) AND NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - + col1 + + - col0 IS NOT NULL
----
-81
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5459
SELECT MIN( + col1 ) * - + ( + - col1 ) * - - CAST( 67 AS SIGNED ) + col2 FROM tab2 GROUP BY col0, col2, col1 HAVING ( + col0 ) * - - col1 / col2 >= - + COUNT( * )
----
112685
233306
249394

skipif mysql # not compatible
query I rowsort label-5459
SELECT MIN ( + col1 ) * - + ( + - col1 ) * - - CAST ( 67 AS INTEGER ) + col2 FROM tab2 GROUP BY col0, col2, col1 HAVING ( + col0 ) * - - col1 / col2 >= - + COUNT ( * )
----
112685
233306
249394

query I rowsort
SELECT + 78 FROM tab0 GROUP BY col0, col1, col0
----
78
78
78

onlyif mysql # aggregate syntax: 
query I rowsort label-5461
SELECT DISTINCT - MAX( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-5461
SELECT DISTINCT - MAX ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - 34 AS col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN NULL AND + 23
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5463
SELECT ALL + + COUNT( * ) * 8 FROM tab0 AS cor0 GROUP BY col1
----
16
8

skipif mysql # not compatible
query I rowsort label-5463
SELECT ALL + + COUNT ( * ) * 8 FROM tab0 AS cor0 GROUP BY col1
----
16
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ( - AVG ( ALL col2 ) ) + ( + col2 ) col0, + col2 * + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IN ( - col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5465
SELECT DISTINCT + COUNT( * ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT - - ( 69 ) < col2
----
1

skipif mysql # not compatible
query I rowsort label-5465
SELECT DISTINCT + COUNT ( * ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT - - ( 69 ) < col2
----
1

query II rowsort
SELECT - - ( + + 44 ), col2 FROM tab2 AS cor0 GROUP BY col2
----
44
58
44
79
44
87

onlyif mysql # aggregate syntax: 
query II rowsort label-5467
SELECT - COUNT( * ) + - 33 + + col0 + + 16 * + col0 * - col0, col0 FROM tab0 AS cor0 GROUP BY col0
----
-10824
26
-110175
83
-29575
43

skipif mysql # not compatible
query II rowsort label-5467
SELECT - COUNT ( * ) + - 33 + + col0 + + 16 * + col0 * - col0, col0 FROM tab0 AS cor0 GROUP BY col0
----
-10824
26
-110175
83
-29575
43

onlyif mysql # aggregate syntax: 
query I rowsort label-5468
SELECT DISTINCT - COUNT( * ) AS col0 FROM tab1 WHERE NOT - col1 IS NULL AND NOT + 82 > NULL GROUP BY col2 HAVING ( - COUNT( * ) * - 56 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5468
SELECT DISTINCT - COUNT ( * ) AS col0 FROM tab1 WHERE NOT - col1 IS NULL AND NOT + 82 > NULL GROUP BY col2 HAVING ( - COUNT ( * ) * - 56 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5469
SELECT col2 * col1 * - - 25 + + + COUNT( * ) FROM tab1 GROUP BY col1, col2
----
1201
64126
78101

skipif mysql # not compatible
query I rowsort label-5469
SELECT col2 * col1 * - - 25 + + + COUNT ( * ) FROM tab1 GROUP BY col1, col2
----
1201
64126
78101

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 GROUP BY col2, col0
----
26
43
83

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5471
SELECT ALL col0 DIV - - 65 FROM tab1 GROUP BY col0, col0 HAVING - + COUNT( * ) NOT IN ( - - COUNT( * ), col0 )
----
0
0
1

skipif mysql # not compatible
query I rowsort label-5471
SELECT ALL col0 / - - 65 FROM tab1 GROUP BY col0, col0 HAVING - + COUNT ( * ) NOT IN ( - - COUNT ( * ), col0 )
----
0
0
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5472
SELECT ALL + col0 / col0, col0 FROM tab1 GROUP BY col0, col0, col1 HAVING ( NOT col0 * - 19 + - col1 + col0 * + col0 / - col0 * CAST( NULL AS SIGNED ) * COUNT( * ) <> ( MIN( DISTINCT - col1 ) ) )
----

skipif mysql # not compatible
query II rowsort label-5472
SELECT ALL + col0 / col0, col0 FROM tab1 GROUP BY col0, col0, col1 HAVING ( NOT col0 * - 19 + - col1 + col0 * + col0 / - col0 * CAST ( NULL AS INTEGER ) * COUNT ( * ) <> ( MIN ( DISTINCT - col1 ) ) )
----

query I rowsort
SELECT col2 + 85 FROM tab2 cor0 GROUP BY col2 HAVING NULL IN ( - 41 )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-5474
SELECT col2 AS col2, + COUNT( * ) * + col2 DIV - - COUNT( ALL + 24 ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
58
79
79
87
87

skipif mysql # not compatible
query II rowsort label-5474
SELECT col2 AS col2, + COUNT ( * ) * + col2 / - - COUNT ( ALL + 24 ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL 49 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( col2 ) <> NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5476
SELECT - col0 AS col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT( * ) + - col0 IS NOT NULL
----
-15
15
-91
91
-92
92

skipif mysql # not compatible
query II rowsort label-5476
SELECT - col0 AS col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT ( * ) + - col0 IS NOT NULL
----
-15
15
-91
91
-92
92

onlyif mysql # aggregate syntax: 
query I rowsort label-5477
SELECT 70 + + COUNT( * ) col0 FROM tab0 cor0 WHERE NOT col1 IN ( + 87 ) GROUP BY col2
----
71
71
71

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5477
SELECT 70 + + COUNT ( * ) col0 FROM tab0 cor0 WHERE NOT col1 IN ( + 87 ) GROUP BY col2
----
71
71
71

onlyif mysql # aggregate syntax: 
query II rowsort label-5478
SELECT ALL + col0, - 72 + + - 1 * - COUNT( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
-71
28
-71
82
-71

skipif mysql # not compatible
query II rowsort label-5478
SELECT ALL + col0, - 72 + + - 1 * - COUNT ( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
-71
28
-71
82
-71

onlyif mysql # aggregate syntax: 
query I rowsort label-5479
SELECT COUNT( * ) + + + COUNT( * ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5479
SELECT COUNT ( * ) + + + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL 6 FROM tab1 GROUP BY col1
----
6
6
6

query I rowsort
SELECT + 63 * 88 FROM tab1 GROUP BY col1
----
5544
5544
5544

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5483
SELECT DISTINCT + CAST( NULL AS DECIMAL ) * - + 94 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-5483
SELECT DISTINCT + CAST ( NULL AS REAL ) * - + 94 FROM tab1 GROUP BY col1
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5484
SELECT DISTINCT - COUNT( * ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5484
SELECT DISTINCT - COUNT ( * ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 * + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5486
SELECT DISTINCT + col0 - - + AVG ( + CAST( NULL AS SIGNED ) ) FROM tab0 AS cor0 WHERE NOT col2 - - CAST( NULL AS SIGNED ) + - 21 + col2 + + ( 86 ) = + 50 GROUP BY col0 HAVING NOT NULL BETWEEN SUM( ALL + + col2 ) + 97 * 97 AND NULL
----

skipif mysql # not compatible
query I rowsort label-5486
SELECT DISTINCT + col0 - - + AVG ( + CAST ( NULL AS INTEGER ) ) FROM tab0 AS cor0 WHERE NOT col2 - - CAST ( NULL AS INTEGER ) + - 21 + col2 + + ( 86 ) = + 50 GROUP BY col0 HAVING NOT NULL BETWEEN SUM ( ALL + + col2 ) + 97 * 97 AND NULL
----

query I rowsort
SELECT + 35 + + - 65 + - + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL BETWEEN NULL AND - 48
----

query I rowsort
SELECT + 61 * - 97 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - + 67 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-67

onlyif mysql # aggregate syntax: 
query I rowsort label-5490
SELECT ALL - COUNT( * ) FROM tab0 cor0 WHERE NOT col2 * + + 56 IS NOT NULL GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-5490
SELECT ALL - COUNT ( * ) FROM tab0 cor0 WHERE NOT col2 * + + 56 IS NOT NULL GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5491
SELECT DISTINCT col1 DIV 64 FROM tab0 GROUP BY col1, col1
----
0
1

skipif mysql # not compatible
query I rowsort label-5491
SELECT DISTINCT col1 / 64 FROM tab0 GROUP BY col1, col1
----
0
1

onlyif mysql # aggregate syntax: 
query II rowsort label-5492
SELECT ALL col0, + 48 - + 3 * 99 AS col0 FROM tab0 WHERE NOT ( + + col2 * + + col1 + + col0 ) IS NULL GROUP BY col2, col0 HAVING NOT - col2 * + col0 * ( + col0 ) / - MIN( - + col2 ) < ( - col0 )
----

skipif mysql # not compatible
query II rowsort label-5492
SELECT ALL col0, + 48 - + 3 * 99 AS col0 FROM tab0 WHERE NOT ( + + col2 * + + col1 + + col0 ) IS NULL GROUP BY col2, col0 HAVING NOT - col2 * + col0 * ( + col0 ) / - MIN ( - + col2 ) < ( - col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5493
SELECT ALL - MIN( - col2 ) FROM tab2 GROUP BY col1, col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-5493
SELECT ALL - MIN ( - col2 ) FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT COALESCE ( + 71, - 72 ) * col1 * + 83 + ( col2 ) FROM tab0 GROUP BY col1, col2
----
38
477357
79

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5495
SELECT + 1 AS col2, - COUNT( * ) * 16 * - col0 * CAST( + - col0 AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
1
-107584
1
-12544
1
-7744

skipif mysql # not compatible
query II rowsort label-5495
SELECT + 1 AS col2, - COUNT ( * ) * 16 * - col0 * CAST ( + - col0 AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
1
-107584
1
-12544
1
-7744

onlyif mysql # aggregate syntax: 
query I rowsort label-5496
SELECT ALL col2 - + col2 * - + COUNT( * ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
158
48
76

skipif mysql # not compatible
query I rowsort label-5496
SELECT ALL col2 - + col2 * - + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
158
48
76

onlyif mysql # aggregate syntax: 
query I rowsort label-5497
SELECT DISTINCT col0 + MAX( DISTINCT - 38 ) * - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL = + col2
----

skipif mysql # not compatible
query I rowsort label-5497
SELECT DISTINCT col0 + MAX ( DISTINCT - 38 ) * - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL = + col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5498
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT - COUNT( * ) >= + - 54 * - MAX( ALL + col0 )
----
41
59
61

skipif mysql # not compatible
query I rowsort label-5498
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT - COUNT ( * ) >= + - 54 * - MAX ( ALL + col0 )
----
41
59
61

query I rowsort
SELECT 35 + - col0 FROM tab0 GROUP BY col0, col1
----
-48
-8
9

onlyif mysql # aggregate syntax: 
query I rowsort label-5500
SELECT - - COUNT( * ) AS col1 FROM tab2 WHERE NOT - col0 NOT BETWEEN ( NULL ) AND col1 * - col0 / + 0 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-5500
SELECT - - COUNT ( * ) AS col1 FROM tab2 WHERE NOT - col0 NOT BETWEEN ( NULL ) AND col1 * - col0 / + 0 GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5501
SELECT DISTINCT col1 + 23 - - 42 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( NOT ( - MAX( ( - col0 ) ) / + MIN( ALL - 30 ) IS NULL ) ) )
----
109
122
71

skipif mysql # not compatible
query I rowsort label-5501
SELECT DISTINCT col1 + 23 - - 42 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( NOT ( - MAX ( ( - col0 ) ) / + MIN ( ALL - 30 ) IS NULL ) ) )
----
109
122
71

query I rowsort
SELECT - 53 + + col0 + + col0 + col0 * - - col0 * - ( - - ( - 70 ) ) * 1 - + 83 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
33788
470708
54800

query II rowsort
SELECT ( - 78 ) AS col0, - ( col2 ) FROM tab2 AS cor0 GROUP BY col2
----
-78
-58
-78
-79
-78
-87

query I rowsort
SELECT ALL - - 97 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
97
97
97

query I rowsort
SELECT 76 FROM tab1 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5506
SELECT + col0 * col0 FROM tab1 WHERE NULL BETWEEN - 47 AND + CAST( + - ( + col0 ) AS SIGNED ) + - - ( - col0 ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-5506
SELECT + col0 * col0 FROM tab1 WHERE NULL BETWEEN - 47 AND + CAST ( + - ( + col0 ) AS INTEGER ) + - - ( - col0 ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5507
SELECT ALL - col0 / + - col0 * - CAST( NULL AS SIGNED ) + - 84 AS col2 FROM tab2 WHERE NULL BETWEEN - 62 AND CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-5507
SELECT ALL - col0 / + - col0 * - CAST ( NULL AS INTEGER ) + - 84 AS col2 FROM tab2 WHERE NULL BETWEEN - 62 AND CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5508
SELECT + 80 + 61 * COUNT( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING + ( 73 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5508
SELECT + 80 + 61 * COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING + ( 73 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 + col2 * col0 AS col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT - NULLIF ( + col0, - 63 + - col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL + - 54 FROM tab1 AS cor0 GROUP BY col0, col2
----
-54
-54
-54

onlyif mysql # aggregate syntax: 
query I rowsort label-5511
SELECT - col2 col1 FROM tab0 cor0 GROUP BY col2 HAVING COUNT( * ) - + ( AVG ( - - col1 ) ) + + col2 + - - COUNT( * ) IS NULL AND NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5511
SELECT - col2 col1 FROM tab0 cor0 GROUP BY col2 HAVING COUNT ( * ) - + ( AVG ( - - col1 ) ) + + col2 + - - COUNT ( * ) IS NULL AND NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5512
SELECT ALL - COUNT( * ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - - 5 <= NULL
----

skipif mysql # not compatible
query I rowsort label-5512
SELECT ALL - COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - - 5 <= NULL
----

query I rowsort
SELECT 15 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( + col0 ) IS NOT NULL
----
15
15
15

onlyif mysql # aggregate syntax: 
query I rowsort label-5514
SELECT DISTINCT COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-5514
SELECT DISTINCT COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1

query I rowsort
SELECT + 60 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
2460
3540
3660

query II rowsort
SELECT ALL col1, 96 AS col0 FROM tab0 GROUP BY col1
----
0
96
81
96

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5517
SELECT ALL + col1 + - + col1 + + - col1 + + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5517
SELECT ALL + col1 + - + col1 + + - col1 + + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT col0 + - ( col0 ) FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5519
SELECT DISTINCT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + - col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5519
SELECT DISTINCT + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + - col2 IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5520
SELECT - 99 + + - COUNT( * ) * - + col1 DIV + 40 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-98
-98
-99

skipif mysql # not compatible
query I rowsort label-5520
SELECT - 99 + + - COUNT ( * ) * - + col1 / + 40 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-98
-98
-99

onlyif mysql # aggregate syntax: 
query I rowsort label-5521
SELECT DISTINCT 61 + - + ( + COUNT( * ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
60

skipif mysql # not compatible
query I rowsort label-5521
SELECT DISTINCT 61 + - + ( + COUNT ( * ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
60

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5522
SELECT - 86 + 86 + + COUNT( * ) DIV - col2 AS col1 FROM tab1 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-5522
SELECT - 86 + 86 + + COUNT ( * ) / - col2 AS col1 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - - col1 * + col1 + - col1 - - 49 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
49
6529

onlyif mysql # aggregate syntax: 
query I rowsort label-5524
SELECT - COUNT( * ) * 30 col1 FROM tab0 AS cor0 GROUP BY col2
----
-30
-30
-30

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5524
SELECT - COUNT ( * ) * 30 col1 FROM tab0 AS cor0 GROUP BY col2
----
-30
-30
-30

onlyif mysql # aggregate syntax: 
query I rowsort label-5525
SELECT + col0 * + + COUNT( * ) AS col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

skipif mysql # not compatible
query I rowsort label-5525
SELECT + col0 * + + COUNT ( * ) AS col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + - 65 FROM tab2 AS cor0 WHERE col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT - col0 + + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING col1 IS NOT NULL
----
-44
-57
-6

onlyif mysql # aggregate syntax: 
query I rowsort label-5529
SELECT DISTINCT SUM( DISTINCT - 49 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-49

skipif mysql # not compatible
query I rowsort label-5529
SELECT DISTINCT SUM ( DISTINCT - 49 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-49

query I rowsort
SELECT DISTINCT col0 / ( - col0 ) * ( col2 ) + - col2 + col1 * col0 + + 11 AS col1 FROM tab1 GROUP BY col0, col2, col1 HAVING col0 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5531
SELECT ALL + ( + col2 ), + COUNT( * ) * col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
24
576
38
1444
79
6241

skipif mysql # not compatible
query II rowsort label-5531
SELECT ALL + ( + col2 ), + COUNT ( * ) * col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
24
576
38
1444
79
6241

query I rowsort
SELECT + 89 FROM tab2 AS cor0 GROUP BY col0 HAVING - 70 IS NOT NULL
----
89
89
89

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5533
SELECT DISTINCT ( - CAST( col2 AS SIGNED ) ) - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-142
-16
-90

skipif mysql # not compatible
query I rowsort label-5533
SELECT DISTINCT ( - CAST ( col2 AS INTEGER ) ) - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-142
-16
-90

onlyif mysql # aggregate syntax: 
query I rowsort label-5534
SELECT DISTINCT + + col2 + + COUNT( * ) col1 FROM tab1 AS cor0 GROUP BY col2
----
46
72
9

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5534
SELECT DISTINCT + + col2 + + COUNT ( * ) col1 FROM tab1 AS cor0 GROUP BY col2
----
46
72
9

onlyif mysql # DIV for integer division: 
query I rowsort label-5535
SELECT DISTINCT - col0 DIV + col0 FROM tab1 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-5535
SELECT DISTINCT - col0 / + col0 FROM tab1 GROUP BY col0
----
-1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5536
SELECT COUNT( + col1 ) * + CAST( 94 AS SIGNED ) + + + 51 FROM tab1 GROUP BY col1
----
145
145
145

skipif mysql # not compatible
query I rowsort label-5536
SELECT COUNT ( + col1 ) * + CAST ( 94 AS INTEGER ) + + + 51 FROM tab1 GROUP BY col1
----
145
145
145

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING ( + col0 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5538
SELECT ALL + + COUNT( * ) FROM tab2 WHERE + col1 NOT BETWEEN - - col2 AND NULL GROUP BY col2, col2 HAVING + 52 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5538
SELECT ALL + + COUNT ( * ) FROM tab2 WHERE + col1 NOT BETWEEN - - col2 AND NULL GROUP BY col2, col2 HAVING + 52 IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-5539
SELECT 6 - + ( + - col0 ) * 91 AS col1, + COUNT( ALL - + ( + col0 ) ) * + NULLIF ( col1, - col1 * - + 38 ) FROM tab1 GROUP BY col2, col0, col1 HAVING ( - col2 ) * + col0 - - - MIN( DISTINCT + col1 ) NOT BETWEEN CASE + AVG ( ( - col2 ) ) WHEN col2 * - COUNT( * ) THEN - + col2 WHEN MIN( ALL col1 ) / - - col2 THEN - ( - + 10 ) ELSE + - CAST( NULL AS SIGNED ) * - + col2 END AND + 1 * col2 + + + 20
----
2008
6
2554
57
7468
44

skipif mysql # not compatible
query II rowsort label-5539
SELECT 6 - + ( + - col0 ) * 91 AS col1, + COUNT ( ALL - + ( + col0 ) ) * + NULLIF ( col1, - col1 * - + 38 ) FROM tab1 GROUP BY col2, col0, col1 HAVING ( - col2 ) * + col0 - - - MIN ( DISTINCT + col1 ) NOT BETWEEN CASE + AVG ( ( - col2 ) ) WHEN col2 * - COUNT ( * ) THEN - + col2 WHEN MIN ( ALL col1 ) / - - col2 THEN - ( - + 10 ) ELSE + - CAST ( NULL AS INTEGER ) * - + col2 END AND + 1 * col2 + + + 20
----
2008
6
2554
57
7468
44

query I rowsort
SELECT + + col1 + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
118
122
82

query I rowsort
SELECT ALL col1 / + CASE + + col1 WHEN col1 / + + col1 THEN - ( + col2 ) * + col1 END + + col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL <= + - col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5542
SELECT ALL col2 * + col1 * col2 * - COUNT( * ) * - COUNT( * ) FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL = + - 63
----

skipif mysql # not compatible
query I rowsort label-5542
SELECT ALL col2 * + col1 * col2 * - COUNT ( * ) * - COUNT ( * ) FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL = + - 63
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5543
SELECT + col1 + + COUNT( * ) * + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 WHERE - col1 = - col2 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5543
SELECT + col1 + + COUNT ( * ) * + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 WHERE - col1 = - col2 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5544
SELECT DISTINCT + + CAST( + col2 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-5544
SELECT DISTINCT + + CAST ( + col2 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query II rowsort
SELECT DISTINCT - ( - - col0 ) * + col1, + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-132
8
-1596
45
-3608
71

query I rowsort
SELECT - 11 AS col1 FROM tab0 GROUP BY col0 HAVING NOT - + 10 IS NULL
----
-11
-11
-11

onlyif mysql # aggregate syntax: 
query I rowsort label-5547
SELECT + col2 * + COUNT( * ) FROM tab2 GROUP BY col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-5547
SELECT + col2 * + COUNT ( * ) FROM tab2 GROUP BY col2
----
58
79
87

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5548
SELECT DISTINCT col1 DIV - - COUNT( * ) FROM tab1 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-5548
SELECT DISTINCT col1 / - - COUNT ( * ) FROM tab1 GROUP BY col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query II rowsort label-5549
SELECT ALL - 66 * - 53, MAX( ALL - 99 ) AS col2 FROM tab0 GROUP BY col1
----
3498
-99
3498
-99

skipif mysql # not compatible
query II rowsort label-5549
SELECT ALL - 66 * - 53, MAX ( ALL - 99 ) AS col2 FROM tab0 GROUP BY col1
----
3498
-99
3498
-99

onlyif mysql # aggregate syntax: 
query I rowsort label-5550
SELECT ALL - COUNT( * ) FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5550
SELECT ALL - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5551
SELECT - CAST( - col1 AS SIGNED ) + + 58 FROM tab0 AS cor0 GROUP BY col0, col1
----
139
58
58

skipif mysql # not compatible
query I rowsort label-5551
SELECT - CAST ( - col1 AS INTEGER ) + + 58 FROM tab0 AS cor0 GROUP BY col0, col1
----
139
58
58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab0 cor0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 + col2 * - - col0 FROM tab2 AS cor0 WHERE col0 >= NULL GROUP BY col0, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5554
SELECT DISTINCT + + MIN( ALL + 20 ) + - col1 * - COUNT( * ) * col1 - 68 - COUNT( * ) * COUNT( * ) FROM tab1 AS cor0 GROUP BY col1
----
-13
1887
3200

skipif mysql # not compatible
query I rowsort label-5554
SELECT DISTINCT + + MIN ( ALL + 20 ) + - col1 * - COUNT ( * ) * col1 - 68 - COUNT ( * ) * COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1
----
-13
1887
3200

query I rowsort
SELECT DISTINCT 96 FROM tab0 GROUP BY col1, col1
----
96

query I rowsort
SELECT 71 FROM tab1 GROUP BY col0
----
71
71
71

onlyif mysql # aggregate syntax: 
query II rowsort label-5557
SELECT MIN( DISTINCT + 29 ) * + COUNT( * ) * - - 95 * - ( - col0 ) * + ( - 24 ), - COALESCE ( ( + + 58 ), + - col0 + col2 * + 40 + - 27, + 25 ) AS col1 FROM tab1 GROUP BY col0
----
-1454640
-58
-1851360
-58
-5421840
-58

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5557
SELECT MIN ( DISTINCT + 29 ) * + COUNT ( * ) * - - 95 * - ( - col0 ) * + ( - 24 ), - COALESCE ( ( + + 58 ), + - col0 + col2 * + 40 + - 27, + 25 ) AS col1 FROM tab1 GROUP BY col0
----
-1454640
-58
-1851360
-58
-5421840
-58

query I rowsort
SELECT DISTINCT ( ( + col2 ) ) FROM tab0 GROUP BY col2, col2
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-5559
SELECT DISTINCT + col0 + - + col0 * col0 * - + COUNT( * ) AS col2 FROM tab2 AS cor0 WHERE NOT ( ( col1 ) ) IS NULL GROUP BY col0
----
240
8372
8556

skipif mysql # not compatible
query I rowsort label-5559
SELECT DISTINCT + col0 + - + col0 * col0 * - + COUNT ( * ) AS col2 FROM tab2 AS cor0 WHERE NOT ( ( col1 ) ) IS NULL GROUP BY col0
----
240
8372
8556

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5560
SELECT + - ( + - 19 ) * + CAST( NULL AS DECIMAL ) FROM tab1 WHERE - + 23 * - + col1 BETWEEN col0 AND + CASE - + 83 WHEN - - col2 THEN + CAST( NULL AS SIGNED ) + + 37 END GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5560
SELECT + - ( + - 19 ) * + CAST ( NULL AS REAL ) FROM tab1 WHERE - + 23 * - + col1 BETWEEN col0 AND + CASE - + 83 WHEN - - col2 THEN + CAST ( NULL AS INTEGER ) + + 37 END GROUP BY col1
----

query I rowsort
SELECT - col0 + 18 FROM tab1 AS cor0 GROUP BY col0 HAVING col0 * - 46 IS NOT NULL
----
-10
-4
-64

query I rowsort
SELECT ALL - + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 14 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( + 18 ) IS NULL
----

query I rowsort
SELECT + ( + + col1 ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5567
SELECT DISTINCT + col0 * + - col0 + + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-5567
SELECT DISTINCT + col0 * + - col0 + + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5568
SELECT + COUNT( * ) * - 53 * + + ( + MIN( - + col1 ) ) * + 13 AS col2 FROM tab0 GROUP BY col1
----
0
55809

skipif mysql # not compatible
query I rowsort label-5568
SELECT + COUNT ( * ) * - 53 * + + ( + MIN ( - + col1 ) ) * + 13 AS col2 FROM tab0 GROUP BY col1
----
0
55809

onlyif mysql # aggregate syntax: 
query I rowsort label-5569
SELECT ( + ( + - COUNT( * ) ) ) FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5569
SELECT ( + ( + - COUNT ( * ) ) ) FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ( col2 ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT + col2 + col2 FROM tab2 cor0 WHERE NOT col1 * + 26 * - col2 IS NOT NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5572
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - 59 / SUM( - col0 ) IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-5572
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - 59 / SUM ( - col0 ) IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - 34 * + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-2788
-748
-952

query I rowsort
SELECT + col2 * + col2 + - - col2 FROM tab0 GROUP BY col1, col2
----
1482
600
6320

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL + - col1 FROM tab2 WHERE + + 40 <> NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5578
SELECT 20 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT col0 NOT BETWEEN + col0 + + 84 + COUNT( * ) AND - 2
----

skipif mysql # not compatible
query I rowsort label-5578
SELECT 20 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT col0 NOT BETWEEN + col0 + + 84 + COUNT ( * ) AND - 2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5579
SELECT 55 * col1 + - CASE WHEN NOT - CAST( NULL AS SIGNED ) NOT IN ( - CAST( NULL AS SIGNED ) ) THEN + col1 END FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5579
SELECT 55 * col1 + - CASE WHEN NOT - CAST ( NULL AS INTEGER ) NOT IN ( - CAST ( NULL AS INTEGER ) ) THEN + col1 END FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + + 24 FROM tab1 AS cor0 GROUP BY col0, col0
----
24
24
24

onlyif mysql # aggregate syntax: 
query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN( DISTINCT 49 ), + - COUNT( * ), + COUNT( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN ( DISTINCT 49 ), + - COUNT ( * ), + COUNT ( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5582
SELECT - SUM( + col2 ) * COUNT( * ) - + - 56 + - col2 FROM tab0 WHERE NOT + col2 <> ( - col2 ) GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-5582
SELECT - SUM ( + col2 ) * COUNT ( * ) - + - 56 + - col2 FROM tab0 WHERE NOT + col2 <> ( - col2 ) GROUP BY col2, col0
----

query I rowsort
SELECT ( - - 64 ) AS col1 FROM tab1 GROUP BY col2 HAVING NULL > NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5584
SELECT DISTINCT + COUNT( * ) + + + col1 AS col2, col1 FROM tab0 GROUP BY col1
----
2
0
82
81

skipif mysql # not compatible
query II rowsort label-5584
SELECT DISTINCT + COUNT ( * ) + + + col1 AS col2, col1 FROM tab0 GROUP BY col1
----
2
0
82
81

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5585
SELECT + CAST( NULL AS SIGNED ) + CAST( + COUNT( * ) AS SIGNED ) col1 FROM tab2 GROUP BY col0 HAVING NOT + + 71 + - 55 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5585
SELECT + CAST ( NULL AS INTEGER ) + CAST ( + COUNT ( * ) AS INTEGER ) col1 FROM tab2 GROUP BY col0 HAVING NOT + + 71 + - 55 IS NULL
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5586
SELECT DISTINCT + 84 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) - + 79 + 42 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5586
SELECT DISTINCT + 84 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) - + 79 + 42 IS NULL
----

query I rowsort
SELECT - + col1 * col1 FROM tab0 cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 45 + col0 - + col0 + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
136
137
60

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING - - 60 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 19 + + - col2 * - col2 col2 FROM tab2 GROUP BY col2
----
3345
6222
7550

query I rowsort
SELECT col0 * 18 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5594
SELECT ALL COUNT( * ) FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5594
SELECT ALL COUNT ( * ) FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-5595
SELECT DISTINCT 72 DIV - col2 FROM tab2 GROUP BY col2
----
-1
0

skipif mysql # not compatible
query I rowsort label-5595
SELECT DISTINCT 72 / - col2 FROM tab2 GROUP BY col2
----
-1
0

query I rowsort
SELECT 21 * + col2 - + col2 AS col1 FROM tab1 WHERE NULL IS NULL GROUP BY col2 HAVING ( NULL ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT 44 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
44
44
44

onlyif mysql # aggregate syntax: 
query I rowsort label-5598
SELECT + MAX( DISTINCT 23 ) * ( + COUNT( * ) ) AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
23
46

skipif mysql # not compatible
query I rowsort label-5598
SELECT + MAX ( DISTINCT 23 ) * ( + COUNT ( * ) ) AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
23
46

onlyif mysql # aggregate syntax: 
query I rowsort label-5599
SELECT col0 * col0 FROM tab1 GROUP BY col0 HAVING NULL BETWEEN + COUNT( * ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-5599
SELECT col0 * col0 FROM tab1 GROUP BY col0 HAVING NULL BETWEEN + COUNT ( * ) AND NULL
----

query I rowsort
SELECT ALL - col2 * + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-2025
-5041
-64

query I rowsort
SELECT - 89 + - col0 * col0 AS col0 FROM tab2 WHERE - col2 = + 51 GROUP BY col1, col0, col0
----

query I rowsort
SELECT ALL 29 + - 85 FROM tab1 GROUP BY col2
----
-56
-56
-56

query I rowsort
SELECT col1 FROM tab0 WHERE NOT ( NULL ) IN ( + col1 ) GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 24 - col1 col1 FROM tab1 WHERE NOT col1 * - ( col0 ) = 62 + + 64 GROUP BY col1, col1 HAVING ( + col1 ) BETWEEN NULL AND - col1 * 18
----

query I rowsort
SELECT ALL ( col0 ) * 50 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
1300
2150
4150

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NOT 22 IS NULL
----
24
38
79

query I rowsort
SELECT 97 + 92 FROM tab0 GROUP BY col1, col1 HAVING NOT ( - 16 ) NOT IN ( 18 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5608
SELECT + COUNT( * ) + + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-5608
SELECT + COUNT ( * ) + + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
45
58
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 92 * col1 col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
4048
5244
552

onlyif mysql # aggregate syntax: 
query I rowsort label-5610
SELECT DISTINCT - COUNT( * ) AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5610
SELECT DISTINCT - COUNT ( * ) AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5611
SELECT ( - COUNT( * ) ) * COUNT( * ) + - col2 * + col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) NOT IN ( + 97 * + 23 )
----

skipif mysql # not compatible
query I rowsort label-5611
SELECT ( - COUNT ( * ) ) * COUNT ( * ) + - col2 * + col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) NOT IN ( + 97 * + 23 )
----

query I rowsort
SELECT 83 FROM tab0 AS cor0 GROUP BY col2
----
83
83
83

query I rowsort
SELECT + 32 + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
111
56
70

query I rowsort
SELECT + 42 FROM tab1 AS cor0 GROUP BY col2, col1
----
42
42
42

query I rowsort
SELECT ALL - 44 + - col0 FROM tab2 GROUP BY col0
----
-135
-136
-59

query I rowsort
SELECT DISTINCT + col2 + col2 * col2 AS col1 FROM tab1 WHERE NOT ( NULL ) <= - col0 GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5617
SELECT + COUNT( * ) * + - col0 FROM tab2 GROUP BY col0, col0, col1
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-5617
SELECT + COUNT ( * ) * + - col0 FROM tab2 GROUP BY col0, col0, col1
----
-15
-91
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-5618
SELECT DISTINCT col0 * 5 / 90 + + 73 FROM tab0 GROUP BY col0, col2 HAVING col0 * - 92 NOT BETWEEN NULL AND - MAX( + col0 )
----

skipif mysql # not compatible
query I rowsort label-5618
SELECT DISTINCT col0 * 5 / 90 + + 73 FROM tab0 GROUP BY col0, col2 HAVING col0 * - 92 NOT BETWEEN NULL AND - MAX ( + col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5619
SELECT 21 + + CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col1, col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5619
SELECT 21 + + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col1, col2, col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5620
SELECT col1 - - + NULLIF ( COUNT( * ), + col2 ) FROM tab2 GROUP BY col1, col2
----
42
60
62

skipif mysql # not compatible
query I rowsort label-5620
SELECT col1 - - + NULLIF ( COUNT ( * ), + col2 ) FROM tab2 GROUP BY col1, col2
----
42
60
62

query I rowsort
SELECT ALL + col2 / col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) <= + ( col0 ) GROUP BY col2
----

query I rowsort
SELECT - NULLIF ( 11, 73 ) FROM tab1 AS cor0 GROUP BY col2
----
-11
-11
-11

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 cor0 WHERE NULL NOT BETWEEN col1 AND col1 - + col0 GROUP BY col1, col1, col0
----

query I rowsort
SELECT DISTINCT - 94 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IN ( 10 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5625
SELECT + ( + COUNT( * ) ) + + col0 + - 18 FROM tab0 GROUP BY col0, col1
----
26
66
9

skipif mysql # not compatible
query I rowsort label-5625
SELECT + ( + COUNT ( * ) ) + + col0 + - 18 FROM tab0 GROUP BY col0, col1
----
26
66
9

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5626
SELECT ALL + ( + col0 ) DIV + CASE col0 WHEN col0 - ( + 5 ) THEN NULL ELSE - 20 END DIV + COUNT( * ) + - 43 FROM tab2 GROUP BY col0 HAVING ( + col0 ) IS NOT NULL
----
-43
-47
-47

skipif mysql # not compatible
query I rowsort label-5626
SELECT ALL + ( + col0 ) / + CASE col0 WHEN col0 - ( + 5 ) THEN NULL ELSE - 20 END / + COUNT ( * ) + - 43 FROM tab2 GROUP BY col0 HAVING ( + col0 ) IS NOT NULL
----
-43
-47
-47

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + 9 col2 FROM tab1 AS cor0 GROUP BY col0
----
198
252
738

onlyif mysql # DIV for integer division: 
query I rowsort label-5628
SELECT DISTINCT + - col1 * + + col1 + - + col1 DIV 3 FROM tab0 AS cor0 GROUP BY col1
----
-6588
0

skipif mysql # not compatible
query I rowsort label-5628
SELECT DISTINCT + - col1 * + + col1 + - + col1 / 3 FROM tab0 AS cor0 GROUP BY col1
----
-6588
0

query I rowsort
SELECT ALL + ( - col2 ) * 1 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5630
SELECT - MIN( ALL - + 74 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5630
SELECT - MIN ( ALL - + 74 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5631
SELECT ALL col2 - - MAX( DISTINCT + + 63 ) FROM tab1 GROUP BY col2
----
108
134
71

skipif mysql # not compatible
query I rowsort label-5631
SELECT ALL col2 - - MAX ( DISTINCT + + 63 ) FROM tab1 GROUP BY col2
----
108
134
71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5632
SELECT ALL + col0 FROM tab1 WHERE + - NULLIF ( + col0, ( + 75 ) + col0 ) * - col2 - CAST( col2 + + col0 AS SIGNED ) / col2 < NULL GROUP BY col0, col0
----

skipif mysql # not compatible
query I rowsort label-5632
SELECT ALL + col0 FROM tab1 WHERE + - NULLIF ( + col0, ( + 75 ) + col0 ) * - col2 - CAST ( col2 + + col0 AS INTEGER ) / col2 < NULL GROUP BY col0, col0
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5634
SELECT DISTINCT - 90 col2 FROM tab2 WHERE + 90 IN ( CAST( col1 AS SIGNED ) / 4 - col1 ) GROUP BY col2 HAVING NOT - 22 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5634
SELECT DISTINCT - 90 col2 FROM tab2 WHERE + 90 IN ( CAST ( col1 AS INTEGER ) / 4 - col1 ) GROUP BY col2 HAVING NOT - 22 IS NULL
----

query I rowsort
SELECT - col2 - - + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5637
SELECT + col0 / col2 FROM tab1 AS cor0 WHERE - CAST( - - 99 AS SIGNED ) IS NULL GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-5637
SELECT + col0 / col2 FROM tab1 AS cor0 WHERE - CAST ( - - 99 AS INTEGER ) IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT + 29 * - 71 + + - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT ( 99 / - 86 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5639
SELECT DISTINCT - MAX( - 22 ) FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
22

skipif mysql # not compatible
query I rowsort label-5639
SELECT DISTINCT - MAX ( - 22 ) FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
22

query I rowsort
SELECT + 85 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
85
85
85

query II rowsort
SELECT col2, - col2 + CASE - 56 WHEN + 82 THEN NULL ELSE - col2 END AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 + - 45 AS col2 FROM tab0 GROUP BY col2 HAVING + col2 < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5643
SELECT 1 - - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT COUNT( * ) + - ( COUNT( 87 ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5643
SELECT 1 - - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT COUNT ( * ) + - ( COUNT ( 87 ) ) IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0 HAVING NOT NULL NOT IN ( - + col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab2 WHERE NOT - col0 NOT BETWEEN ( 71 ) AND ( col0 ) GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL col0 + - ( col0 ) * - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
506
6806
812

onlyif mysql # aggregate syntax: 
query I rowsort label-5647
SELECT 83 * COUNT( * ) FROM tab2 WHERE 93 NOT BETWEEN ( 85 * col2 ) AND col2 GROUP BY col0, col1 HAVING ( - col0 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5647
SELECT 83 * COUNT ( * ) FROM tab2 WHERE 93 NOT BETWEEN ( 85 * col2 ) AND col2 GROUP BY col0, col1 HAVING ( - col0 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5648
SELECT ALL + 80 AS col1 FROM tab2 AS cor0 WHERE + 94 IS NOT NULL GROUP BY col1, col0 HAVING NOT - + 0 NOT IN ( + 92 * + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-5648
SELECT ALL + 80 AS col1 FROM tab2 AS cor0 WHERE + 94 IS NOT NULL GROUP BY col1, col0 HAVING NOT - + 0 NOT IN ( + 92 * + COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5649
SELECT ALL - COUNT( * ) AS col1 FROM tab2 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5649
SELECT ALL - COUNT ( * ) AS col1 FROM tab2 GROUP BY col0
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query II rowsort label-5650
SELECT SUM( DISTINCT - col0 ), + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
26
-43
43
-83
83

skipif mysql # not compatible
query II rowsort label-5650
SELECT SUM ( DISTINCT - col0 ), + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
26
-43
43
-83
83

onlyif mysql # aggregate syntax: 
query II rowsort label-5651
SELECT ALL COUNT( * ) * + + 91 / + col1, MAX( ALL 34 ) * - COUNT( * ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 <> 82
----

skipif mysql # not compatible
query II rowsort label-5651
SELECT ALL COUNT ( * ) * + + 91 / + col1, MAX ( ALL 34 ) * - COUNT ( * ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 <> 82
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5652
SELECT ALL SUM( DISTINCT - - col1 ) FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-5652
SELECT ALL SUM ( DISTINCT - - col1 ) FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT 72 FROM tab1 cor0 GROUP BY col2 HAVING NOT + 47 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5654
SELECT DISTINCT 90 / + - col2 AS col1, - 93 + - col2 * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 22 NOT IN ( - ( - COUNT( * ) ) )
----

skipif mysql # not compatible
query II rowsort label-5654
SELECT DISTINCT 90 / + - col2 AS col1, - 93 + - col2 * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 22 NOT IN ( - ( - COUNT ( * ) ) )
----

query I rowsort
SELECT + col2 * + col2 * + - col2 + - - col2 AS col1 FROM tab1 GROUP BY col2
----
-357840
-504
-91080

query I rowsort
SELECT ALL 89 FROM tab1 GROUP BY col1, col0
----
89
89
89

query I rowsort
SELECT - col1 AS col0 FROM tab2 WHERE NOT ( NULL ) <= NULL GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5658
SELECT DISTINCT - 23 col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT( * ) * + COUNT( * ) ) IS NULL
----
-23

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5658
SELECT DISTINCT - 23 col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT ( * ) * + COUNT ( * ) ) IS NULL
----
-23

query II rowsort
SELECT - col1, col1 FROM tab0 GROUP BY col1
----
-81
81
0
0

onlyif mysql # aggregate syntax: 
query II rowsort label-5660
SELECT ALL - col1 + SUM( DISTINCT - col1 ), - col1 * - 51 + + + col1 col1 FROM tab2 GROUP BY col1, col1
----
-118
3068
-122
3172
-82
2132

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5660
SELECT ALL - col1 + SUM ( DISTINCT - col1 ), - col1 * - 51 + + + col1 col1 FROM tab2 GROUP BY col1, col1
----
-118
3068
-122
3172
-82
2132

query I rowsort
SELECT + col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 * + 16 FROM tab2 cor0 GROUP BY col0
----
1456
1472
240

query I rowsort
SELECT + - col2 AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5664
SELECT col1 col2 FROM tab1 GROUP BY col1 HAVING CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5664
SELECT col1 col2 FROM tab1 GROUP BY col1 HAVING CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT 25 AS col0 FROM tab0 GROUP BY col2, col0
----
25

onlyif mysql # aggregate syntax: 
query I rowsort label-5666
SELECT ALL + MAX( - ( col0 ) ) col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5666
SELECT ALL + MAX ( - ( col0 ) ) col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-5667
SELECT ALL - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT - col0 IS NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5667
SELECT ALL - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT - col0 IS NULL
----
-1
-1
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5668
SELECT DISTINCT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-5668
SELECT DISTINCT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

query I rowsort
SELECT ALL 85 FROM tab1 GROUP BY col1, col2
----
85
85
85

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5670
SELECT ALL - COUNT( * ) * + 75 * 48 * + - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5670
SELECT ALL - COUNT ( * ) * + 75 * 48 * + - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5671
SELECT DISTINCT col2 * col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col2 HAVING NOT ( + CAST( NULL AS DECIMAL ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-5671
SELECT DISTINCT col2 * col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col2 HAVING NOT ( + CAST ( NULL AS REAL ) IS NULL )
----

query I rowsort
SELECT DISTINCT + - ( col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT col1 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 3 * col0 - col0 AS col0, - 96 col0 FROM tab2 cor0 GROUP BY col0
----
-364
-96
-368
-96
-60
-96

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5674
SELECT - 57 - + + 31 + CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5674
SELECT - 57 - + + 31 + CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query III rowsort label-5675
SELECT ALL - 72 AS col0, + MIN( ALL + col1 ) / + 51 - - - col1 * + 9 + + 30 * col1 + - + col1, + col1 + - 6 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN ( 45 ) AND ( - col1 * 57 )
----

skipif mysql # not compatible
query III rowsort label-5675
SELECT ALL - 72 AS col0, + MIN ( ALL + col1 ) / + 51 - - - col1 * + 9 + + 30 * col1 + - + col1, + col1 + - 6 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN ( 45 ) AND ( - col1 * 57 )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-5676
SELECT ALL - col2, col2 + - col2 DIV + col2 + - - COUNT( * ) * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
47
-38
75
-79
157

skipif mysql # not compatible
query II rowsort label-5676
SELECT ALL - col2, col2 + - col2 / + col2 + - - COUNT ( * ) * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
47
-38
75
-79
157

onlyif mysql # aggregate syntax: 
query III rowsort label-5677
SELECT 65 - 20 * + MAX( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT( col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-5677
SELECT 65 - 20 * + MAX ( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT ( col0 )
----

query I rowsort
SELECT DISTINCT - + col2 + - 48 FROM tab2 AS cor0 GROUP BY col2
----
-106
-127
-135

onlyif mysql # aggregate syntax: 
query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT ( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, col2 + + col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
48
-38
76
-79
158

onlyif mysql # aggregate syntax: 
query I rowsort label-5681
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + MAX( - col2 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5681
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + MAX ( - col2 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5682
SELECT DISTINCT 61 * 81 * - col0 + + ( + col0 ) FROM tab1 GROUP BY col0 HAVING NOT - COUNT( * ) / - 47 * MIN( DISTINCT col0 ) * + 40 IS NULL
----
-108680
-138320
-405080

skipif mysql # not compatible
query I rowsort label-5682
SELECT DISTINCT 61 * 81 * - col0 + + ( + col0 ) FROM tab1 GROUP BY col0 HAVING NOT - COUNT ( * ) / - 47 * MIN ( DISTINCT col0 ) * + 40 IS NULL
----
-108680
-138320
-405080

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5683
SELECT ALL COUNT( * ) + NULLIF ( + CAST( - COALESCE ( 99, + CASE - COUNT( * ) WHEN - col1 THEN NULL ELSE + ( - + COUNT( * ) ) END ) AS DECIMAL ), - COUNT( * ) + - + col2 ) * + CAST( NULL AS SIGNED ) + col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT COUNT( ALL - 67 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5683
SELECT ALL COUNT ( * ) + NULLIF ( + CAST ( - COALESCE ( 99, + CASE - COUNT ( * ) WHEN - col1 THEN NULL ELSE + ( - + COUNT ( * ) ) END ) AS REAL ), - COUNT ( * ) + - + col2 ) * + CAST ( NULL AS INTEGER ) + col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT COUNT ( ALL - 67 ) IS NOT NULL
----

query I rowsort
SELECT col0 * 66 FROM tab2 GROUP BY col0, col2
----
6006
6072
990

query I rowsort
SELECT ALL - + col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query II rowsort
SELECT col2, col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - col2 * - col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT + - col1 - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-114
-12
-88

onlyif mysql # aggregate syntax: 
query I rowsort label-5688
SELECT - COUNT( DISTINCT + + ( + + col0 ) ) - + 62 FROM tab0 GROUP BY col0, col2, col0 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5688
SELECT - COUNT ( DISTINCT + + ( + + col0 ) ) - + 62 FROM tab0 GROUP BY col0, col2, col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5689
SELECT COUNT( * ) AS col0, - SUM( DISTINCT + + 30 ) * + COUNT( ALL - - col1 ) col0 FROM tab2 AS cor0 GROUP BY col1
----
1
-30
1
-30
1
-30

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5689
SELECT COUNT ( * ) AS col0, - SUM ( DISTINCT + + 30 ) * + COUNT ( ALL - - col1 ) col0 FROM tab2 AS cor0 GROUP BY col1
----
1
-30
1
-30
1
-30

onlyif mysql # aggregate syntax: 
query II rowsort label-5690
SELECT DISTINCT MAX( + 91 ), col0 / - SUM( ALL 56 ) FROM tab0 AS cor0 WHERE NOT ( - col2 + + 18 ) < 7 * + + ( - - 72 ) GROUP BY col0
----

skipif mysql # not compatible
query II rowsort label-5690
SELECT DISTINCT MAX ( + 91 ), col0 / - SUM ( ALL 56 ) FROM tab0 AS cor0 WHERE NOT ( - col2 + + 18 ) < 7 * + + ( - - 72 ) GROUP BY col0
----

query I rowsort
SELECT - 78 FROM tab0 AS cor0 GROUP BY col2
----
-78
-78
-78

query I rowsort
SELECT ALL - - 35 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
35
35
35

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2 HAVING NULL <> NULL
----

query II rowsort
SELECT + 50, col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
50
26
50
43
50
83

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 + col0 + - col0 * col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-1763
-624
-6723

query I rowsort
SELECT col0 + col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col1
----
166
52
86

onlyif mysql # aggregate syntax: 
query I rowsort label-5698
SELECT + COUNT( - 36 ) + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
16
92
93

skipif mysql # not compatible
query I rowsort label-5698
SELECT + COUNT ( - 36 ) + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
16
92
93

query I rowsort
SELECT DISTINCT + + col2 / col0 * + col0 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING NOT - + col0 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5700
SELECT ALL SUM( DISTINCT - - col0 ) col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5700
SELECT ALL SUM ( DISTINCT - - col0 ) col2 FROM tab0 GROUP BY col0
----
26
43
83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5701
SELECT - col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IN ( ( - 45 ), - COUNT( * ) * + + col1, + - col1 * - CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5701
SELECT - col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IN ( ( - 45 ), - COUNT ( * ) * + + col1, + - col1 * - CAST ( NULL AS INTEGER ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5702
SELECT + COUNT( * ) - + ( - ( + col2 ) ) FROM tab1 GROUP BY col2
----
46
72
9

skipif mysql # not compatible
query I rowsort label-5702
SELECT + COUNT ( * ) - + ( - ( + col2 ) ) FROM tab1 GROUP BY col2
----
46
72
9

query I rowsort
SELECT DISTINCT 56 AS col2 FROM tab0 GROUP BY col1
----
56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5704
SELECT DISTINCT + CAST( NULL AS SIGNED ) FROM tab2 WHERE NOT NULL BETWEEN + col2 AND - 74 * - col0 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5704
SELECT DISTINCT + CAST ( NULL AS INTEGER ) FROM tab2 WHERE NOT NULL BETWEEN + col2 AND - 74 * - col0 GROUP BY col1
----

query I rowsort
SELECT ALL - 80 - - ( - col2 ) - - 47 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-112
-57
-71

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5706
SELECT ALL col2 AS col2, CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
58
NULL
79
NULL
87
NULL

skipif mysql # not compatible
query II rowsort label-5706
SELECT ALL col2 AS col2, CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
58
NULL
79
NULL
87
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( col0 ) col0 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5708
SELECT + col2 + 3 DIV - - col2 FROM tab0 GROUP BY col2 HAVING COUNT( * ) IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-5708
SELECT + col2 + 3 / - - col2 FROM tab0 GROUP BY col2 HAVING COUNT ( * ) IS NOT NULL
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5709
SELECT - col0 / - CAST( NULL AS SIGNED ) + col0 - + 52 AS col0, 69 FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
69
NULL
69
NULL
69

skipif mysql # not compatible
query II rowsort label-5709
SELECT - col0 / - CAST ( NULL AS INTEGER ) + col0 - + 52 AS col0, 69 FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
69
NULL
69
NULL
69

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5710
SELECT - + col0 AS col0 FROM tab0 AS cor0 WHERE NOT col1 < - - ( 90 ) + + + CAST( NULL AS SIGNED ) GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-5710
SELECT - + col0 AS col0 FROM tab0 AS cor0 WHERE NOT col1 < - - ( 90 ) + + + CAST ( NULL AS INTEGER ) GROUP BY col0, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5711
SELECT - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING 60 BETWEEN - CAST( - 71 AS SIGNED ) AND - - ( + 36 )
----

skipif mysql # not compatible
query I rowsort label-5711
SELECT - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING 60 BETWEEN - CAST ( - 71 AS INTEGER ) AND - - ( + 36 )
----

query I rowsort
SELECT ALL - - col2 + - + col2 AS col1 FROM tab0 WHERE NOT - col1 IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 7 col1 FROM tab2 GROUP BY col1, col2
----
7
7
7

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5714
SELECT ALL col0 + - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1, col0 HAVING - col1 = NULLIF ( + - col1, + - col0 )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5714
SELECT ALL col0 + - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1, col0 HAVING - col1 = NULLIF ( + - col1, + - col0 )
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5715
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING 90 BETWEEN - 9 AND MIN( - - 42 )
----

skipif mysql # not compatible
query I rowsort label-5715
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING 90 BETWEEN - 9 AND MIN ( - - 42 )
----

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING ( 6 ) IS NULL
----

query I rowsort
SELECT ALL - col0 * + 0 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NOT - 40 IS NOT NULL
----

query I rowsort
SELECT + col2 + - 85 FROM tab2 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 79 * + col2 - + col0 col2 FROM tab0 WHERE NOT + col0 IS NULL GROUP BY col0, col2
----
1853
2919
6215

onlyif mysql # aggregate syntax: 
query II rowsort label-5720
SELECT - 65 col2, COUNT( * ) * - ( + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NOT ( MIN( - + col2 ) IS NOT NULL ) )
----
-65
-15
-65
-91
-65
-92

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5720
SELECT - 65 col2, COUNT ( * ) * - ( + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NOT ( MIN ( - + col2 ) IS NOT NULL ) )
----
-65
-15
-65
-91
-65
-92

query I rowsort
SELECT ALL col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 * - 72 - + + 70 < NULL
----

query I rowsort
SELECT + col0 - + - col0 + + 63 * - col0 FROM tab0 AS cor0 WHERE - col2 <> + + col0 + col2 * + + 92 GROUP BY col0
----
-1586
-2623
-5063

onlyif mysql # aggregate syntax: 
query I rowsort label-5723
SELECT + col0 + - - col0 + MIN( + col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-5723
SELECT + col0 + - - col0 + MIN ( + col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5724
SELECT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( COUNT( * ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5724
SELECT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( COUNT ( * ) ) IS NOT NULL
----

query II rowsort
SELECT ALL + 57 * + + col2 + 77 AS col0, 36 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
1445
36
2243
36
4580
36

query I rowsort
SELECT - 12 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
-12
-12
-12

onlyif mysql # aggregate syntax: 
query II rowsort label-5727
SELECT - col0, + 15 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING + SUM( + + 27 ) IS NOT NULL
----
-22
15
-28
15
-82
15

skipif mysql # not compatible
query II rowsort label-5727
SELECT - col0, + 15 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING + SUM ( + + 27 ) IS NOT NULL
----
-22
15
-28
15
-82
15

onlyif mysql # aggregate syntax: 
query I rowsort label-5728
SELECT ALL col0 AS col2 FROM tab0 WHERE NOT ( + col0 ) IS NOT NULL GROUP BY col0, col2 HAVING NOT COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5728
SELECT ALL col0 AS col2 FROM tab0 WHERE NOT ( + col0 ) IS NOT NULL GROUP BY col0, col2 HAVING NOT COUNT ( * ) IS NULL
----

query I rowsort
SELECT DISTINCT + ( + 44 ) FROM tab0 WHERE NOT - - col1 * - col0 * 75 <= - + col1 GROUP BY col0 HAVING + + col0 <= NULL
----

query I rowsort
SELECT + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
116
158
174

query I rowsort
SELECT DISTINCT col1 + - 3 FROM tab2 GROUP BY col1
----
38
56
58

query I rowsort
SELECT NULLIF ( + 11, + - 15 ) AS col1 FROM tab0 GROUP BY col2, col2
----
11
11
11

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING + col2 + - - 15 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5734
SELECT 67 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - COUNT( * ) BETWEEN col2 AND - 57
----
67
67
67

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5734
SELECT 67 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - COUNT ( * ) BETWEEN col2 AND - 57
----
67
67
67

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 58 * + ( + - col1 ) + - 60 * + col1 + 90 FROM tab1 cor0 GROUP BY col1
----
-24
2
78

query I rowsort
SELECT - col0 * + col0 + ( + + col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT DISTINCT 89 * - ( + col2 ) AS col1 FROM tab2 GROUP BY col2
----
-5162
-7031
-7743

onlyif mysql # aggregate syntax: 
query I rowsort label-5739
SELECT + NULLIF ( - MIN( - col2 ), - col1 ) - col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5739
SELECT + NULLIF ( - MIN ( - col2 ), - col1 ) - col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5740
SELECT ALL col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING - 61 * - COALESCE ( + col2, + + COUNT( * ) ) / + 93 * + 67 IS NOT NULL
----
45
71
8

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5740
SELECT ALL col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING - 61 * - COALESCE ( + col2, + + COUNT ( * ) ) / + 93 * + 67 IS NOT NULL
----
45
71
8

query I rowsort
SELECT 98 + + col0 FROM tab0 cor0 GROUP BY col0
----
124
141
181

onlyif mysql # aggregate syntax: 
query I rowsort label-5742
SELECT - + col1 + - - col1 + ( MAX( DISTINCT - col1 ) ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

skipif mysql # not compatible
query I rowsort label-5742
SELECT - + col1 + - - col1 + ( MAX ( DISTINCT - col1 ) ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

onlyif mysql # aggregate syntax: 
query II rowsort label-5743
SELECT ALL col0 + + col0 + col0 * 78 + - + col0 AS col2, ( + - 63 ) * - ( - col0 ) / + + 2 FROM tab0 GROUP BY col0 HAVING NOT + MAX( ALL - col0 ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-5743
SELECT ALL col0 + + col0 + col0 * 78 + - + col0 AS col2, ( + - 63 ) * - ( - col0 ) / + + 2 FROM tab0 GROUP BY col0 HAVING NOT + MAX ( ALL - col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL - 87 - COALESCE ( + 16, col0 + + 29 ) FROM tab1 GROUP BY col1, col0
----
-103
-103
-103

query II rowsort
SELECT DISTINCT - + 86 - col2, + col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-131
45
-157
71
-94
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL <> 93
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5747
SELECT DISTINCT - + col2 * col2 + - 92 * - + COUNT( * ) + 78 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-1274
-406
-6071

skipif mysql # not compatible
query I rowsort label-5747
SELECT DISTINCT - + col2 * col2 + - 92 * - + COUNT ( * ) + 78 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-1274
-406
-6071

query I rowsort
SELECT + col2 * 7 - + - col2 * + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
120
2340
5538

onlyif mysql # aggregate syntax: 
query I rowsort label-5749
SELECT DISTINCT + 40 / + + col0 AS col2 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT ( NOT + - 80 BETWEEN NULL AND + - 73 ) OR NOT ( + col0 >= - COUNT( * ) + - COUNT( DISTINCT - col0 ) )
----

skipif mysql # not compatible
query I rowsort label-5749
SELECT DISTINCT + 40 / + + col0 AS col2 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT ( NOT + - 80 BETWEEN NULL AND + - 73 ) OR NOT ( + col0 >= - COUNT ( * ) + - COUNT ( DISTINCT - col0 ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5750
SELECT col2 DIV + 79 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
0
1
1

skipif mysql # not compatible
query I rowsort label-5750
SELECT col2 / + 79 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
0
1
1

query I rowsort
SELECT 66 + 97 FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING NULL < - 81 * + col2 / + 48
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5752
SELECT ALL - MIN( ALL + - col0 ) DIV col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5752
SELECT ALL - MIN ( ALL + - col0 ) / col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( col0, - 17 + 18, - ( + - 1 ) + ( + + col1 ) - - + 65 ) FROM tab1 cor0 GROUP BY col0
----
22
28
82

onlyif mysql # aggregate syntax: 
query I rowsort label-5754
SELECT - + 39 + + - COUNT( * ) + + 14 FROM tab2 AS cor0 GROUP BY col2 HAVING - 80 IS NOT NULL
----
-26
-26
-26

skipif mysql # not compatible
query I rowsort label-5754
SELECT - + 39 + + - COUNT ( * ) + + 14 FROM tab2 AS cor0 GROUP BY col2 HAVING - 80 IS NOT NULL
----
-26
-26
-26

query I rowsort
SELECT DISTINCT - + 61 / - col1 / + - col1 / 1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) < NULL AND - col1 + + + col1 IS NULL
----

query I rowsort
SELECT ALL 79 AS col2 FROM tab0 GROUP BY col1
----
79
79

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5757
SELECT col2 * - + CAST( NULL AS SIGNED ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT( * ) + col2 + - col1 <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5757
SELECT col2 * - + CAST ( NULL AS INTEGER ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT ( * ) + col2 + - col1 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5759
SELECT DISTINCT + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-5759
SELECT DISTINCT + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1
----
1

query II rowsort
SELECT col1 AS col0, col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query II rowsort
SELECT DISTINCT ( + col2 ) * col2, + col2 / - col2 + + + col2 AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + 45 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-127
-67
-73

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5763
SELECT DISTINCT MIN( ALL + 91 ) DIV - 53 FROM tab2 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-5763
SELECT DISTINCT MIN ( ALL + 91 ) / - 53 FROM tab2 GROUP BY col2
----
-1

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 WHERE NOT NULL NOT BETWEEN - 23 AND 33 OR NOT NULL <> NULL GROUP BY col0 HAVING - 93 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5765
SELECT DISTINCT COUNT( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
1

skipif mysql # not compatible
query I rowsort label-5765
SELECT DISTINCT COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
1

query I rowsort
SELECT ALL + col1 - - col1 FROM tab0 cor0 GROUP BY col1, col1, col0 HAVING + 40 IS NOT NULL
----
0
0
162

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5767
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING 22 * - + MIN( ALL col1 ) + col0 * - col1 * + 35 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5767
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING 22 * - + MIN ( ALL col1 ) + col0 * - col1 * + 35 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5768
SELECT DISTINCT - - MIN( col2 ) * + + 76 * + - col2 + - col2, col2 * + + COUNT( col2 ) * + MAX( + + col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-255722
3364
-474395
6241
-575331
7569

skipif mysql # not compatible
query II rowsort label-5768
SELECT DISTINCT - - MIN ( col2 ) * + + 76 * + - col2 + - col2, col2 * + + COUNT ( col2 ) * + MAX ( + + col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-255722
3364
-474395
6241
-575331
7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5769
SELECT col2 FROM tab1 WHERE NOT col1 >= CAST( - + col2 AS SIGNED ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-5769
SELECT col2 FROM tab1 WHERE NOT col1 >= CAST ( - + col2 AS INTEGER ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 20 col2 FROM tab2 GROUP BY col1
----
-20
-20
-20

onlyif mysql # aggregate syntax: 
query I rowsort label-5771
SELECT + 95 * - + COUNT( * ) FROM tab0 GROUP BY col2
----
-95
-95
-95

skipif mysql # not compatible
query I rowsort label-5771
SELECT + 95 * - + COUNT ( * ) FROM tab0 GROUP BY col2
----
-95
-95
-95

query I rowsort
SELECT - - col2 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab2 GROUP BY col1 HAVING NOT NULL < - + 62
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5774
SELECT ALL col0 * - - col0 + - + 80 FROM tab0 GROUP BY col2, col0 HAVING - 13 <= - col2 + + - MIN( ALL + col0 ) + col2 * - - 19
----
1769
596
6809

skipif mysql # not compatible
query I rowsort label-5774
SELECT ALL col0 * - - col0 + - + 80 FROM tab0 GROUP BY col2, col0 HAVING - 13 <= - col2 + + - MIN ( ALL + col0 ) + col2 * - - 19
----
1769
596
6809

onlyif mysql # aggregate syntax: 
query I rowsort label-5775
SELECT + MIN( col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-5775
SELECT + MIN ( col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5776
SELECT ( SUM( DISTINCT col0 ) ) + + col0 + + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5776
SELECT ( SUM ( DISTINCT col0 ) ) + + col0 + + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 33 FROM tab2 GROUP BY col2, col2
----
33
33
33

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT + 22 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
22

query I rowsort
SELECT DISTINCT + 89 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL > col2
----

query I rowsort
SELECT DISTINCT 35 AS col1 FROM tab1 GROUP BY col2, col1, col0 HAVING NOT + col2 + + col1 IS NULL
----
35

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col1, - 38 FROM tab2 GROUP BY col2, col2, col0
----
15
-38
91
-38
92
-38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col0, col1 FROM tab1 GROUP BY col1 HAVING + 20 < - 77
----

query I rowsort
SELECT col0 + col0 + + + col1 + - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
126
28
85

query I rowsort
SELECT 40 * - col2 + - + col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING ( ( NULL ) IS NOT NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5786
SELECT DISTINCT + COUNT( * ) + 66 FROM tab2 GROUP BY col0
----
67

skipif mysql # not compatible
query I rowsort label-5786
SELECT DISTINCT + COUNT ( * ) + 66 FROM tab2 GROUP BY col0
----
67

query I rowsort
SELECT 7 + + 62 * - col1 AS col1 FROM tab2 GROUP BY col1
----
-2535
-3651
-3775

query I rowsort
SELECT 64 * col1 AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
5184

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-5789
SELECT + col1 + - - ( + MIN( DISTINCT + - col1 ) ) DIV 23 AS col2 FROM tab0 GROUP BY col1, col0 HAVING - 47 + + SUM( ALL - col0 ) * - CAST( 82 AS SIGNED ) IS NOT NULL
----
0
0
78

skipif mysql # not compatible
query I rowsort label-5789
SELECT + col1 + - - ( + MIN ( DISTINCT + - col1 ) ) / 23 AS col2 FROM tab0 GROUP BY col1, col0 HAVING - 47 + + SUM ( ALL - col0 ) * - CAST ( 82 AS INTEGER ) IS NOT NULL
----
0
0
78

query I rowsort
SELECT + col2 * col2 + - + col0 * + + AVG ( - col2 ) FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING + - 50 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col0 col0, col0 + + - 40 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - + col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
-26
-43
-83

query II rowsort
SELECT DISTINCT + col1, + col1 FROM tab2 GROUP BY col2, col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL ( + col1 ) - col2 FROM tab2 GROUP BY col2, col1
----
-17
-20
-26

query II rowsort
SELECT col2 AS col0, 79 + + - col2 AS col1 FROM tab0 GROUP BY col2
----
24
55
38
41
79
0

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT + 19 IS NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query II rowsort label-5798
SELECT + ( + col1 ), CASE + + 41 WHEN - col1 THEN ( + + col2 ) * - COUNT( * ) + 41 END + - + 10 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2
----
0
NULL
0
NULL
81
NULL

skipif mysql # not compatible
query II rowsort label-5798
SELECT + ( + col1 ), CASE + + 41 WHEN - col1 THEN ( + + col2 ) * - COUNT ( * ) + 41 END + - + 10 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2
----
0
NULL
0
NULL
81
NULL

query I rowsort
SELECT 33 AS col1 FROM tab0 GROUP BY col0
----
33
33
33

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0 HAVING NULL IN ( + + ( 81 ), col1, + col1 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5801
SELECT CAST( + COUNT( * ) AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col1
----
1
2

skipif mysql # not compatible
query I rowsort label-5801
SELECT CAST ( + COUNT ( * ) AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col1
----
1
2

query I rowsort
SELECT - col2 * 37 + - - col1 + - 30 * + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5803
SELECT DISTINCT + + ( COUNT( * ) ) col1 FROM tab0 cor0 GROUP BY col0
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5803
SELECT DISTINCT + + ( COUNT ( * ) ) col1 FROM tab0 cor0 GROUP BY col0
----
1

query I rowsort
SELECT - - col2 AS col0 FROM tab0 AS cor0 WHERE NOT + col1 * + - col1 IS NOT NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5805
SELECT - col2 DIV - col2 + - 20 FROM tab2 AS cor0 GROUP BY col2, col2
----
-19
-19
-19

skipif mysql # not compatible
query I rowsort label-5805
SELECT - col2 / - col2 + - 20 FROM tab2 AS cor0 GROUP BY col2, col2
----
-19
-19
-19

onlyif mysql # aggregate syntax: 
query I rowsort label-5806
SELECT ALL COUNT( - ( - NULLIF ( + 8, ( + col1 ) ) ) ) AS col2 FROM tab0 GROUP BY col1, col1
----
1
2

skipif mysql # not compatible
query I rowsort label-5806
SELECT ALL COUNT ( - ( - NULLIF ( + 8, ( + col1 ) ) ) ) AS col2 FROM tab0 GROUP BY col1, col1
----
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-5807
SELECT + col2 AS col1 FROM tab0 WHERE ( - + col2 * - col0 ) >= col1 * + + COALESCE ( - col2, col1 ) GROUP BY col2, col1 HAVING + col2 + + - COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5807
SELECT + col2 AS col1 FROM tab0 WHERE ( - + col2 * - col0 ) >= col1 * + + COALESCE ( - col2, col1 ) GROUP BY col2, col1 HAVING + col2 + + - COUNT ( * ) IS NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col1, col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL col1 + - 28 AS col1 FROM tab1 GROUP BY col0, col1 HAVING ( + 76 * + + col0 / 21 ) IS NOT NULL
----
-22
16
29

onlyif mysql # aggregate syntax: 
query I rowsort label-5810
SELECT ALL + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT COUNT( * ) = NULL
----

skipif mysql # not compatible
query I rowsort label-5810
SELECT ALL + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT COUNT ( * ) = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5811
SELECT ALL + COUNT( * ) AS col0 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5811
SELECT ALL + COUNT ( * ) AS col0 FROM tab2 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-5812
SELECT - col1 + + ( ( + COUNT( * ) ) ) * col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-5812
SELECT - col1 + + ( ( + COUNT ( * ) ) ) * col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2 AS col0, + 39 col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-5814
SELECT ALL 74 + CAST( + - col0 AS SIGNED ) + + col2 AS col0, col2 + - - CAST( NULL AS DECIMAL ) AS col1 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-5814
SELECT ALL 74 + CAST ( + - col0 AS INTEGER ) + + col2 AS col0, col2 + - - CAST ( NULL AS REAL ) AS col1 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5815
SELECT + col1 * + + 65 * + CAST( NULL AS SIGNED ) + + col1 + - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5815
SELECT + col1 * + + 65 * + CAST ( NULL AS INTEGER ) + + col1 + - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query II rowsort
SELECT 55 + + col1 AS col2, - 14 - 73 FROM tab0 GROUP BY col1 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 66 + col1 FROM tab1 cor0 GROUP BY col1
----
-22
-60
-9

onlyif mysql # aggregate syntax: 
query I rowsort label-5819
SELECT DISTINCT COUNT( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-5819
SELECT DISTINCT COUNT ( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-5820
SELECT ALL + MAX( DISTINCT + + 27 ) * 91 + - col2 * + + COALESCE ( - 46, - 12, + + COUNT( * ) ) + + 72 - + COUNT( * ) AS col0 FROM tab0 GROUP BY col2
----
3632
4276
6162

skipif mysql # not compatible
query I rowsort label-5820
SELECT ALL + MAX ( DISTINCT + + 27 ) * 91 + - col2 * + + COALESCE ( - 46, - 12, + + COUNT ( * ) ) + + 72 - + COUNT ( * ) AS col0 FROM tab0 GROUP BY col2
----
3632
4276
6162

query I rowsort
SELECT 50 FROM tab0 AS cor0 WHERE NOT + 65 IS NOT NULL GROUP BY col0 HAVING + col0 <= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5822
SELECT ALL - 89 * - ( - col1 ) + + COUNT( * ) FROM tab1 cor0 GROUP BY col1
----
-3915
-5072
-533

skipif mysql # not compatible
query I rowsort label-5822
SELECT ALL - 89 * - ( - col1 ) + + COUNT ( * ) FROM tab1 cor0 GROUP BY col1
----
-3915
-5072
-533

onlyif mysql # aggregate syntax: 
query I rowsort label-5823
SELECT col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT - MIN( ALL col2 ) * + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5823
SELECT col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT - MIN ( ALL col2 ) * + COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query II rowsort label-5826
SELECT ALL + - col2 AS col1, - col2 + + - 1 / + MAX( ALL + col2 ) AS col1 FROM tab0 AS cor0 WHERE + 66 >= col2 GROUP BY col2, col0, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-5826
SELECT ALL + - col2 AS col1, - col2 + + - 1 / + MAX ( ALL + col2 ) AS col1 FROM tab0 AS cor0 WHERE + 66 >= col2 GROUP BY col2, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 - - + col1 + + col1 + col1 AS col1 FROM tab0 GROUP BY col1
----
0
324

onlyif mysql # aggregate syntax: 
query I rowsort label-5828
SELECT ALL - 6 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT + COUNT( * ) >= + COUNT( * ) + + + 68
----
-6
-6
-6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5828
SELECT ALL - 6 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT + COUNT ( * ) >= + COUNT ( * ) + + + 68
----
-6
-6
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5829
SELECT DISTINCT + 13 + - CAST( - col2 AS SIGNED ) + + col2 * - 21 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND - col2 GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-5829
SELECT DISTINCT + 13 + - CAST ( - col2 AS INTEGER ) + + col2 * - 21 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND - col2 GROUP BY col2, col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - 98 + col2 + + COALESCE ( - - ( - 21 ), + - ( col0 ) ) * ( - col2 ) * + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
105763
1246
42427

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + 8 + + 52 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL >= col2 + col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5832
SELECT + - col0 * - MAX( - col0 ) * + + col0 * + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-234278
-45212258
-614684

skipif mysql # not compatible
query I rowsort label-5832
SELECT + - col0 * - MAX ( - col0 ) * + + col0 * + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-234278
-45212258
-614684

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5833
SELECT ALL + col1 * 84 + col1 AS col0 FROM tab1 WHERE col0 NOT BETWEEN - CAST( NULL AS DECIMAL ) * + + 18 * - + col0 + - col2 * - - 43 AND + - COALESCE ( + col0, - + 28 ) GROUP BY col0, col1, col1
----
3740
4845
510

skipif mysql # not compatible
query I rowsort label-5833
SELECT ALL + col1 * 84 + col1 AS col0 FROM tab1 WHERE col0 NOT BETWEEN - CAST ( NULL AS REAL ) * + + 18 * - + col0 + - col2 * - - 43 AND + - COALESCE ( + col0, - + 28 ) GROUP BY col0, col1, col1
----
3740
4845
510

query II rowsort
SELECT col2, + ( + - 61 ) FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
-61
38
-61
79
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-5835
SELECT DISTINCT - 52 FROM tab1 AS cor0 GROUP BY col0 HAVING ( + 22 + + COUNT( - - 68 ) * - + col0 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5835
SELECT DISTINCT - 52 FROM tab1 AS cor0 GROUP BY col0 HAVING ( + 22 + + COUNT ( - - 68 ) * - + col0 ) IS NULL
----

query I rowsort
SELECT col2 - - col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col1 + 38 AS col2 FROM tab0 GROUP BY col1
----
119
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 59 col1 FROM tab1 GROUP BY col0
----
59

onlyif mysql # aggregate syntax: 
query I rowsort label-5839
SELECT + COUNT( * ) * COUNT( * ) + - 47 FROM tab1 GROUP BY col2, col0 HAVING - col0 BETWEEN - 0 AND col0
----

skipif mysql # not compatible
query I rowsort label-5839
SELECT + COUNT ( * ) * COUNT ( * ) + - 47 FROM tab1 GROUP BY col2, col0 HAVING - col0 BETWEEN - 0 AND col0
----

query I rowsort
SELECT - ( 53 ) * + col0 + 70 FROM tab1 WHERE 83 <> ( + col2 ) GROUP BY col0, col0
----
-1096
-1414
-4276

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab0 GROUP BY col0 HAVING NOT NULL <> - col0
----

query I rowsort
SELECT + 30 * - col1 + col1 FROM tab0 GROUP BY col1
----
-2349
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5843
SELECT DISTINCT + 60 + - COUNT( ALL col2 ) * col2 FROM tab1 GROUP BY col2, col1
----
-11
15
52

skipif mysql # not compatible
query I rowsort label-5843
SELECT DISTINCT + 60 + - COUNT ( ALL col2 ) * col2 FROM tab1 GROUP BY col2, col1
----
-11
15
52

onlyif mysql # aggregate syntax: 
query I rowsort label-5844
SELECT col2 FROM tab0 WHERE NOT ( - col0 ) IS NOT NULL GROUP BY col2 HAVING COUNT( ( + col1 ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5844
SELECT col2 FROM tab0 WHERE NOT ( - col0 ) IS NOT NULL GROUP BY col2 HAVING COUNT ( ( + col1 ) ) IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5845
SELECT ALL col1 * COUNT( * ) FROM tab0 GROUP BY col2, col1 HAVING - CAST( + 61 AS SIGNED ) <= ( + 77 )
----
0
0
81

skipif mysql # not compatible
query I rowsort label-5845
SELECT ALL col1 * COUNT ( * ) FROM tab0 GROUP BY col2, col1 HAVING - CAST ( + 61 AS INTEGER ) <= ( + 77 )
----
0
0
81

onlyif mysql # aggregate syntax: 
query I rowsort label-5846
SELECT ALL + MAX( ALL col1 ) FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5846
SELECT ALL + MAX ( ALL col1 ) FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 1 FROM tab1 GROUP BY col1 HAVING NOT col1 IS NULL
----
1
1
1

query I rowsort
SELECT col1 * - col1 FROM tab0 GROUP BY col1, col1
----
-6561
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5849
SELECT - col0 col1 FROM tab1 GROUP BY col0, col1 HAVING NULL BETWEEN + col1 + CAST( NULL AS SIGNED ) / 14 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5849
SELECT - col0 col1 FROM tab1 GROUP BY col0, col1 HAVING NULL BETWEEN + col1 + CAST ( NULL AS INTEGER ) / 14 AND NULL
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col2, col0 HAVING ( NULL ) IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 + + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT col2 < NULL
----

query I rowsort
SELECT + col2 + - col2 FROM tab0 WHERE ( - 38 ) > NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5853
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT( * ) + - col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5853
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT ( * ) + - col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5854
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT MIN( + 33 ) * COUNT( * ) + + CAST( NULL AS SIGNED ) < ( MIN( DISTINCT - col0 ) )
----

skipif mysql # not compatible
query I rowsort label-5854
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT MIN ( + 33 ) * COUNT ( * ) + + CAST ( NULL AS INTEGER ) < ( MIN ( DISTINCT - col0 ) )
----

query I rowsort
SELECT ALL - col2 - 48 * col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-2842
-3871
-4263

onlyif mysql # aggregate syntax: 
query I rowsort label-5856
SELECT ALL col0 + col0 AS col0 FROM tab0 AS cor0 WHERE NULL < + 31 * - 70 GROUP BY col0, col1 HAVING NOT ( col1 ) NOT BETWEEN + COUNT( - col0 ) / col1 AND NULL
----

skipif mysql # not compatible
query I rowsort label-5856
SELECT ALL col0 + col0 AS col0 FROM tab0 AS cor0 WHERE NULL < + 31 * - 70 GROUP BY col0, col1 HAVING NOT ( col1 ) NOT BETWEEN + COUNT ( - col0 ) / col1 AND NULL
----

query I rowsort
SELECT DISTINCT ( - col0 ) * ( + col0 ) - + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT + ( - ( - 2 ) ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5858
SELECT ALL - COUNT( * ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING ( COUNT( * ) ) BETWEEN NULL AND ( 36 )
----

skipif mysql # not compatible
query I rowsort label-5858
SELECT ALL - COUNT ( * ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING ( COUNT ( * ) ) BETWEEN NULL AND ( 36 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5859
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5859
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + ( col2 ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-5861
SELECT - ( + COUNT( * ) ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL = 71
----

skipif mysql # not compatible
query I rowsort label-5861
SELECT - ( + COUNT ( * ) ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL = 71
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 19 col0 FROM tab0 GROUP BY col2
----
19
19
19

query I rowsort
SELECT DISTINCT + col1 + + 45 * + col1 AS col0 FROM tab0 WHERE col1 + 87 > - col0 GROUP BY col1
----
0
3726

query I rowsort
SELECT ALL 10 FROM tab0 GROUP BY col0, col0
----
10
10
10

query I rowsort
SELECT DISTINCT - col1 * + 40 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1599
-2301
-2379

query I rowsort
SELECT + + 84 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
84
84
84

onlyif mysql # aggregate syntax: 
query I rowsort label-5867
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL ) > COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5867
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL ) > COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5868
SELECT DISTINCT col0, col0 FROM tab1 GROUP BY col2, col0 HAVING NOT 13 * MIN( col1 ) + + col2 * - 86 NOT IN ( col0 )
----

skipif mysql # not compatible
query II rowsort label-5868
SELECT DISTINCT col0, col0 FROM tab1 GROUP BY col2, col0 HAVING NOT 13 * MIN ( col1 ) + + col2 * - 86 NOT IN ( col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5869
SELECT + col1 * + NULLIF ( + MIN( col1 ), + 47 ) + col0 FROM tab0 cor0 GROUP BY col0, col1
----
26
6604
83

skipif mysql # not compatible
query I rowsort label-5869
SELECT + col1 * + NULLIF ( + MIN ( col1 ), + 47 ) + col0 FROM tab0 cor0 GROUP BY col0, col1
----
26
6604
83

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - ( - 13 ) <= col2 + col0
----
24
38
79

query I rowsort
SELECT DISTINCT + 7 + - - 65 FROM tab0 AS cor0 GROUP BY col2, col0
----
72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + 23 ) col2 FROM tab0 AS cor0 WHERE NULL IN ( 62 + - col0 * col1 ) GROUP BY col1, col2 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL 21 FROM tab0 GROUP BY col2, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 85 AS col1 FROM tab1 GROUP BY col2
----
85

query I rowsort
SELECT DISTINCT - ( - col2 ) + + col2 AS col0 FROM tab0 GROUP BY col2, col1
----
158
48
76

onlyif mysql # DIV for integer division: 
query I rowsort label-5876
SELECT - col2 + 82 DIV 30 FROM tab2 GROUP BY col1, col2
----
-56
-77
-85

skipif mysql # not compatible
query I rowsort label-5876
SELECT - col2 + 82 / 30 FROM tab2 GROUP BY col1, col2
----
-56
-77
-85

onlyif mysql # DIV for integer division: 
query I rowsort label-5877
SELECT DISTINCT col1 DIV - col1 + + col0 + + - 65 FROM tab2 GROUP BY col0, col1
----
-51
25
26

skipif mysql # not compatible
query I rowsort label-5877
SELECT DISTINCT col1 / - col1 + + col0 + + - 65 FROM tab2 GROUP BY col0, col1
----
-51
25
26

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5878
SELECT DISTINCT CAST( - 50 AS SIGNED ) FROM tab0 cor0 GROUP BY col2, col1 HAVING ( ( col1 ) * - ( - col1 - CAST( NULL AS SIGNED ) ) + 56 ) NOT BETWEEN col1 AND ( 44 )
----

skipif mysql # not compatible
query I rowsort label-5878
SELECT DISTINCT CAST ( - 50 AS INTEGER ) FROM tab0 cor0 GROUP BY col2, col1 HAVING ( ( col1 ) * - ( - col1 - CAST ( NULL AS INTEGER ) ) + 56 ) NOT BETWEEN col1 AND ( 44 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 26 + + col0 + - col1 col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT + 96 IS NULL
----
-10
-55
12

onlyif mysql # aggregate syntax: 
query I rowsort label-5880
SELECT DISTINCT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-5880
SELECT DISTINCT + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2
----
1

onlyif mysql # aggregate syntax: 
query I rowsort label-5881
SELECT DISTINCT - 23 * - + COUNT( * ) * 47 * + SUM( DISTINCT - col0 ) - - COUNT( * ) + + col0 FROM tab2 AS cor0 GROUP BY col0
----
-16199
-98279
-99359

skipif mysql # not compatible
query I rowsort label-5881
SELECT DISTINCT - 23 * - + COUNT ( * ) * 47 * + SUM ( DISTINCT - col0 ) - - COUNT ( * ) + + col0 FROM tab2 AS cor0 GROUP BY col0
----
-16199
-98279
-99359

query II rowsort
SELECT DISTINCT - col0 AS col0, ( - + col0 ) FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( 26 ) NOT IN ( 27 )
----
-26
-43
-83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN( DISTINCT CAST( NULL AS SIGNED ) ) ) + ( col1 - COUNT( * ) / 80 ) * + 28
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN ( DISTINCT CAST ( NULL AS INTEGER ) ) ) + ( col1 - COUNT ( * ) / 80 ) * + 28
----

query I rowsort
SELECT ALL + col1 + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 WHERE NOT col0 BETWEEN NULL AND + col0 GROUP BY col2, col1
----

onlyif mysql # DIV for integer division: 
query II rowsort label-5887
SELECT ALL - - col2 * + col2 AS col0, - 5 DIV + + col2 * - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
0
6241
0
7569
0

skipif mysql # not compatible
query II rowsort label-5887
SELECT ALL - - col2 * + col2 AS col0, - 5 / + + col2 * - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
0
6241
0
7569
0

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5888
SELECT - ( CAST( - COUNT( * ) AS DECIMAL ) ) FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5888
SELECT - ( CAST ( - COUNT ( * ) AS REAL ) ) FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ( - 74 ), - 54 AS col2 FROM tab2 GROUP BY col0, col0
----
-74
-54
-74
-54
-74
-54

query I rowsort
SELECT DISTINCT ( - 86 ) FROM tab1 GROUP BY col1, col2
----
-86

query I rowsort
SELECT col0 * - + 45 + col0 + - col0 FROM tab2 cor0 GROUP BY col0, col0
----
-4095
-4140
-675

query I rowsort
SELECT ALL - + 51 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT ( - col1 ) FROM tab2 AS cor0 WHERE col0 NOT IN ( + - 36 * - col1, + 17 ) GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab0 AS cor0 WHERE NULL <= + 62 * + - col2 GROUP BY col0
----

query I rowsort
SELECT ALL - 63 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-63
-63
-63

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5896
SELECT + - col2 col0 FROM tab2 AS cor0 WHERE - CAST( NULL AS SIGNED ) * + col2 * - col1 IS NULL GROUP BY col2 HAVING NOT NULL NOT IN ( + AVG ( + ( + col0 ) ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5896
SELECT + - col2 col0 FROM tab2 AS cor0 WHERE - CAST ( NULL AS INTEGER ) * + col2 * - col1 IS NULL GROUP BY col2 HAVING NOT NULL NOT IN ( + AVG ( + ( + col0 ) ) )
----

query II rowsort
SELECT ALL - col1, col1 * col1 AS col0 FROM tab0 GROUP BY col1
----
-81
6561
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-5898
SELECT - col1 FROM tab1 GROUP BY col0, col2, col1 HAVING + col0 + - + ( CASE + 55 WHEN + + MAX( DISTINCT + 92 ) + - col2 * + 51 THEN NULL WHEN 43 THEN + col2 WHEN - col0 THEN - MAX( DISTINCT + 27 ) + - col2 END ) * + col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5898
SELECT - col1 FROM tab1 GROUP BY col0, col2, col1 HAVING + col0 + - + ( CASE + 55 WHEN + + MAX ( DISTINCT + 92 ) + - col2 * + 51 THEN NULL WHEN 43 THEN + col2 WHEN - col0 THEN - MAX ( DISTINCT + 27 ) + - col2 END ) * + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - col1 ) FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT 51 + ( col1 ) + - col1 * - col0 - + col1 / - - col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT - col0 * 91 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5901
SELECT col0 * + ( + - col2 ) + - 0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING - COUNT( * ) NOT BETWEEN col0 + 70 AND 75
----
-1305
-5336
-7189

skipif mysql # not compatible
query I rowsort label-5901
SELECT col0 * + ( + - col2 ) + - 0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING - COUNT ( * ) NOT BETWEEN col0 + 70 AND 75
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - + 90 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-90
-90
-90

onlyif mysql # aggregate syntax: 
query I rowsort label-5904
SELECT col1 - + 29 FROM tab0 WHERE NOT + + col0 NOT BETWEEN NULL AND + + NULLIF ( 58, col2 * 44 ) GROUP BY col1 HAVING ( + 89 ) / COUNT( * ) + NULLIF ( col1 + COUNT( * ), col1 ) * - NULLIF ( 41 * + 28, - 77 + 30 ) IN ( - SUM( col2 ) )
----

skipif mysql # not compatible
query I rowsort label-5904
SELECT col1 - + 29 FROM tab0 WHERE NOT + + col0 NOT BETWEEN NULL AND + + NULLIF ( 58, col2 * 44 ) GROUP BY col1 HAVING ( + 89 ) / COUNT ( * ) + NULLIF ( col1 + COUNT ( * ), col1 ) * - NULLIF ( 41 * + 28, - 77 + 30 ) IN ( - SUM ( col2 ) )
----

query I rowsort
SELECT - - col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 25 > NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5906
SELECT ALL - NULLIF ( + col1, - col1 - COUNT( * ) + 29 ) DIV - SUM( - - col1 ) col0 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5906
SELECT ALL - NULLIF ( + col1, - col1 - COUNT ( * ) + 29 ) / - SUM ( - - col1 ) col0 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT 45 FROM tab0 AS cor0 GROUP BY col2
----
45

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5908
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING + + CAST( + - col0 AS SIGNED ) IS NOT NULL
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-5908
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING + + CAST ( + - col0 AS INTEGER ) IS NOT NULL
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-5909
SELECT - MAX( - - ( 80 ) ) FROM tab0 WHERE NOT - 50 NOT BETWEEN + col0 AND NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-5909
SELECT - MAX ( - - ( 80 ) ) FROM tab0 WHERE NOT - 50 NOT BETWEEN + col0 AND NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5910
SELECT ALL - COUNT( * ) * - col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5910
SELECT ALL - COUNT ( * ) * - col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 * 61 FROM tab2 GROUP BY col0, col0, col2
----
5551
5612
915

query I rowsort
SELECT - + col2 FROM tab0 cor0 WHERE NOT ( - col1 ) * + 99 + + 3 * + 87 * + ( + 63 ) + - 26 IS NULL GROUP BY col2, col2 HAVING NULL IN ( 61 )
----

query I rowsort
SELECT DISTINCT 24 * - 85 * 55 AS col2 FROM tab2 GROUP BY col1
----
-112200

onlyif mysql # aggregate syntax: 
query I rowsort label-5914
SELECT - MIN( col0 ) FROM tab1 GROUP BY col2, col0 HAVING NOT + + 90 / - 19 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-5914
SELECT - MIN ( col0 ) FROM tab1 GROUP BY col2, col0 HAVING NOT + + 90 / - 19 NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5915
SELECT - col0 + - + col1 + col0 + + + 0 - + + 22 DIV ( + col0 ) * + + col0 * + - MAX( + col1 ) + COUNT( * ) + 85 FROM tab1 AS cor0 GROUP BY col0, col1
----
212
29
42

skipif mysql # not compatible
query I rowsort label-5915
SELECT - col0 + - + col1 + col0 + + + 0 - + + 22 / ( + col0 ) * + + col0 * + - MAX ( + col1 ) + COUNT ( * ) + 85 FROM tab1 AS cor0 GROUP BY col0, col1
----
212
29
42

query I rowsort
SELECT DISTINCT + + col1 * - ( - - col1 ) * 29 AS col0 FROM tab0 cor0 GROUP BY col1, col1
----
-190269
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5917
SELECT ALL CAST( NULL AS SIGNED ) * - col1 + - 67 * + col1 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING 10 / NULLIF ( - - CAST( - COUNT( * ) AS SIGNED ), + 23 + 4 ) NOT BETWEEN + 71 / col1 AND ( + 15 * 59 )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5917
SELECT ALL CAST ( NULL AS INTEGER ) * - col1 + - 67 * + col1 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING 10 / NULLIF ( - - CAST ( - COUNT ( * ) AS INTEGER ), + 23 + 4 ) NOT BETWEEN + 71 / col1 AND ( + 15 * 59 )
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5918
SELECT ALL + - COUNT( ALL + col1 ) / - + col1 * ( col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 >= 45 / - 38 + + CAST( + CAST( NULL AS SIGNED ) AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5918
SELECT ALL + - COUNT ( ALL + col1 ) / - + col1 * ( col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 >= 45 / - 38 + + CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5919
SELECT DISTINCT COUNT( * ) FROM tab1 GROUP BY col1, col2 HAVING + 86 * + - ( CAST( NULL AS SIGNED ) ) * - - 12 / - + col1 + + col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5919
SELECT DISTINCT COUNT ( * ) FROM tab1 GROUP BY col1, col2 HAVING + 86 * + - ( CAST ( NULL AS INTEGER ) ) * - - 12 / - + col1 + + col1 IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5921
SELECT DISTINCT + 37 / + col2 FROM tab2 WHERE NOT - CASE - + 72 WHEN + col2 + - + col1 * + col1 * + ( - + col1 ) THEN - - CASE - CASE WHEN NOT + 15 NOT IN ( 43 + col1 ) THEN CAST( col2 AS SIGNED ) * 49 ELSE NULL END WHEN + col0 THEN ( - col2 ) WHEN 86 + col1 THEN NULL ELSE col2 END - col1 * col1 WHEN 99 THEN col1 ELSE - col2 END * col0 NOT BETWEEN ( + col1 ) AND ( NULL ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-5921
SELECT DISTINCT + 37 / + col2 FROM tab2 WHERE NOT - CASE - + 72 WHEN + col2 + - + col1 * + col1 * + ( - + col1 ) THEN - - CASE - CASE WHEN NOT + 15 NOT IN ( 43 + col1 ) THEN CAST ( col2 AS INTEGER ) * 49 ELSE NULL END WHEN + col0 THEN ( - col2 ) WHEN 86 + col1 THEN NULL ELSE col2 END - col1 * col1 WHEN 99 THEN col1 ELSE - col2 END * col0 NOT BETWEEN ( + col1 ) AND ( NULL ) GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5922
SELECT col2 + + COUNT( * ) - - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT 56 IS NULL
----
143
17
91

skipif mysql # not compatible
query I rowsort label-5922
SELECT col2 + + COUNT ( * ) - - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT 56 IS NULL
----
143
17
91

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5923
SELECT 9 - - col1 FROM tab2 GROUP BY col1 HAVING - CAST( NULL AS SIGNED ) IN ( + - SUM( - + 47 ), + MIN( col2 ) )
----

skipif mysql # not compatible
query I rowsort label-5923
SELECT 9 - - col1 FROM tab2 GROUP BY col1 HAVING - CAST ( NULL AS INTEGER ) IN ( + - SUM ( - + 47 ), + MIN ( col2 ) )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT( * ) ), - CAST( NULL AS SIGNED ) ) THEN + - NULLIF ( - 84, + - SUM( + col2 ) - 35 ) ELSE COUNT( * ) END FROM tab0 GROUP BY col1
----
-81
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT ( * ) ), - CAST ( NULL AS INTEGER ) ) THEN + - NULLIF ( - 84, + - SUM ( + col2 ) - 35 ) ELSE COUNT ( * ) END FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5925
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT( - col1 ) + + col2 >= ( + CAST( NULL AS DECIMAL ) * col2 / + - COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-5925
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT ( - col1 ) + + col2 >= ( + CAST ( NULL AS REAL ) * col2 / + - COUNT ( * ) )
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 WHERE NOT 89 NOT IN ( + + 58 - col1, col0 - + + 34 ) GROUP BY col2
----

query I rowsort
SELECT ALL + col0 + + ( - 69 ) - + 85 * - - 12 * - col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
26503
43877
84757

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5929
SELECT DISTINCT COUNT( * ) DIV - + col2 AS col0 FROM tab0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-5929
SELECT DISTINCT COUNT ( * ) / - + col2 AS col0 FROM tab0 GROUP BY col2
----
0

onlyif mysql # aggregate syntax: 
query II rowsort label-5930
SELECT DISTINCT 49 * + MIN( + col1 ) + col2 + col2 - - col1 * - + col1 * - col1 + SUM( 14 ), col2 AS col2 FROM tab2 GROUP BY col2, col1
----
208442
79
230158
87
71060
58

skipif mysql # not compatible
query II rowsort label-5930
SELECT DISTINCT 49 * + MIN ( + col1 ) + col2 + col2 - - col1 * - + col1 * - col1 + SUM ( 14 ), col2 AS col2 FROM tab2 GROUP BY col2, col1
----
208442
79
230158
87
71060
58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT( * ) / CASE + CAST( NULL AS SIGNED ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST( NULL AS SIGNED ) ) AND NULLIF ( - CAST( NULL AS SIGNED ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT ( * ) / CASE + CAST ( NULL AS INTEGER ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT ( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT ( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST ( NULL AS INTEGER ) ) AND NULLIF ( - CAST ( NULL AS INTEGER ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5933
SELECT MAX( - ( - col1 ) ) FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-5933
SELECT MAX ( - ( - col1 ) ) FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT + 11 FROM tab1 AS cor0 GROUP BY col2, col1
----
11
11
11

query I rowsort
SELECT ALL + 67 * + col2 + - + 83 * - 62 * - col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
-228555
-360609
-40632

onlyif mysql # aggregate syntax: 
query I rowsort label-5936
SELECT + SUM( + col2 ) FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-5936
SELECT + SUM ( + col2 ) FROM tab1 GROUP BY col2, col2
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-5937
SELECT - COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5937
SELECT - COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL - col2 + + + 90 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5940
SELECT + CAST( - 11 AS SIGNED ) + - - col0 AS col0 FROM tab1 GROUP BY col2, col0
----
11
17
71

skipif mysql # not compatible
query I rowsort label-5940
SELECT + CAST ( - 11 AS INTEGER ) + - - col0 AS col0 FROM tab1 GROUP BY col2, col0
----
11
17
71

query II rowsort
SELECT col0, - 86 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
15
-86
91
-86
92
-86

onlyif mysql # aggregate syntax: 
query I rowsort label-5942
SELECT ALL + SUM( ALL + 26 ) FROM tab1 GROUP BY col1
----
26
26
26

skipif mysql # not compatible
query I rowsort label-5942
SELECT ALL + SUM ( ALL + 26 ) FROM tab1 GROUP BY col1
----
26
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 32 FROM tab1 GROUP BY col0
----
32
32
32

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5945
SELECT MAX( - CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5945
SELECT MAX ( - CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER ) ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + ( + 34 ) + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
117
60
77

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

onlyif mysql # DIV for integer division: 
query I rowsort label-5948
SELECT DISTINCT - col1 DIV - - 88 FROM tab2 GROUP BY col2, col1, col0 HAVING - CASE WHEN ( NOT - 11 IS NULL ) THEN + + col2 + ( - + ( + col2 ) ) DIV 49 WHEN NOT NULL IS NOT NULL THEN NULL END * + 26 > - + col1 * col1 - 71 * 83
----
0

skipif mysql # not compatible
query I rowsort label-5948
SELECT DISTINCT - col1 / - - 88 FROM tab2 GROUP BY col2, col1, col0 HAVING - CASE WHEN ( NOT - 11 IS NULL ) THEN + + col2 + ( - + ( + col2 ) ) / 49 WHEN NOT NULL IS NOT NULL THEN NULL END * + 26 > - + col1 * col1 - 71 * 83
----
0

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-5949
SELECT 62 * - - CAST( + CAST( NULL AS DECIMAL ) AS SIGNED ), col1 FROM tab1 GROUP BY col1, col0 HAVING - CAST( NULL AS DECIMAL ) IS NULL
----
NULL
44
NULL
57
NULL
6

skipif mysql # not compatible
query II rowsort label-5949
SELECT 62 * - - CAST ( + CAST ( NULL AS REAL ) AS INTEGER ), col1 FROM tab1 GROUP BY col1, col0 HAVING - CAST ( NULL AS REAL ) IS NULL
----
NULL
44
NULL
57
NULL
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - 31, 28 col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-31
28

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-5953
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN MAX( - + col1 ) AND + - 41
----

skipif mysql # not compatible
query I rowsort label-5953
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN MAX ( - + col1 ) AND + - 41
----

onlyif mysql # aggregate syntax: 
query II rowsort label-5954
SELECT DISTINCT + MAX( ALL ( - 73 ) ) + col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-30
43
-47
26
10
83

skipif mysql # not compatible
query II rowsort label-5954
SELECT DISTINCT + MAX ( ALL ( - 73 ) ) + col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-30
43
-47
26
10
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5955
SELECT DISTINCT + CAST( NULL AS SIGNED ) + 56 AS col2 FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-5955
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + 56 AS col2 FROM tab0 GROUP BY col0
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * - + 62 col0 FROM tab0 GROUP BY col1
----
-5022
0

query I rowsort
SELECT col1 + - 36 AS col2 FROM tab0 GROUP BY col1
----
-36
45

onlyif mysql # aggregate syntax: 
query I rowsort label-5958
SELECT MIN( - 8 ) AS col0 FROM tab0 WHERE NOT - + ( - - col1 ) + col2 IS NULL GROUP BY col2
----
-8
-8
-8

skipif mysql # not compatible
query I rowsort label-5958
SELECT MIN ( - 8 ) AS col0 FROM tab0 WHERE NOT - + ( - - col1 ) + col2 IS NULL GROUP BY col2
----
-8
-8
-8

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NOT NULL <> ( - col0 ) GROUP BY col0, col0
----

query I rowsort
SELECT 67 AS col0 FROM tab0 GROUP BY col2
----
67
67
67

query I rowsort
SELECT ALL - 17 + 46 FROM tab1 AS cor0 GROUP BY col2
----
29
29
29

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2, col1, col0
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-5963
SELECT - - SUM( ALL 20 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
20
20
20

skipif mysql # not compatible
query I rowsort label-5963
SELECT - - SUM ( ALL 20 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
20
20
20

query II rowsort
SELECT ALL + col1 / + col2 + + col2 / - col1 AS col0, 35 * - - 79 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5965
SELECT + ( - + NULLIF ( + 40, + col1 ) ) * + 69 - + - 87 + - + MAX( - + 90 ) / + + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5965
SELECT + ( - + NULLIF ( + 40, + col1 ) ) * + 69 - + - 87 + - + MAX ( - + 90 ) / + + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5966
SELECT + MAX( ALL + + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

skipif mysql # not compatible
query I rowsort label-5966
SELECT + MAX ( ALL + + col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

onlyif mysql # aggregate syntax: 
query I rowsort label-5967
SELECT + COUNT( * ) FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5967
SELECT + COUNT ( * ) FROM tab0 GROUP BY col0
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-5968
SELECT col2 * + + COUNT( * ) * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

skipif mysql # not compatible
query I rowsort label-5968
SELECT col2 * + + COUNT ( * ) * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col0, col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5970
SELECT DISTINCT + col2 * - CAST( NULL AS SIGNED ) AS col1, col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
45
NULL
71
NULL
8

skipif mysql # not compatible
query II rowsort label-5970
SELECT DISTINCT + col2 * - CAST ( NULL AS INTEGER ) AS col1, col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
45
NULL
71
NULL
8

onlyif mysql # aggregate syntax: 
query II rowsort label-5971
SELECT - + COUNT( * ) + + ( col1 ), - COUNT( * ) FROM tab1 AS cor0 WHERE NULL NOT BETWEEN NULL AND + 23 GROUP BY col0, col1, col2
----

skipif mysql # not compatible
query II rowsort label-5971
SELECT - + COUNT ( * ) + + ( col1 ), - COUNT ( * ) FROM tab1 AS cor0 WHERE NULL NOT BETWEEN NULL AND + 23 GROUP BY col0, col1, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5972
SELECT + SUM( - - 51 ) + + col0 FROM tab0 GROUP BY col0
----
134
77
94

skipif mysql # not compatible
query I rowsort label-5972
SELECT + SUM ( - - 51 ) + + col0 FROM tab0 GROUP BY col0
----
134
77
94

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT - 74 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-74
-74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 75 col2 FROM tab0 AS cor0 GROUP BY col0
----
75
75
75

query I rowsort
SELECT ALL - ( + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5977
SELECT ALL - 71 * col0 AS col1, 55 FROM tab0 WHERE NOT ( - col1 ) IN ( CAST( NULL AS SIGNED ), + col2 * - col1 ) GROUP BY col0
----

skipif mysql # not compatible
query II rowsort label-5977
SELECT ALL - 71 * col0 AS col1, 55 FROM tab0 WHERE NOT ( - col1 ) IN ( CAST ( NULL AS INTEGER ), + col2 * - col1 ) GROUP BY col0
----

query I rowsort
SELECT ALL 75 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
75
75
75

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-5979
SELECT DISTINCT CAST( - - 68 AS SIGNED ) AS col1, 82 + + 55 * + + col0 * + 95 * + - col0, col0 FROM tab1 GROUP BY col0
----
9 values hashing to baa36d47a286be3d0b14f943cd0ca15d

skipif mysql # not compatible
query III rowsort label-5979
SELECT DISTINCT CAST ( - - 68 AS INTEGER ) AS col1, 82 + + 55 * + + col0 * + 95 * + - col0, col0 FROM tab1 GROUP BY col0
----
9 values hashing to baa36d47a286be3d0b14f943cd0ca15d

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5980
SELECT DISTINCT + col0 * + ( COUNT( NULLIF ( - CAST( NULL AS SIGNED ), + 75 ) ) ) * + col2 FROM tab0 GROUP BY col2, col0
----
0

skipif mysql # not compatible
query I rowsort label-5980
SELECT DISTINCT + col0 * + ( COUNT ( NULLIF ( - CAST ( NULL AS INTEGER ), + 75 ) ) ) * + col2 FROM tab0 GROUP BY col2, col0
----
0

query I rowsort
SELECT - + col1 * + ( + 44 ) * - 34 + col0 * + 27 + - 50 * + 61 AS col2 FROM tab1 WHERE NOT - + col1 * col2 + - col1 / - ( col1 ) <> - + col2 GROUP BY col0, col0, col1
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5982
SELECT ALL - col0 FROM tab2 GROUP BY col0, col0 HAVING + - CAST( - 41 AS SIGNED ) - + COUNT( * ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-5982
SELECT ALL - col0 FROM tab2 GROUP BY col0, col0 HAVING + - CAST ( - 41 AS INTEGER ) - + COUNT ( * ) NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5983
SELECT DISTINCT COUNT( ALL 64 ) / - col2 + - - 53 + - - CAST( NULL AS SIGNED ) / + 39 FROM tab0 AS cor0 WHERE NOT NULL >= col2 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5983
SELECT DISTINCT COUNT ( ALL 64 ) / - col2 + - - 53 + - - CAST ( NULL AS INTEGER ) / + 39 FROM tab0 AS cor0 WHERE NOT NULL >= col2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5984
SELECT ALL + AVG ( ALL + + ( - CAST( NULL AS SIGNED ) ) ) * + col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5984
SELECT ALL + AVG ( ALL + + ( - CAST ( NULL AS INTEGER ) ) ) * + col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5985
SELECT COUNT( * ) * - + COUNT( * ) FROM tab0 GROUP BY col0, col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5985
SELECT COUNT ( * ) * - + COUNT ( * ) FROM tab0 GROUP BY col0, col2, col0
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-5986
SELECT DISTINCT 66 * SUM( DISTINCT col0 ) FROM tab1 GROUP BY col2, col0
----
1452
1848
5412

skipif mysql # not compatible
query I rowsort label-5986
SELECT DISTINCT 66 * SUM ( DISTINCT col0 ) FROM tab1 GROUP BY col2, col0
----
1452
1848
5412

onlyif mysql # aggregate syntax: 
query I rowsort label-5987
SELECT ALL - NULLIF ( - col0, 3 * - 32 - - - col0 * - + COUNT( * ) ) + + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
126
28
85

skipif mysql # not compatible
query I rowsort label-5987
SELECT ALL - NULLIF ( - col0, 3 * - 32 - - - col0 * - + COUNT ( * ) ) + + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
126
28
85

query I rowsort
SELECT + col0 * - + col0 + + + col0 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-1763
-624
-6723

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-5989
SELECT - - col1 * - + COUNT( DISTINCT CAST( NULL AS DECIMAL ) ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT AVG ( ALL + - 43 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5989
SELECT - - col1 * - + COUNT ( DISTINCT CAST ( NULL AS REAL ) ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT AVG ( ALL + - 43 ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST( + COUNT( * ) AS SIGNED ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST ( + COUNT ( * ) AS INTEGER ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 40 FROM tab0 GROUP BY col2, col1
----
40

onlyif mysql # aggregate syntax: 
query I rowsort label-5992
SELECT ALL MIN( - col2 ) + 61 col1 FROM tab2 GROUP BY col2
----
-18
-26
3

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5992
SELECT ALL MIN ( - col2 ) + 61 col1 FROM tab2 GROUP BY col2
----
-18
-26
3

query I rowsort
SELECT DISTINCT + 25 AS col0 FROM tab2 GROUP BY col1, col0, col0
----
25

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5994
SELECT + 82 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT + CAST( NULL AS SIGNED ) NOT BETWEEN NULL AND COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-5994
SELECT + 82 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT + CAST ( NULL AS INTEGER ) NOT BETWEEN NULL AND COUNT ( * )
----

query I rowsort
SELECT DISTINCT + col2 * 6 * - col2 AS col2 FROM tab1 cor0 WHERE NULL < 1 / + 24 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5996
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + col2 = - CAST( - 47 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5996
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + col2 = - CAST ( - 47 AS INTEGER )
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1, col1 HAVING NULL > - col1 * 74
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5998
SELECT + col1 + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-5998
SELECT + col1 + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

query I rowsort
SELECT DISTINCT - col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT 27 * + + col0 AS col2 FROM tab1 GROUP BY col0
----
2214
594
756

onlyif mysql # DIV for integer division: 
query I rowsort label-6001
SELECT col2 * + col0 - col2 - - + col2 + 86 DIV 22 AS col0 FROM tab2 GROUP BY col0, col2
----
1308
5339
7192

skipif mysql # not compatible
query I rowsort label-6001
SELECT col2 * + col0 - col2 - - + col2 + 86 / 22 AS col0 FROM tab2 GROUP BY col0, col2
----
1308
5339
7192

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 39 + - + col0 col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
-121
-61
-67

query I rowsort
SELECT 11 * col2 * col0 AS col2 FROM tab2 GROUP BY col0, col2
----
14355
58696
79079

query I rowsort
SELECT + 19 AS col2 FROM tab1 cor0 GROUP BY col2, col1, col1
----
19
19
19

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6005
SELECT ALL - 65 + + col1 * + + col1 + - + col1 + - COUNT( * ) DIV COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1574
3356
3594

skipif mysql # not compatible
query I rowsort label-6005
SELECT ALL - 65 + + col1 * + + col1 + - + col1 + - COUNT ( * ) / COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1574
3356
3594

onlyif mysql # aggregate syntax: 
query II rowsort label-6006
SELECT col0 AS col0, COUNT( * ) FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN 82 AND - 34
----

skipif mysql # not compatible
query II rowsort label-6006
SELECT col0 AS col0, COUNT ( * ) FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN 82 AND - 34
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6007
SELECT + MIN( + col1 ) * - 25 * SUM( ALL 3 ) + + - col1 - + col1, - 12 - - + 40 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-6237
28
0
28

skipif mysql # not compatible
query II rowsort label-6007
SELECT + MIN ( + col1 ) * - 25 * SUM ( ALL 3 ) + + - col1 - + col1, - 12 - - + 40 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-6237
28
0
28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 AS cor0 WHERE 86 * + col2 * col2 <= NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6009
SELECT ALL + 55 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= - COUNT( * ) * + 10 * + 33
----

skipif mysql # not compatible
query I rowsort label-6009
SELECT ALL + 55 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= - COUNT ( * ) * + 10 * + 33
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6010
SELECT COUNT( * ) FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6010
SELECT COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT - 94 <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6012
SELECT 5 FROM tab1 GROUP BY col1, col1 HAVING NULL > COUNT( * ) * - COUNT( * ) + + - 10 * + + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6012
SELECT 5 FROM tab1 GROUP BY col1, col1 HAVING NULL > COUNT ( * ) * - COUNT ( * ) + + - 10 * + + COUNT ( * )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-6013
SELECT CAST( NULL AS SIGNED ) / + col1 * - 81 + - col1 - 12 / + COUNT( * ) - 43 AS col0, - col1 + + 12 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
-32
NULL
-45
NULL
6

skipif mysql # not compatible
query II rowsort label-6013
SELECT CAST ( NULL AS INTEGER ) / + col1 * - 81 + - col1 - 12 / + COUNT ( * ) - 43 AS col0, - col1 + + 12 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
-32
NULL
-45
NULL
6

onlyif mysql # aggregate syntax: 
query I rowsort label-6014
SELECT DISTINCT - SUM( + - col1 ) FROM tab1 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-6014
SELECT DISTINCT - SUM ( + - col1 ) FROM tab1 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT + - col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL > - 13
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6018
SELECT col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1, col2 HAVING + - col1 * - col1 * col1 - - COUNT( * ) * 44 IS NOT NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6018
SELECT col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1, col2 HAVING + - col1 * - col1 * col1 - - COUNT ( * ) * 44 IS NOT NULL
----
41
59
61

query II rowsort
SELECT ALL col2 * - col2 AS col2, col2 FROM tab0 GROUP BY col2, col2 HAVING NOT 43 IS NOT NULL
----

query II rowsort
SELECT DISTINCT col0 * - col0, + col0 * + + col0 * col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 + + + col2 AS col2 FROM tab1 GROUP BY col2
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6022
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT - + CAST( - 70 AS SIGNED ) IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6022
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT - + CAST ( - 70 AS INTEGER ) IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col2 / + - col2 + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IN ( 66 )
----

query I rowsort
SELECT ALL + 34 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT col2 + col2 < 4
----
34
34
34

onlyif mysql # aggregate syntax: 
query I rowsort label-6026
SELECT - + CASE - col0 WHEN + COALESCE ( + + 7, + col0 ) THEN SUM( + col2 ) WHEN + - col2 THEN NULL END FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6026
SELECT - + CASE - col0 WHEN + COALESCE ( + + 7, + col0 ) THEN SUM ( + col2 ) WHEN + - col2 THEN NULL END FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT - + 79 - + + col0 + 45 * - + col0 FROM tab2 AS cor0 GROUP BY col0
----
-4265
-4311
-769

query I rowsort
SELECT ALL - 58 * - col0 FROM tab0 GROUP BY col0
----
1508
2494
4814

onlyif mysql # aggregate syntax: 
query I rowsort label-6029
SELECT COUNT( * ) + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6029
SELECT COUNT ( * ) + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 + + 33 FROM tab2 AS cor0 GROUP BY col1
----
-26
-28
-8

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6031
SELECT ( - + COUNT( * ) ) * + CAST( NULL AS SIGNED ) + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT 45 * + + 64 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6031
SELECT ( - + COUNT ( * ) ) * + CAST ( NULL AS INTEGER ) + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT 45 * + + 64 IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6032
SELECT DISTINCT + col2 + - - col2 col0 FROM tab0 AS cor0 WHERE 37 IS NULL GROUP BY col2 HAVING NULL IN ( - MAX( DISTINCT - 95 ), + col0, + COUNT( DISTINCT - CAST( NULL AS DECIMAL ) ), 95 / 83, ( MIN( DISTINCT col0 ) ) + + 63 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6032
SELECT DISTINCT + col2 + - - col2 col0 FROM tab0 AS cor0 WHERE 37 IS NULL GROUP BY col2 HAVING NULL IN ( - MAX ( DISTINCT - 95 ), + col0, + COUNT ( DISTINCT - CAST ( NULL AS REAL ) ), 95 / 83, ( MIN ( DISTINCT col0 ) ) + + 63 )
----

query II rowsort
SELECT DISTINCT col2 AS col2, + ( 60 ) FROM tab0 cor0 GROUP BY col2
----
24
60
38
60
79
60

query II rowsort
SELECT - col1 AS col1, col1 - + + 9 FROM tab0 GROUP BY col1
----
-81
72
0
-9

query I rowsort
SELECT + 75 + + - col2 * col2 AS col1 FROM tab0 GROUP BY col2
----
-1369
-501
-6166

query I rowsort
SELECT DISTINCT col2 * + col0 FROM tab0 GROUP BY col1, col2, col0
----
1032
2054
3154

onlyif mysql # aggregate syntax: 
query I rowsort label-6037
SELECT DISTINCT 94 AS col1 FROM tab1 WHERE - col2 IS NOT NULL GROUP BY col1 HAVING NOT NULL >= + + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6037
SELECT DISTINCT 94 AS col1 FROM tab1 WHERE - col2 IS NOT NULL GROUP BY col1 HAVING NOT NULL >= + + COUNT ( * )
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col2, col0 HAVING NOT - col2 <= NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT - 69 + 39 AS col2 FROM tab2 AS cor0 WHERE col0 > NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6042
SELECT - SUM( col1 ) * + col1 FROM tab0 cor0 GROUP BY col1, col1
----
-6561
0

skipif mysql # not compatible
query I rowsort label-6042
SELECT - SUM ( col1 ) * + col1 FROM tab0 cor0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT col0 * + 82 AS col2 FROM tab2 GROUP BY col0, col1
----
1230
7462
7544

onlyif mysql # aggregate syntax: 
query I rowsort label-6044
SELECT DISTINCT ( COUNT( * ) ) + col2 FROM tab1 GROUP BY col0, col2
----
46
72
9

skipif mysql # not compatible
query I rowsort label-6044
SELECT DISTINCT ( COUNT ( * ) ) + col2 FROM tab1 GROUP BY col0, col2
----
46
72
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT 9, - 96 col0 FROM tab1 GROUP BY col0
----
9
-96

onlyif mysql # aggregate syntax: 
query II rowsort label-6046
SELECT col0 AS col0, - COUNT( * ) col0 FROM tab1 GROUP BY col0
----
22
-1
28
-1
82
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6046
SELECT col0 AS col0, - COUNT ( * ) col0 FROM tab1 GROUP BY col0
----
22
-1
28
-1
82
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-6047
SELECT + col2 * - col2 + 68 + + + COUNT( + + col2 ) FROM tab1 cor0 GROUP BY col2
----
-1956
-4972
5

skipif mysql # not compatible
query I rowsort label-6047
SELECT + col2 * - col2 + 68 + + + COUNT ( + + col2 ) FROM tab1 cor0 GROUP BY col2
----
-1956
-4972
5

query I rowsort
SELECT DISTINCT ( col2 ) + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NOT + col2 * col0 + - + 98 + - col2 IS NULL GROUP BY col1
----
-41
-59
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-6050
SELECT DISTINCT COUNT( * ) * + 60 FROM tab2 GROUP BY col0, col1
----
60

skipif mysql # not compatible
query I rowsort label-6050
SELECT DISTINCT COUNT ( * ) * + 60 FROM tab2 GROUP BY col0, col1
----
60

onlyif mysql # aggregate syntax: 
query I rowsort label-6051
SELECT COUNT( * ) - + - 48 FROM tab2 WHERE ( NULL ) < NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6051
SELECT COUNT ( * ) - + - 48 FROM tab2 WHERE ( NULL ) < NULL GROUP BY col2
----

query I rowsort
SELECT - 86 FROM tab1 AS cor0 GROUP BY col1, col1
----
-86
-86
-86

query I rowsort
SELECT 52 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
52
52
52

onlyif mysql # aggregate syntax: 
query I rowsort label-6054
SELECT + COUNT( * ) * - - 24 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
24
24
24

skipif mysql # not compatible
query I rowsort label-6054
SELECT + COUNT ( * ) * - - 24 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
24
24
24

query I rowsort
SELECT DISTINCT + - 11 FROM tab1 AS cor0 GROUP BY col2
----
-11

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
676
6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL + col1 + + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-6060
SELECT DISTINCT - MIN( ALL + + col1 ) FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0

skipif mysql # not compatible
query I rowsort label-6060
SELECT DISTINCT - MIN ( ALL + + col1 ) FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6061
SELECT - + 75 * col1 + + + 8 AS col0 FROM tab0 AS cor0 WHERE + col1 * - CAST( NULL AS SIGNED ) IS NULL GROUP BY col1
----
-6067
8

skipif mysql # not compatible
query I rowsort label-6061
SELECT - + 75 * col1 + + + 8 AS col0 FROM tab0 AS cor0 WHERE + col1 * - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col1
----
-6067
8

onlyif mysql # aggregate syntax: 
query I rowsort label-6062
SELECT ALL - col1 + + 93 * - 78 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN - MIN( ALL col0 ) AND + ( + col1 )
----

skipif mysql # not compatible
query I rowsort label-6062
SELECT ALL - col1 + + 93 * - 78 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN - MIN ( ALL col0 ) AND + ( + col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6063
SELECT COUNT( * ) FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6063
SELECT COUNT ( * ) FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT + col2 * - col2 - + col2 + col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

onlyif mysql # aggregate syntax: 
query I rowsort label-6065
SELECT COUNT( * ) FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6065
SELECT COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
1
1
1

query I rowsort
SELECT ALL + 0 FROM tab2 GROUP BY col0, col1
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6067
SELECT ALL COUNT( * ) FROM tab0 GROUP BY col1, col1, col2 HAVING ( NULL ) IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6067
SELECT ALL COUNT ( * ) FROM tab0 GROUP BY col1, col1, col2 HAVING ( NULL ) IS NULL
----
1
1
1

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT - + 74 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
-74
-74
-74

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6070
SELECT col0 + - col1 + + 75 * - col0 AS col1 FROM tab1 AS cor0 WHERE - col0 * - col0 + - - col2 IS NOT NULL GROUP BY col1, col0 HAVING NOT CAST( NULL AS SIGNED ) + - col1 NOT BETWEEN + NULLIF ( + col1, - + COUNT( - + 87 ) * col0 ) AND - + col0
----

skipif mysql # not compatible
query I rowsort label-6070
SELECT col0 + - col1 + + 75 * - col0 AS col1 FROM tab1 AS cor0 WHERE - col0 * - col0 + - - col2 IS NOT NULL GROUP BY col1, col0 HAVING NOT CAST ( NULL AS INTEGER ) + - col1 NOT BETWEEN + NULLIF ( + col1, - + COUNT ( - + 87 ) * col0 ) AND - + col0
----

query I rowsort
SELECT col2 + + 3 * + + 6 FROM tab2 GROUP BY col0, col2
----
105
76
97

onlyif mysql # DIV for integer division: 
query I rowsort label-6072
SELECT DISTINCT + col0 - - - col2 DIV col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
23
43
83

skipif mysql # not compatible
query I rowsort label-6072
SELECT DISTINCT + col0 - - - col2 / col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
23
43
83

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT 41 AS col0 FROM tab0 GROUP BY col0
----
41

query I rowsort
SELECT ALL - 36 + - col1 + - 25 * + + col1 * - 73 FROM tab0 GROUP BY col1
----
-36
147708

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT - col0 + - col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
-506
-6806
-812

onlyif mysql # aggregate syntax: 
query II rowsort label-6078
SELECT + - col2 AS col1, col2 * - col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <= - MAX( ALL + 69 ) * COALESCE ( - SUM( ALL + - 37 ), - col2 * - + ( - 19 ) / ( col0 ) * + + COUNT( * ) + + COUNT( * ) - + col0 * + col2, + COUNT( * ) + - 46 * col0 ) * + - col2 * + col1 + col2 + + 58 + - col0 + + - col2 * - + col1 * + 17 * - + 74 + - + col0 * - 5
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6078
SELECT + - col2 AS col1, col2 * - col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <= - MAX ( ALL + 69 ) * COALESCE ( - SUM ( ALL + - 37 ), - col2 * - + ( - 19 ) / ( col0 ) * + + COUNT ( * ) + + COUNT ( * ) - + col0 * + col2, + COUNT ( * ) + - 46 * col0 ) * + - col2 * + col1 + col2 + + 58 + - col0 + + - col2 * - + col1 * + 17 * - + 74 + - + col0 * - 5
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6079
SELECT - - col0 - - col0 * - 83 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - + col0 * 95 * ( + CAST( + AVG ( ALL + col0 ) AS SIGNED ) ) IS NULL
----
-1230
-7462
-7544

skipif mysql # not compatible
query I rowsort label-6079
SELECT - - col0 - - col0 * - 83 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - + col0 * 95 * ( + CAST ( + AVG ( ALL + col0 ) AS INTEGER ) ) IS NULL
----
-1230
-7462
-7544

onlyif mysql # aggregate syntax: 
query I rowsort label-6080
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN + COUNT( * ) + col2 + - - col0 AND NULL
----

skipif mysql # not compatible
query I rowsort label-6080
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN + COUNT ( * ) + col2 + - - col0 AND NULL
----

query I rowsort
SELECT ( + col0 ) * col0 * + + col0 FROM tab1 GROUP BY col0
----
10648
21952
551368

onlyif mysql # DIV for integer division: 
query I rowsort label-6082
SELECT DISTINCT col0 + - col0 + + col0 + + + 35 DIV + - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
21
27
82

skipif mysql # not compatible
query I rowsort label-6082
SELECT DISTINCT col0 + - col0 + + col0 + + + 35 / + - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
21
27
82

query I rowsort
SELECT + 32 + - + col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col1
----
-47
-6
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL ( - col1 ) - - 12 col2 FROM tab1 cor0 GROUP BY col1
----
-32
-45
6

query I rowsort
SELECT + + col2 * - 37 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1406
-2923
-888

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6086
SELECT ALL - CAST( + MAX( ALL col2 ) AS SIGNED ) FROM tab0 GROUP BY col2, col2, col2
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-6086
SELECT ALL - CAST ( + MAX ( ALL col2 ) AS INTEGER ) FROM tab0 GROUP BY col2, col2, col2
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-6087
SELECT ALL COUNT( * ) * - + col0 + + col0 + col0 * col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0
----
1849
676
6889

skipif mysql # not compatible
query I rowsort label-6087
SELECT ALL COUNT ( * ) * - + col0 + + col0 + col0 * col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6089
SELECT DISTINCT + col2 col1 FROM tab0 GROUP BY col0, col2, col1 HAVING - NULLIF ( 4, 92 + - 24 ) / COUNT( * ) IS NOT NULL
----
24
38
79

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6089
SELECT DISTINCT + col2 col1 FROM tab0 GROUP BY col0, col2, col1 HAVING - NULLIF ( 4, 92 + - 24 ) / COUNT ( * ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING NULL >= AVG ( + 58 )
----

query I rowsort
SELECT - 83 * + ( - col1 ) FROM tab0 GROUP BY col1, col2
----
0
0
6723

onlyif mysql # aggregate syntax: 
query I rowsort label-6092
SELECT DISTINCT + 4 + + col0 * col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING col2 + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6092
SELECT DISTINCT + 4 + + col0 * col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING col2 + COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6093
SELECT ALL - 41 AS col1 FROM tab1 GROUP BY col2 HAVING ( + COUNT( * ) - - COUNT( * ) ) <= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6093
SELECT ALL - 41 AS col1 FROM tab1 GROUP BY col2 HAVING ( + COUNT ( * ) - - COUNT ( * ) ) <= ( NULL )
----

query I rowsort
SELECT ALL 44 FROM tab0 WHERE ( - 16 ) IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL - 54 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( + col0 - 84 * + 21 ) NOT BETWEEN - col0 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6096
SELECT DISTINCT + SUM( col0 ) FROM tab2 GROUP BY col0, col2
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6096
SELECT DISTINCT + SUM ( col0 ) FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT + col1 + col1 AS col2 FROM tab1 GROUP BY col1
----
114
12
88

onlyif mysql # aggregate syntax: 
query I rowsort label-6098
SELECT 57 * COUNT( * ) + - col2 FROM tab2 WHERE ( col0 + - col1 / 36 ) > NULL GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-6098
SELECT 57 * COUNT ( * ) + - col2 FROM tab2 WHERE ( col0 + - col1 / 36 ) > NULL GROUP BY col0, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6099
SELECT 45 * - COUNT( * ) col1 FROM tab1 GROUP BY col2 HAVING NOT ( COUNT( * ) ) BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6099
SELECT 45 * - COUNT ( * ) col1 FROM tab1 GROUP BY col2 HAVING NOT ( COUNT ( * ) ) BETWEEN ( NULL ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6100
SELECT + col0 * 21 FROM tab0 GROUP BY col0, col0 HAVING NULL > COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6100
SELECT + col0 * 21 FROM tab0 GROUP BY col0, col0 HAVING NULL > COUNT ( * )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6101
SELECT ALL - ( - col1 ) DIV + col1 AS col2 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6101
SELECT ALL - ( - col1 ) / + col1 AS col2 FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL - col0 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT 49 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT NULL BETWEEN NULL AND + NULLIF ( + 83, ( - 97 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6104
SELECT COUNT( * ) + 9 FROM tab0 GROUP BY col0 HAVING NOT 55 NOT IN ( AVG ( DISTINCT 29 ) / + 75 )
----

skipif mysql # not compatible
query I rowsort label-6104
SELECT COUNT ( * ) + 9 FROM tab0 GROUP BY col0 HAVING NOT 55 NOT IN ( AVG ( DISTINCT 29 ) / + 75 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6105
SELECT col1 * 90 FROM tab0 WHERE NULL NOT BETWEEN col2 AND 90 GROUP BY col1 HAVING NULL IN ( + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-6105
SELECT col1 * 90 FROM tab0 WHERE NULL NOT BETWEEN col2 AND 90 GROUP BY col1 HAVING NULL IN ( + COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6106
SELECT ALL col1 * col1 - + col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + COUNT( * ) NOT BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6106
SELECT ALL col1 * col1 - + col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + COUNT ( * ) NOT BETWEEN ( NULL ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6107
SELECT + col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING COUNT( * ) <= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6107
SELECT + col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING COUNT ( * ) <= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6108
SELECT ALL SUM( ALL 62 ) col2 FROM tab0 GROUP BY col0
----
62
62
62

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6108
SELECT ALL SUM ( ALL 62 ) col2 FROM tab0 GROUP BY col0
----
62
62
62

query I rowsort
SELECT ALL 95 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT col2 > - 50
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6110
SELECT - COUNT( * ) FROM tab0 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6110
SELECT - COUNT ( * ) FROM tab0 GROUP BY col2, col2
----
-1
-1
-1

query I rowsort
SELECT ALL ( - col0 ) FROM tab0 WHERE + col0 NOT IN ( col0 ) GROUP BY col1, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6112
SELECT + ( + 59 ) + ( + NULLIF ( 79, + ( + COUNT( * ) ) ) ) FROM tab2 GROUP BY col0, col1, col1
----
138
138
138

skipif mysql # not compatible
query I rowsort label-6112
SELECT + ( + 59 ) + ( + NULLIF ( 79, + ( + COUNT ( * ) ) ) ) FROM tab2 GROUP BY col0, col1, col1
----
138
138
138

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 + - 78 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL > col1 - - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 74 col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( + col1 ) < ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT col1 * + col1 NOT BETWEEN NULL AND + col1 * - AVG ( 98 * - col0 )
----

query I rowsort
SELECT ALL + 31 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1333
-2573
-806

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-6118
SELECT DISTINCT MIN( + NULLIF ( col2, 98 ) ) FROM tab2 AS cor0 GROUP BY col1
----
58
79
87

skipif mysql # not compatible
query I rowsort label-6118
SELECT DISTINCT MIN ( + NULLIF ( col2, 98 ) ) FROM tab2 AS cor0 GROUP BY col1
----
58
79
87

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6119
SELECT ALL - MIN( ALL - CAST( - col0 AS SIGNED ) ) - - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6119
SELECT ALL - MIN ( ALL - CAST ( - col0 AS INTEGER ) ) - - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
0
0
0

query I rowsort
SELECT 52 FROM tab1 GROUP BY col2
----
52
52
52

query I rowsort
SELECT - col1 * col1 * - 75 AS col2 FROM tab1 GROUP BY col1
----
145200
243675
2700

query I rowsort
SELECT ALL ( col1 ) * + col1 AS col0 FROM tab2 GROUP BY col1 HAVING ( NULL ) <> - 31
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6123
SELECT DISTINCT + col2 * - - col1 * - COUNT( * ) + + ( - col1 ) * + col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT + 9 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6123
SELECT DISTINCT + col2 * - - col1 * - COUNT ( * ) + + ( - col1 ) * + col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT + 9 IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6125
SELECT col0 FROM tab1 GROUP BY col0, col0 HAVING NOT + COUNT( * ) < + ( + 8 )
----

skipif mysql # not compatible
query I rowsort label-6125
SELECT col0 FROM tab1 GROUP BY col0, col0 HAVING NOT + COUNT ( * ) < + ( + 8 )
----

query I rowsort
SELECT col1 * + - 56 AS col1 FROM tab2 cor0 GROUP BY col1, col0, col1 HAVING NOT NULL IS NOT NULL
----
-2296
-3304
-3416

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING 91 >= 35
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1, col1 + - - col1 * col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT + ( - col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col2 col2, 27 FROM tab0 cor0 GROUP BY col2
----
24
27
38
27
79
27

query I rowsort
SELECT DISTINCT + col1 * + 1 + col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( col1 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6132
SELECT col0 DIV - - 96 + - col0 AS col2 FROM tab2 GROUP BY col0
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-6132
SELECT col0 / - - 96 + - col0 AS col2 FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - 27 * - - 34 + - + col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING - ( 2 ) >= ( - col0 )
----
-1005
-976
-997

onlyif mysql # aggregate syntax: 
query I rowsort label-6134
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 + - COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6134
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 + - COUNT ( * ) IS NULL
----

query I rowsort
SELECT ALL + 96 AS col0 FROM tab0 cor0 GROUP BY col2
----
96
96
96

query I rowsort
SELECT + col2 * - - col2 * + + 55 FROM tab2 AS cor0 GROUP BY col2, col2
----
185020
343255
416295

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6137
SELECT + COUNT( * ) AS col2 FROM tab2 GROUP BY col0 HAVING CAST( NULL AS DECIMAL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6137
SELECT + COUNT ( * ) AS col2 FROM tab2 GROUP BY col0 HAVING CAST ( NULL AS REAL ) IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab0 WHERE - 50 / - 17 + - 83 IS NOT NULL GROUP BY col1, col1, col0 HAVING NOT ( NULL ) NOT IN ( col0 * + col1 )
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6139
SELECT ALL - CAST( - + col2 AS SIGNED ) FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT ( + col0 ) NOT IN ( CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-6139
SELECT ALL - CAST ( - + col2 AS INTEGER ) FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT ( + col0 ) NOT IN ( CAST ( NULL AS REAL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6140
SELECT 3 AS col0 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN col1 + 45 AND + col1 + - CAST( NULL AS SIGNED ) + - 35 / + ( col1 ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-6140
SELECT 3 AS col0 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN col1 + 45 AND + col1 + - CAST ( NULL AS INTEGER ) + - 35 / + ( col1 ) GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6141
SELECT + col2 - - + 39 - + + COALESCE ( 85, - MAX( DISTINCT + NULLIF ( - col1, + col2 ) ) ) * + MAX( 7 ) * + 88 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col2 HAVING NOT ( + ( col2 ) * col2 ) = ( COUNT( * ) )
----
-52234
-52242
-52263

skipif mysql # not compatible
query I rowsort label-6141
SELECT + col2 - - + 39 - + + COALESCE ( 85, - MAX ( DISTINCT + NULLIF ( - col1, + col2 ) ) ) * + MAX ( 7 ) * + 88 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col2 HAVING NOT ( + ( col2 ) * col2 ) = ( COUNT ( * ) )
----
-52234
-52242
-52263

query I rowsort
SELECT - col1 + - + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT 65 IS NULL
----
-118
-122
-82

query II rowsort
SELECT ALL + + 86 + - 99 + col1, + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-7
6
31
44
44
57

query II rowsort
SELECT ALL + 73, - col1 * - 63 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN + ( - col1 ) + + 16 AND NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + 88 NOT BETWEEN - col0 AND - - col2 - + col2
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6146
SELECT ALL col1 * + - COUNT( * ), 32 * col1 AS col2 FROM tab0 GROUP BY col1
----
-81
2592
0
0

skipif mysql # not compatible
query II rowsort label-6146
SELECT ALL col1 * + - COUNT ( * ), 32 * col1 AS col2 FROM tab0 GROUP BY col1
----
-81
2592
0
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6147
SELECT ALL - 89 FROM tab2 GROUP BY col1, col1 HAVING - CAST( NULL AS SIGNED ) * + - 17 + + - COUNT( * ) NOT IN ( + MAX( 44 ) )
----

skipif mysql # not compatible
query I rowsort label-6147
SELECT ALL - 89 FROM tab2 GROUP BY col1, col1 HAVING - CAST ( NULL AS INTEGER ) * + - 17 + + - COUNT ( * ) NOT IN ( + MAX ( 44 ) )
----

query I rowsort
SELECT col2 * col2 + col1 AS col1 FROM tab2 GROUP BY col1, col2
----
3405
6300
7630

onlyif mysql # aggregate syntax: 
query I rowsort label-6149
SELECT DISTINCT + COUNT( - - col0 ) FROM tab2 WHERE NOT - col1 < col1 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN + COUNT( * ) AND - 80 + + col0
----

skipif mysql # not compatible
query I rowsort label-6149
SELECT DISTINCT + COUNT ( - - col0 ) FROM tab2 WHERE NOT - col1 < col1 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN + COUNT ( * ) AND - 80 + + col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6150
SELECT DISTINCT - 46 FROM tab1 WHERE NULL BETWEEN NULL AND - - col2 - + 59 + - col0 / + - ( + 85 ) GROUP BY col0, col2 HAVING NOT col0 BETWEEN NULL AND COALESCE ( MAX( col0 ), - 77 + - col0 / + 81 ) * col2
----

skipif mysql # not compatible
query I rowsort label-6150
SELECT DISTINCT - 46 FROM tab1 WHERE NULL BETWEEN NULL AND - - col2 - + 59 + - col0 / + - ( + 85 ) GROUP BY col0, col2 HAVING NOT col0 BETWEEN NULL AND COALESCE ( MAX ( col0 ), - 77 + - col0 / + 81 ) * col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6151
SELECT DISTINCT - COUNT( * ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-1

skipif mysql # not compatible
query I rowsort label-6151
SELECT DISTINCT - COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-1

query I rowsort
SELECT ALL - 52 * - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
4732
4784
780

onlyif mysql # aggregate syntax: 
query I rowsort label-6153
SELECT DISTINCT + COUNT( * ) * + col0 * + - 44 FROM tab1 GROUP BY col0
----
-1232
-3608
-968

skipif mysql # not compatible
query I rowsort label-6153
SELECT DISTINCT + COUNT ( * ) * + col0 * + - 44 FROM tab1 GROUP BY col0
----
-1232
-3608
-968

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6154
SELECT + - NULLIF ( - CAST( NULL AS SIGNED ), + CAST( 46 AS SIGNED ) + - CAST( + col0 AS DECIMAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6154
SELECT + - NULLIF ( - CAST ( NULL AS INTEGER ), + CAST ( 46 AS INTEGER ) + - CAST ( + col0 AS REAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6155
SELECT DISTINCT + NULLIF ( - - CAST( col2 AS SIGNED ), ( - COUNT( * ) ) ) FROM tab0 cor0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-6155
SELECT DISTINCT + NULLIF ( - - CAST ( col2 AS INTEGER ), ( - COUNT ( * ) ) ) FROM tab0 cor0 GROUP BY col2
----
24
38
79

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6156
SELECT - AVG ( - 38 ) * CAST( NULL AS DECIMAL ) * + COUNT( * ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6156
SELECT - AVG ( - 38 ) * CAST ( NULL AS REAL ) * + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6157
SELECT DISTINCT - + SUM( + col2 ) + - col2 + + 28 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-130
-146
-88

skipif mysql # not compatible
query I rowsort label-6157
SELECT DISTINCT - + SUM ( + col2 ) + - col2 + + 28 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-130
-146
-88

query I rowsort
SELECT DISTINCT + + 4 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
4

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6159
SELECT DISTINCT - CAST( col2 AS SIGNED ) AS col0, - col2 * + - 5 + ( + col2 ) - - col2 - + col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
144
-38
228
-79
474

skipif mysql # not compatible
query II rowsort label-6159
SELECT DISTINCT - CAST ( col2 AS INTEGER ) AS col0, - col2 * + - 5 + ( + col2 ) - - col2 - + col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
144
-38
228
-79
474

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - 0 AS col2 FROM tab2 GROUP BY col0 HAVING - col2 - col0 < NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6161
SELECT ALL 92, COUNT( * ) FROM tab0 GROUP BY col0 HAVING + 14 IS NULL
----

skipif mysql # not compatible
query II rowsort label-6161
SELECT ALL 92, COUNT ( * ) FROM tab0 GROUP BY col0 HAVING + 14 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6162
SELECT DISTINCT COUNT( * ) + + AVG ( ALL 54 ) AS col2, + 72 * + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
55
3168
55
4104
55
432

skipif mysql # not compatible
query II rowsort label-6162
SELECT DISTINCT COUNT ( * ) + + AVG ( ALL 54 ) AS col2, + 72 * + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
55
3168
55
4104
55
432

onlyif mysql # aggregate syntax: 
query I rowsort label-6163
SELECT DISTINCT - 58 + + COUNT( * ) + - 1 + - + COUNT( * ) FROM tab2 AS cor0 GROUP BY col1 HAVING + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6163
SELECT DISTINCT - 58 + + COUNT ( * ) + - 1 + - + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1 HAVING + COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6164
SELECT + COUNT( ALL - col2 ) * - col0 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING - 52 = NULL
----

skipif mysql # not compatible
query I rowsort label-6164
SELECT + COUNT ( ALL - col2 ) * - col0 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING - 52 = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN ( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + 60 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6167
SELECT col1 FROM tab1 GROUP BY col1, col1 HAVING 72 * - + 84 > ( + + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-6167
SELECT col1 FROM tab1 GROUP BY col1, col1 HAVING 72 * - + 84 > ( + + COUNT ( * ) )
----

query I rowsort
SELECT ALL col1 + - 76 FROM tab2 GROUP BY col1, col0 HAVING 95 / + col0 < NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col1, col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT ( NOT ( NOT NULL < NULL ) )
----

query I rowsort
SELECT - - col1 * + ( - 53 ) FROM tab0 AS cor0 WHERE NOT NULL IN ( col2, 85 - + ( col1 ) ) GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6172
SELECT COUNT( * ) FROM tab0 AS cor0 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-6172
SELECT COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1
----
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-6173
SELECT - COUNT( * ) AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6173
SELECT - COUNT ( * ) AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-6174
SELECT ALL + 89 DIV + 72 + 68 FROM tab0 AS cor0 GROUP BY col0
----
69
69
69

skipif mysql # not compatible
query I rowsort label-6174
SELECT ALL + 89 / + 72 + 68 FROM tab0 AS cor0 GROUP BY col0
----
69
69
69

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col0 * col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
10648
21952
551368

onlyif mysql # aggregate syntax: 
query I rowsort label-6176
SELECT ALL + - COUNT( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6176
SELECT ALL + - COUNT ( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

query I rowsort
SELECT 40 AS col1 FROM tab0 AS cor0 WHERE NOT + 91 + - 78 - + col1 IS NULL GROUP BY col2
----
40
40
40

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT col0 * 57 * - col0 FROM tab2 GROUP BY col0
----
-12825
-472017
-482448

query I rowsort
SELECT ( - col1 ) * - 24 AS col0 FROM tab0 GROUP BY col1, col0, col2
----
0
0
1944

onlyif mysql # aggregate syntax: 
query I rowsort label-6181
SELECT - 46 FROM tab2 GROUP BY col1, col0, col0 HAVING NOT - - NULLIF ( - MIN( 80 ), - 64 ) * - 84 * - 85 + - col0 + + ( 39 ) IS NULL
----
-46
-46
-46

skipif mysql # not compatible
query I rowsort label-6181
SELECT - 46 FROM tab2 GROUP BY col1, col0, col0 HAVING NOT - - NULLIF ( - MIN ( 80 ), - 64 ) * - 84 * - 85 + - col0 + + ( 39 ) IS NULL
----
-46
-46
-46

query I rowsort
SELECT + 36 FROM tab1 GROUP BY col1, col0
----
36
36
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 + - - 52 + - + col1 + - col1 + + ( + 79 ) * - - ( + - 33 ) col2 FROM tab2 GROUP BY col1, col1
----
-2596
-2614
-2616

query II rowsort
SELECT - + col1 * + col1, col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-1936
71
-3249
45
-36
8

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT + - col0 AS col1 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN NULL AND + col1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT col0, + 93 FROM tab1 AS cor0 WHERE + 84 IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6189
SELECT + - CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6189
SELECT + - CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT COALESCE ( + 12, col1 + col1 - + col0 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING 92 * - col0 NOT BETWEEN + 30 AND NULL
----
12
12
12

onlyif mysql # aggregate syntax: 
query I rowsort label-6192
SELECT ALL 49 col1 FROM tab1 GROUP BY col0, col1 HAVING COUNT( * ) IS NOT NULL
----
49
49
49

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6192
SELECT ALL 49 col1 FROM tab1 GROUP BY col0, col1 HAVING COUNT ( * ) IS NOT NULL
----
49
49
49

query I rowsort
SELECT ALL + col0 * 4 FROM tab1 WHERE NOT col0 BETWEEN + 24 AND + + col0 GROUP BY col0, col2
----
88

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT - col2 < NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL > - + col0 - 41 + + 14 GROUP BY col1, col0 HAVING NOT + + col0 IS NOT NULL
----

query II rowsort
SELECT - col1 * - 40 AS col2, + 55 FROM tab1 GROUP BY col1
----
1760
55
2280
55
240
55

onlyif mysql # aggregate syntax: 
query I rowsort label-6197
SELECT DISTINCT col0 * - COUNT( * ) + col0 + - 92 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-92

skipif mysql # not compatible
query I rowsort label-6197
SELECT DISTINCT col0 * - COUNT ( * ) + col0 + - 92 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-6198
SELECT - COUNT( * ) + + col0 + col0 FROM tab0 WHERE NOT + col0 + 33 NOT BETWEEN NULL AND NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-6198
SELECT - COUNT ( * ) + + col0 + col0 FROM tab0 WHERE NOT + col0 + 33 NOT BETWEEN NULL AND NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT ( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6200
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-6200
SELECT CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6201
SELECT ALL + COUNT( * ) col0 FROM tab2 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6201
SELECT ALL + COUNT ( * ) col0 FROM tab2 GROUP BY col1, col1
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6202
SELECT + 17 * + + col1 * CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6202
SELECT + 17 * + + col1 * CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6203
SELECT + + AVG ( DISTINCT + + col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = + SUM( ALL + col1 )
----

skipif mysql # not compatible
query I rowsort label-6203
SELECT + + AVG ( DISTINCT + + col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = + SUM ( ALL + col1 )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6204
SELECT DISTINCT - - col1 DIV 40 DIV - col1 DIV + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING col1 IS NOT NULL
----
0

skipif mysql # not compatible
query I rowsort label-6204
SELECT DISTINCT - - col1 / 40 / - col1 / + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING col1 IS NOT NULL
----
0

query I rowsort
SELECT + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL 65 * - ( + + 34 ) AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6207
SELECT DISTINCT - - COUNT( * ) * COUNT( * ) AS col0 FROM tab0 WHERE col2 IS NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6207
SELECT DISTINCT - - COUNT ( * ) * COUNT ( * ) AS col0 FROM tab0 WHERE col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col1 * + 46 FROM tab1 AS cor0 GROUP BY col1
----
-2024
-2622
-276

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6209
SELECT COUNT( * ) DIV - col0 FROM tab0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6209
SELECT COUNT ( * ) / - col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + 63 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6211
SELECT ALL + COUNT( * ) FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6211
SELECT ALL + COUNT ( * ) FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT - 84 * - + col1 FROM tab1 GROUP BY col1, col2
----
3696
4788
504

query I rowsort
SELECT + 71 * col1 * + ( - 46 ) + - 7 FROM tab0 GROUP BY col1, col1
----
-264553
-7

onlyif mysql # DIV for integer division: 
query I rowsort label-6214
SELECT ALL - col2 DIV - 99 AS col0 FROM tab2 AS cor0 WHERE col0 + - 74 IS NOT NULL GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6214
SELECT ALL - col2 / - 99 AS col0 FROM tab2 AS cor0 WHERE col0 + - 74 IS NOT NULL GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * + col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

onlyif mysql # aggregate syntax: 
query II rowsort label-6216
SELECT DISTINCT - + col1, COUNT( * ) AS col0 FROM tab2 WHERE NOT col2 IS NULL GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query II rowsort label-6216
SELECT DISTINCT - + col1, COUNT ( * ) AS col0 FROM tab2 WHERE NOT col2 IS NULL GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6217
SELECT ALL - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6217
SELECT ALL - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT 1 AS col0 FROM tab1 GROUP BY col1 HAVING + AVG ( DISTINCT col1 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6219
SELECT - COUNT( * ) * - col1 * + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

skipif mysql # not compatible
query I rowsort label-6219
SELECT - COUNT ( * ) * - col1 * + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - 8 FROM tab1 GROUP BY col2 HAVING + - 76 IS NOT NULL
----
-8
-8
-8

query I rowsort
SELECT DISTINCT + col0 * col0 * - ( - AVG ( DISTINCT 92 ) ) + - 72 + + NULLIF ( col0, + + col1 + + - col1 + - - 9 ) FROM tab0 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col0, col1 HAVING NULL <= + 33
----

query I rowsort
SELECT NULLIF ( 68, + 37 ) FROM tab1 AS cor0 GROUP BY col1
----
68
68
68

onlyif mysql # aggregate syntax: 
query I rowsort label-6223
SELECT MAX( ALL + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif mysql # not compatible
query I rowsort label-6223
SELECT MAX ( ALL + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + 23 AS col0 FROM tab0 GROUP BY col1
----
23
23

query I rowsort
SELECT + ( + 4 ) FROM tab1 GROUP BY col2
----
4
4
4

onlyif mysql # aggregate syntax: 
query I rowsort label-6226
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + COUNT( * ) - + - COUNT( * ) NOT IN ( + col2, + col2 )
----

skipif mysql # not compatible
query I rowsort label-6226
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + COUNT ( * ) - + - COUNT ( * ) NOT IN ( + col2, + col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6227
SELECT ALL - + COUNT( * ) * ( + col0 ) / + - col0 - + + col0 / + col0 FROM tab1 WHERE NOT NULL < NULL GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND ( - COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-6227
SELECT ALL - + COUNT ( * ) * ( + col0 ) / + - col0 - + + col0 / + col0 FROM tab1 WHERE NOT NULL < NULL GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND ( - COUNT ( * ) )
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6228
SELECT col2 * 70 * - CAST( NULL AS DECIMAL ) * col0 - + COUNT( - - col0 ) + col0 * - 72 / + 7 + - + ( - + 54 ) + col0 FROM tab1 GROUP BY col2, col0 HAVING + - COUNT( * ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6228
SELECT col2 * 70 * - CAST ( NULL AS REAL ) * col0 - + COUNT ( - - col0 ) + col0 * - 72 / + 7 + - + ( - + 54 ) + col0 FROM tab1 GROUP BY col2, col0 HAVING + - COUNT ( * ) IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - + 54 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-54
-54
-54

onlyif mysql # aggregate syntax: 
query I rowsort label-6230
SELECT - ( - MIN( ALL col1 ) ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + + COUNT( * ) + 81 IS NULL
----
0
81

skipif mysql # not compatible
query I rowsort label-6230
SELECT - ( - MIN ( ALL col1 ) ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + + COUNT ( * ) + 81 IS NULL
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-6231
SELECT col1 - - ( col1 ) DIV col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6231
SELECT col1 - - ( col1 ) / col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + ( 33 ) col0, + col1 FROM tab0 GROUP BY col1 HAVING col1 <> NULL
----

query I rowsort
SELECT ALL + col1 * - - col1 FROM tab0 GROUP BY col1
----
0
6561

onlyif mysql # aggregate syntax: 
query I rowsort label-6234
SELECT COUNT( * ) + NULLIF ( - COUNT( * ), - + col2 + + 60 ) FROM tab0 cor0 GROUP BY col2, col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6234
SELECT COUNT ( * ) + NULLIF ( - COUNT ( * ), - + col2 + + 60 ) FROM tab0 cor0 GROUP BY col2, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 95 + + - col1 + + - col1 col1 FROM tab2 cor0 WHERE NOT NULL BETWEEN ( NULL ) AND NULL GROUP BY col1
----

query I rowsort
SELECT - col2 * col2 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2 HAVING NOT + 25 + col2 IS NOT NULL
----

query I rowsort
SELECT 38 FROM tab1 GROUP BY col0
----
38
38
38

query I rowsort
SELECT col0 + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
182
184
30

onlyif mysql # aggregate syntax: 
query I rowsort label-6239
SELECT + col1 * - ( + ( - COUNT( * ) ) ) col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6239
SELECT + col1 * - ( + ( - COUNT ( * ) ) ) col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6240
SELECT + - 84 FROM tab0 cor0 WHERE ( - - CAST( - 68 AS SIGNED ) ) / 83 / + - 95 + + 46 * COALESCE ( - col1, - 35 ) IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-84
-84
-84

skipif mysql # not compatible
query I rowsort label-6240
SELECT + - 84 FROM tab0 cor0 WHERE ( - - CAST ( - 68 AS INTEGER ) ) / 83 / + - 95 + + 46 * COALESCE ( - col1, - 35 ) IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-84
-84
-84

query II rowsort
SELECT ALL - col0, - col0 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT - ( 36 ) - - col2 AS col2 FROM tab2 GROUP BY col0, col2
----
22
43
51

query I rowsort
SELECT + ( col0 ) FROM tab2 GROUP BY col0, col2, col0 HAVING - col2 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - ( col1 ) FROM tab1 GROUP BY col1, col2, col1
----
-44
-57
-6

query I rowsort
SELECT col1 * 11 AS col2 FROM tab1 GROUP BY col1, col1
----
484
627
66

onlyif mysql # aggregate syntax: 
query I rowsort label-6246
SELECT DISTINCT + COUNT( * ) FROM tab2 GROUP BY col0, col1 HAVING + ( + 19 ) = NULL
----

skipif mysql # not compatible
query I rowsort label-6246
SELECT DISTINCT + COUNT ( * ) FROM tab2 GROUP BY col0, col1 HAVING + ( + 19 ) = NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6247
SELECT + - MIN( + col2 ) col0, COUNT( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
1
-71
1
-8
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6247
SELECT + - MIN ( + col2 ) col0, COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
1
-71
1
-8
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 + - col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT + + ( + col0 ) FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6250
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6250
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1
----
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6251
SELECT + SUM( + NULLIF ( + col1, col1 * + CAST( + - ( 47 ) AS SIGNED ) - - NULLIF ( + 50, + 38 + - 17 ) ) ) + - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6251
SELECT + SUM ( + NULLIF ( + col1, col1 * + CAST ( + - ( 47 ) AS INTEGER ) - - NULLIF ( + 50, + 38 + - 17 ) ) ) + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 82 FROM tab0 AS cor0 GROUP BY col2 HAVING + col2 + col2 > NULL
----

query I rowsort
SELECT ALL 39 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ( + col2 ) * col2 * 30 - + col2 * - 4 + - col2 FROM tab0 GROUP BY col2
----
17352
187467
43434

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( 67, ( + - col0 ) ) FROM tab0 AS cor0 GROUP BY col2
----
-67

query I rowsort
SELECT ALL + col2 * + col2 + + col2 * + 19 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
4466
7742
9222

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6257
SELECT ALL + 83 * - + col2 col0 FROM tab0 WHERE NOT NULL BETWEEN NULL AND ( - - CASE col2 WHEN + - col1 THEN NULL ELSE + CAST( - ( + 73 ) AS SIGNED ) END ) GROUP BY col2 HAVING NOT + - 90 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6257
SELECT ALL + 83 * - + col2 col0 FROM tab0 WHERE NOT NULL BETWEEN NULL AND ( - - CASE col2 WHEN + - col1 THEN NULL ELSE + CAST ( - ( + 73 ) AS INTEGER ) END ) GROUP BY col2 HAVING NOT + - 90 IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6258
SELECT - + 60 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING CAST( - MIN( + col2 ) AS SIGNED ) <> col1
----
-60
-60

skipif mysql # not compatible
query I rowsort label-6258
SELECT - + 60 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING CAST ( - MIN ( + col2 ) AS INTEGER ) <> col1
----
-60
-60

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6259
SELECT CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6259
SELECT CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6260
SELECT DISTINCT + CAST( + + 22 AS SIGNED ), - col1 AS col2 FROM tab0 GROUP BY col1
----
22
-81
22
0

skipif mysql # not compatible
query II rowsort label-6260
SELECT DISTINCT + CAST ( + + 22 AS INTEGER ), - col1 AS col2 FROM tab0 GROUP BY col1
----
22
-81
22
0

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col2, col1
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-6262
SELECT DISTINCT 8 + + - COUNT( * ) * + + 62 FROM tab0 GROUP BY col1
----
-116
-54

skipif mysql # not compatible
query I rowsort label-6262
SELECT DISTINCT 8 + + - COUNT ( * ) * + + 62 FROM tab0 GROUP BY col1
----
-116
-54

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6263
SELECT ALL - col1 * - + col2 * col1 * - COUNT( * ) * - 62 FROM tab1 WHERE NOT + CAST( NULL AS SIGNED ) IS NULL GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-6263
SELECT ALL - col1 * - + col2 * col1 * - COUNT ( * ) * - 62 FROM tab1 WHERE NOT + CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2, col1
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6264
SELECT MAX( ALL - ( - col0 ) ) + - MAX( 8 ) * - COUNT( * ) + + col0 - COUNT( * ), - 23 FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) >= NULL
----

skipif mysql # not compatible
query II rowsort label-6264
SELECT MAX ( ALL - ( - col0 ) ) + - MAX ( 8 ) * - COUNT ( * ) + + col0 - COUNT ( * ), - 23 FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col1, col2 HAVING NULL < + col2 * - + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + 33 col0 FROM tab2 AS cor0 GROUP BY col2
----
33
33
33

query I rowsort
SELECT DISTINCT ( + 20 ) AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 * 70 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-1680
-2660
-5530

query I rowsort
SELECT 73 FROM tab1 AS cor0 GROUP BY col0
----
73
73
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6270
SELECT + CAST( NULL AS SIGNED ) + + ( + col0 ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6270
SELECT + CAST ( NULL AS INTEGER ) + + ( + col0 ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT - + col1 + + + col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6480

query I rowsort
SELECT DISTINCT + 98 AS col1 FROM tab1 GROUP BY col2, col2, col1
----
98

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
-15
-91
-92

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6275
SELECT DISTINCT - ( + CAST( NULL AS DECIMAL ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-6275
SELECT DISTINCT - ( + CAST ( NULL AS REAL ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
NULL

query I rowsort
SELECT + + col0 - - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col1
----
166
52
86

onlyif mysql # aggregate syntax: 
query III rowsort label-6277
SELECT 91 AS col0, + 47 + - + COUNT( * ) * + + 43, col0 FROM tab1 GROUP BY col0, col1
----
9 values hashing to 60502d17c42e20c97eca013fa1a331aa

skipif mysql # not compatible
query III rowsort label-6277
SELECT 91 AS col0, + 47 + - + COUNT ( * ) * + + 43, col0 FROM tab1 GROUP BY col0, col1
----
9 values hashing to 60502d17c42e20c97eca013fa1a331aa

query I rowsort
SELECT ALL - col0 - + col0 AS col0 FROM tab0 WHERE NOT 7 IS NOT NULL GROUP BY col0, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL 34 FROM tab0 GROUP BY col0
----
34
34
34

query II rowsort
SELECT ALL col0, + ( - 20 ) FROM tab2 GROUP BY col0, col0 HAVING + 87 IS NOT NULL
----
15
-20
91
-20
92
-20

query II rowsort
SELECT DISTINCT - col1 AS col0, - 82 / + 30 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 + - col1 * + - 90 AS col1 FROM tab1 GROUP BY col1
----
4004
5187
546

query I rowsort
SELECT DISTINCT 37 AS col0 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 * + 22 * - col2 * + col2 FROM tab2 GROUP BY col2
----
10846858
14487066
4292464

query II rowsort
SELECT - 54 AS col0, - col2 - - + col2 FROM tab0 GROUP BY col2
----
-54
0
-54
0
-54
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6286
SELECT + MIN( - NULLIF ( - CAST( NULL AS SIGNED ), + col0 ) ) + ( 66 ) + 62 + col2 / + col2 * + 58 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6286
SELECT + MIN ( - NULLIF ( - CAST ( NULL AS INTEGER ), + col0 ) ) + ( 66 ) + 62 + col2 / + col2 * + 58 FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT col1 * 37 FROM tab0 GROUP BY col1
----
0
2997

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6288
SELECT CAST( NULL AS SIGNED ) * + col2 + + MIN( ALL - col2 ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6288
SELECT CAST ( NULL AS INTEGER ) * + col2 + + MIN ( ALL - col2 ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT NULLIF ( - 82, - col2 ) FROM tab1 GROUP BY col2, col0
----
-82

query II rowsort
SELECT ALL - col0, 2 + - 30 AS col0 FROM tab1 GROUP BY col2, col0
----
-22
-28
-28
-28
-82
-28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 GROUP BY col2, col0, col0
----
-45
-71
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6292
SELECT ( - CAST( NULL AS SIGNED ) ) + + + col1 FROM tab0 WHERE - + col0 IS NULL GROUP BY col1, col2 HAVING - 96 * + 64 + + 60 * - 90 <> 7
----

skipif mysql # not compatible
query I rowsort label-6292
SELECT ( - CAST ( NULL AS INTEGER ) ) + + + col1 FROM tab0 WHERE - + col0 IS NULL GROUP BY col1, col2 HAVING - 96 * + 64 + + 60 * - 90 <> 7
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6293
SELECT ALL + - ( - + MAX( DISTINCT col2 ) ), ( + COALESCE ( 15, - + 78 ) ) * - col2 * + + 74 AS col1 FROM tab1 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2
----
45
-49950
71
-78810
8
-8880

skipif mysql # not compatible
query II rowsort label-6293
SELECT ALL + - ( - + MAX ( DISTINCT col2 ) ), ( + COALESCE ( 15, - + 78 ) ) * - col2 * + + 74 AS col1 FROM tab1 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2
----
45
-49950
71
-78810
8
-8880

onlyif mysql # aggregate syntax: 
query II rowsort label-6294
SELECT + col1 * + col1, - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 + COUNT( * ) > NULL
----

skipif mysql # not compatible
query II rowsort label-6294
SELECT + col1 * + col1, - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 + COUNT ( * ) > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6295
SELECT COUNT( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6295
SELECT COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6296
SELECT col2 * - col2 * - + CAST( - - 33 AS SIGNED ) FROM tab0 GROUP BY col0, col2 HAVING col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6296
SELECT col2 * - col2 * - + CAST ( - - 33 AS INTEGER ) FROM tab0 GROUP BY col0, col2 HAVING col0 IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6297
SELECT DISTINCT col1 * - CAST( - + 40 AS SIGNED ) * - - col1 FROM tab2 GROUP BY col1 HAVING NOT ( 34 + + + SUM( DISTINCT ( - 52 ) ) = - - CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-6297
SELECT DISTINCT col1 * - CAST ( - + 40 AS INTEGER ) * - - col1 FROM tab2 GROUP BY col1 HAVING NOT ( 34 + + + SUM ( DISTINCT ( - 52 ) ) = - - CAST ( NULL AS REAL ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6298
SELECT DISTINCT + col1 - col1 + 78 DIV - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-6298
SELECT DISTINCT + col1 - col1 + 78 / - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1

query I rowsort
SELECT + col2 - - col2 + 4 * col2 FROM tab0 AS cor0 WHERE NOT - col2 <> NULL GROUP BY col0, col2, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6300
SELECT MIN( + - 5 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-5
-5
-5

skipif mysql # not compatible
query I rowsort label-6300
SELECT MIN ( + - 5 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-5
-5
-5

query II rowsort
SELECT col0 AS col0, col0 AS col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT - ( - - col0 ) * - ( + 7 ) * - - 71 - + - col0 + 21 FROM tab0 GROUP BY col0
----
12969
21435
41355

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6303
SELECT + AVG ( DISTINCT - 97 ) / - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6303
SELECT + AVG ( DISTINCT - 97 ) / - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT 48 + + + 49 AS col2, 16 - + ( col0 ) AS col0 FROM tab0 AS cor0 GROUP BY col0
----
97
-10
97
-27
97
-67

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 WHERE NOT NULL = NULL GROUP BY col1
----

query I rowsort
SELECT - + 97 AS col0 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND ( + col0 ) GROUP BY col0, col2 HAVING NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 97 col0 FROM tab0 AS cor0 GROUP BY col2
----
97
97
97

query I rowsort
SELECT 73 * + - 8 + - col2 * + col2 FROM tab2 GROUP BY col2, col2
----
-3948
-6825
-8153

query I rowsort
SELECT ALL col2 + - col2 AS col2 FROM tab2 WHERE NULL BETWEEN NULL AND ( NULL ) GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6310
SELECT ALL 80 / - col1 * + + col1 * col0 * + col1 + + MIN( DISTINCT - col1 ) FROM tab0 WHERE - + 49 BETWEEN NULL AND + col1 GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-6310
SELECT ALL 80 / - col1 * + + col1 * col0 * + col1 + + MIN ( DISTINCT - col1 ) FROM tab0 WHERE - + 49 BETWEEN NULL AND + col1 GROUP BY col0, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6311
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL >= COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6311
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL >= COUNT ( * )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6312
SELECT - col1 * - - col1 + + col0 * 75 * + COUNT( * ) / - 88 * - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING - COUNT( * ) BETWEEN + NULLIF ( 31, + 83 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6312
SELECT - col1 * - - col1 + + col0 * 75 * + COUNT ( * ) / - 88 * - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING - COUNT ( * ) BETWEEN + NULLIF ( 31, + 83 ) AND NULL
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ( - col0 ) + - 8 FROM tab1 GROUP BY col2, col0
----
-30
-36
-90

query I rowsort
SELECT + - NULLIF ( - - 91, - + col2 ) FROM tab1 AS cor0 GROUP BY col1, col2
----
-91
-91
-91

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6316
SELECT + 47 + - + col2 + col2 + + 71 DIV - + col2 + - + MIN( ALL - col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
103
45
90

skipif mysql # not compatible
query I rowsort label-6316
SELECT + 47 + - + col2 + col2 + + 71 / - + col2 + - + MIN ( ALL - col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
103
45
90

query II rowsort
SELECT col0, 92 FROM tab2 cor0 GROUP BY col0, col0
----
15
92
91
92
92
92

query I rowsort
SELECT DISTINCT + col1 * - col2 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
-2565
-3124
-48

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL col0 - 60 + - 49 FROM tab2 GROUP BY col0, col2
----
-17
-18
-94

query I rowsort
SELECT + col1 - - + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + col1 * + - col1 IS NULL
----
0
162

query I rowsort
SELECT ALL 44 FROM tab0 GROUP BY col2
----
44
44
44

onlyif mysql # aggregate syntax: 
query I rowsort label-6323
SELECT + COUNT( ALL + col2 ) + + col2 col0 FROM tab1 cor0 GROUP BY col2
----
46
72
9

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6323
SELECT + COUNT ( ALL + col2 ) + + col2 col0 FROM tab1 cor0 GROUP BY col2
----
46
72
9

query I rowsort
SELECT + col0 / - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6325
SELECT COUNT( * ) col2, + 50 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
1
50
2
50

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6325
SELECT COUNT ( * ) col2, + 50 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
1
50
2
50

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6326
SELECT col0 * + 48 * + col0 * + CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6326
SELECT col0 * + 48 * + col0 * + CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6327
SELECT + + COUNT( * ) * + 88 + + + col1 + - COUNT( * ) * + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 80 * + - col1 IS NULL
----
129
147
149

skipif mysql # not compatible
query I rowsort label-6327
SELECT + + COUNT ( * ) * + 88 + + + col1 + - COUNT ( * ) * + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 80 * + - col1 IS NULL
----
129
147
149

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT 93 col2, 28 + col1 * - 85 AS col0, col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6329
SELECT DISTINCT + COUNT( * ) * - + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND COUNT( * ) * - COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6329
SELECT DISTINCT + COUNT ( * ) * - + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND COUNT ( * ) * - COUNT ( * )
----

query I rowsort
SELECT + col0 * - col0 + - col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-506
-6806
-812

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-6332
SELECT + COUNT( * ) FROM tab2 cor0 GROUP BY col1, col0 HAVING - 25 * + COUNT( * ) < NULL
----

skipif mysql # not compatible
query I rowsort label-6332
SELECT + COUNT ( * ) FROM tab2 cor0 GROUP BY col1, col0 HAVING - 25 * + COUNT ( * ) < NULL
----

query I rowsort
SELECT 92 FROM tab0 GROUP BY col1, col2, col0 HAVING NOT + - col2 * - - col2 * + + 40 + + col0 <= NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6334
SELECT + CAST( NULL AS SIGNED ) - - MIN( ALL + - 95 ) / 59 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6334
SELECT + CAST ( NULL AS INTEGER ) - - MIN ( ALL + - 95 ) / 59 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query II rowsort label-6335
SELECT + 53 * - 12, - ( - + 27 ) * - MAX( ALL col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-6335
SELECT + 53 * - 12, - ( - + 27 ) * - MAX ( ALL col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6336
SELECT + col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING - 67 >= + 53 * MIN( DISTINCT - - 23 )
----

skipif mysql # not compatible
query I rowsort label-6336
SELECT + col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING - 67 >= + 53 * MIN ( DISTINCT - - 23 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6337
SELECT DISTINCT - col2 - MIN( ALL - col2 ) + + col2 * ( + + 33 ) + + 17 * - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-585
1254
2607

skipif mysql # not compatible
query I rowsort label-6337
SELECT DISTINCT - col2 - MIN ( ALL - col2 ) + + col2 * ( + + 33 ) + + 17 * - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-585
1254
2607

query I rowsort
SELECT DISTINCT 39 * - col1 + - 46 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-1762
-2269
-280

onlyif mysql # DIV for integer division: 
query I rowsort label-6339
SELECT DISTINCT - + col0 DIV 87 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-6339
SELECT DISTINCT - + col0 / 87 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col0 + + - col0 FROM tab0 cor0 GROUP BY col0
----
-166
-52
-86

onlyif mysql # aggregate syntax: 
query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT( * ) AND - 7
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT ( * ) AND - 7
----

query II rowsort
SELECT ALL + col2 AS col0, col2 AS col0 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col0 + + 42 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * - 84 FROM tab0 GROUP BY col0
----
-2184
-3612
-6972

query I rowsort
SELECT + ( + 93 ) AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
93
93
93

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6346
SELECT DISTINCT - col2 AS col1, + SUM( + col2 ) DIV 79 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
0
-79
1
-87
1

skipif mysql # not compatible
query II rowsort label-6346
SELECT DISTINCT - col2 AS col1, + SUM ( + col2 ) / 79 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
0
-79
1
-87
1

query I rowsort
SELECT DISTINCT + 43 FROM tab1 GROUP BY col2
----
43

onlyif mysql # aggregate syntax: 
query I rowsort label-6348
SELECT ALL + NULLIF ( ( 91 ), 67 + - COUNT( * ) ) FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
91
91
91

skipif mysql # not compatible
query I rowsort label-6348
SELECT ALL + NULLIF ( ( 91 ), 67 + - COUNT ( * ) ) FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
91
91
91

query I rowsort
SELECT col0 + + 32 FROM tab1 GROUP BY col0
----
114
54
60

onlyif mysql # aggregate syntax: 
query I rowsort label-6350
SELECT ALL + MIN( col2 ) - - col2 FROM tab2 GROUP BY col2 HAVING NOT + COALESCE ( 3, - ( ( - col2 ) ) ) = col2 / COUNT( * )
----
116
158
174

skipif mysql # not compatible
query I rowsort label-6350
SELECT ALL + MIN ( col2 ) - - col2 FROM tab2 GROUP BY col2 HAVING NOT + COALESCE ( 3, - ( ( - col2 ) ) ) = col2 / COUNT ( * )
----
116
158
174

onlyif mysql # aggregate syntax: 
query I rowsort label-6351
SELECT ALL 40 * COUNT( DISTINCT - 67 ) AS col2 FROM tab1 GROUP BY col0
----
40
40
40

skipif mysql # not compatible
query I rowsort label-6351
SELECT ALL 40 * COUNT ( DISTINCT - 67 ) AS col2 FROM tab1 GROUP BY col0
----
40
40
40

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NULL >= NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6353
SELECT COUNT( + ( - col0 ) ) DIV 53 col1 FROM tab0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6353
SELECT COUNT ( + ( - col0 ) ) / 53 col1 FROM tab0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 + + 28 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT col2 >= NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6355
SELECT + MAX( ALL + NULLIF ( + COALESCE ( - CAST( col1 AS SIGNED ), 0 ), col2 ) ) DIV 37 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6355
SELECT + MAX ( ALL + NULLIF ( + COALESCE ( - CAST ( col1 AS INTEGER ), 0 ), col2 ) ) / 37 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 GROUP BY col0, col2, col1, col1 HAVING NULL <> 10
----

query I rowsort
SELECT DISTINCT 2 FROM tab1 GROUP BY col0, col1
----
2

query I rowsort
SELECT DISTINCT + 97 FROM tab2 GROUP BY col2 HAVING NOT ( + 0 ) IS NULL
----
97

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( ( 36 ), col0 + + col1, - col0 + + col0 ) * col0 AS col0 FROM tab1 GROUP BY col0, col2
----
1008
2952
792

query I rowsort
SELECT 78 AS col1 FROM tab1 GROUP BY col2 HAVING + 59 * - 62 <> NULL
----

query I rowsort
SELECT ALL + col0 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT + 83 FROM tab1 AS cor0 GROUP BY col2
----
83
83
83

onlyif mysql # aggregate syntax: 
query I rowsort label-6363
SELECT DISTINCT - 93 col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT + col1 NOT IN ( + COUNT( * ) * col1 )
----
-93

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6363
SELECT DISTINCT - 93 col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT + col1 NOT IN ( + COUNT ( * ) * col1 )
----
-93

query I rowsort
SELECT DISTINCT col1 * 76 FROM tab2 AS cor0 GROUP BY col1, col1
----
3116
4484
4636

query I rowsort
SELECT ALL 9 FROM tab2 AS cor0 GROUP BY col1, col1
----
9
9
9

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6366
SELECT DISTINCT ( - CAST( CAST( NULL AS SIGNED ) AS SIGNED ) ) + col1 * COUNT( * ) FROM tab0 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-6366
SELECT DISTINCT ( - CAST ( CAST ( NULL AS INTEGER ) AS INTEGER ) ) + col1 * COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6367
SELECT ( + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING col1 NOT BETWEEN NULL AND MAX( 89 )
----

skipif mysql # not compatible
query I rowsort label-6367
SELECT ( + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING col1 NOT BETWEEN NULL AND MAX ( 89 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6368
SELECT DISTINCT COUNT( * ) AS col2 FROM tab0 WHERE NOT + col0 IS NULL GROUP BY col1 HAVING ( - col1 + COUNT( * ) ) <> ( + 82 )
----
1
2

skipif mysql # not compatible
query I rowsort label-6368
SELECT DISTINCT COUNT ( * ) AS col2 FROM tab0 WHERE NOT + col0 IS NULL GROUP BY col1 HAVING ( - col1 + COUNT ( * ) ) <> ( + 82 )
----
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-6369
SELECT ALL + col0 * + col0 + 32 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( + COALESCE ( + col0, - COUNT( * ) * 86 ) ) BETWEEN - 46 AND NULL
----

skipif mysql # not compatible
query I rowsort label-6369
SELECT ALL + col0 * + col0 + 32 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( + COALESCE ( + col0, - COUNT ( * ) * 86 ) ) BETWEEN - 46 AND NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-6371
SELECT MAX( ( 64 ) ) FROM tab1 AS cor0 WHERE NOT NULL <= col1 * col2 GROUP BY col1, col0
----

skipif mysql # not compatible
query I rowsort label-6371
SELECT MAX ( ( 64 ) ) FROM tab1 AS cor0 WHERE NOT NULL <= col1 * col2 GROUP BY col1, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6372
SELECT - + ( 29 ) + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - 50 > + COUNT( col2 )
----
-110
-29

skipif mysql # not compatible
query I rowsort label-6372
SELECT - + ( 29 ) + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - 50 > + COUNT ( col2 )
----
-110
-29

query I rowsort
SELECT + col2 * col2 AS col0 FROM tab0 WHERE NOT NULL = col2 / - 49 GROUP BY col2 HAVING ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6374
SELECT DISTINCT - col1 DIV 80 FROM tab2 GROUP BY col1 HAVING ( + 73 * 4 ) IS NOT NULL
----
0

skipif mysql # not compatible
query I rowsort label-6374
SELECT DISTINCT - col1 / 80 FROM tab2 GROUP BY col1 HAVING ( + 73 * 4 ) IS NOT NULL
----
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6375
SELECT + 29 AS col1 FROM tab1 GROUP BY col1 HAVING + ( 12 ) - 2 * + 97 BETWEEN COUNT( - 80 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6375
SELECT + 29 AS col1 FROM tab1 GROUP BY col1 HAVING + ( 12 ) - 2 * + 97 BETWEEN COUNT ( - 80 ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT( * ) + ( col0 ) * 12 ) ), + COUNT( * ), COUNT( * ) / 97 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT ( * ) + ( col0 ) * 12 ) ), + COUNT ( * ), COUNT ( * ) / 97 ) )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST( NULL AS DECIMAL ) AND ( - col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST ( NULL AS REAL ) AND ( - col1 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6378
SELECT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST( NULL AS SIGNED ) NOT IN ( - 58 )
----

skipif mysql # not compatible
query I rowsort label-6378
SELECT + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST ( NULL AS INTEGER ) NOT IN ( - 58 )
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( AVG ( DISTINCT + col0 ) ) = ( + 46 )
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-6380
SELECT ALL AVG ( ALL + + ( 7 ) ) * + COUNT( - 54 ) - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col0 HAVING NULL > col1
----

skipif mysql # not compatible
query I rowsort label-6380
SELECT ALL AVG ( ALL + + ( 7 ) ) * + COUNT ( - 54 ) - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col0 HAVING NULL > col1
----

query II rowsort
SELECT ALL + 92 AS col2, - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
92
-58
92
-79
92
-87

query I rowsort
SELECT - + col1 + - 12 FROM tab1 AS cor0 GROUP BY col1
----
-18
-56
-69

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-6383
SELECT ALL + CAST( NULL AS SIGNED ), SUM( ALL - col1 ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) >= ( - ( 81 ) ) * col2
----

skipif mysql # not compatible
query II rowsort label-6383
SELECT ALL + CAST ( NULL AS INTEGER ), SUM ( ALL - col1 ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) >= ( - ( 81 ) ) * col2
----

query II rowsort
SELECT DISTINCT + 23 AS col2, 77 FROM tab0 AS cor0 GROUP BY col2
----
23
77

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6385
SELECT DISTINCT + 60 * - + 13 * 88 * CAST( NULL AS SIGNED ) + ( col2 ) AS col2 FROM tab0 GROUP BY col2, col2 HAVING NOT ( + col2 * MIN( ALL + col2 * + 35 ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6385
SELECT DISTINCT + 60 * - + 13 * 88 * CAST ( NULL AS INTEGER ) + ( col2 ) AS col2 FROM tab0 GROUP BY col2, col2 HAVING NOT ( + col2 * MIN ( ALL + col2 * + 35 ) ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6386
SELECT ALL ( + + col0 ), COUNT( * ) * - ( col0 ) FROM tab0 GROUP BY col0 HAVING col0 + + col0 / + NULLIF ( + 41, 61 * + COUNT( * ) ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-6386
SELECT ALL ( + + col0 ), COUNT ( * ) * - ( col0 ) FROM tab0 GROUP BY col0 HAVING col0 + + col0 / + NULLIF ( + 41, 61 * + COUNT ( * ) ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6387
SELECT COUNT( * ) col1 FROM tab1 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6387
SELECT COUNT ( * ) col1 FROM tab1 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT - col1 + - + col1 FROM tab1 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT col0 * ( - col2 ) + + col2 * 48 FROM tab2 GROUP BY col0, col2 HAVING + 39 BETWEEN + 15 / 5 AND - 52 + col2 / 82
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6390
SELECT ALL + COUNT( * ) AS col1 FROM tab1 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6390
SELECT ALL + COUNT ( * ) AS col1 FROM tab1 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL + 99 * - 39 AS col2 FROM tab2 GROUP BY col2, col1
----
-3861
-3861
-3861

query I rowsort
SELECT - + col1 AS col2 FROM tab1 WHERE 80 IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + 65 * - + col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-3770
-5135
-5655

query I rowsort
SELECT 58 AS col2 FROM tab2 GROUP BY col2, col0, col2
----
58
58
58

onlyif mysql # aggregate syntax: 
query I rowsort label-6395
SELECT + COALESCE ( - - col2, + COUNT( ALL - 93 ) ) * + col2 + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col0 + - col0 * 43 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6395
SELECT + COALESCE ( - - col2, + COUNT ( ALL - 93 ) ) * + col2 + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col0 + - col0 * 43 IS NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6396
SELECT ALL - col2 DIV - 81 - - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING COUNT( * ) IS NOT NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-6396
SELECT ALL - col2 / - 81 - - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING COUNT ( * ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL + 76 FROM tab0 AS cor0 GROUP BY col0, col0
----
76
76
76

query I rowsort
SELECT DISTINCT + col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

onlyif mysql # aggregate syntax: 
query I rowsort label-6399
SELECT + NULLIF ( + col2, + - COUNT( * ) ) AS col1 FROM tab2 GROUP BY col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-6399
SELECT + NULLIF ( + col2, + - COUNT ( * ) ) AS col1 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT - 97 FROM tab1 GROUP BY col2 HAVING - + col2 IN ( + col2 )
----

query I rowsort
SELECT ALL - col0 * + col0 AS col2 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - 77 - 64 AS col0 FROM tab1 AS cor0 WHERE NOT + col1 * - - ( - + col0 ) NOT BETWEEN NULL AND + + col2 GROUP BY col1, col0 HAVING NOT ( + col1 * - ( col0 ) + - col0 ) NOT IN ( + 43 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6403
SELECT ALL COUNT( ALL col1 ) FROM tab1 GROUP BY col1 HAVING NOT COUNT( * ) * - - ( - MAX( ALL col0 ) ) IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6403
SELECT ALL COUNT ( ALL col1 ) FROM tab1 GROUP BY col1 HAVING NOT COUNT ( * ) * - - ( - MAX ( ALL col0 ) ) IS NULL
----
1
1
1

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT - - 22 <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6405
SELECT ALL + 9 AS col1 FROM tab0 WHERE - - col2 > - ( 72 ) GROUP BY col0 HAVING NOT NULL BETWEEN COALESCE ( + COUNT( * ), + col0 * - col0 ) AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6405
SELECT ALL + 9 AS col1 FROM tab0 WHERE - - col2 > - ( 72 ) GROUP BY col0 HAVING NOT NULL BETWEEN COALESCE ( + COUNT ( * ), + col0 * - col0 ) AND ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6406
SELECT - 19 + - COUNT( * ) + + 13 + + COALESCE ( NULLIF ( COUNT( * ), col1 ), + col1 ) * col1 FROM tab0 WHERE NOT - col1 IS NOT NULL GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-6406
SELECT - 19 + - COUNT ( * ) + + 13 + + COALESCE ( NULLIF ( COUNT ( * ), col1 ), + col1 ) * col1 FROM tab0 WHERE NOT - col1 IS NOT NULL GROUP BY col1, col1
----

query II rowsort
SELECT 3, - col0 AS col0 FROM tab2 GROUP BY col0, col0
----
3
-15
3
-91
3
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-6408
SELECT 71 AS col2 FROM tab2 GROUP BY col2, col1, col2 HAVING NOT NULL NOT IN ( + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-6408
SELECT 71 AS col2 FROM tab2 GROUP BY col2, col1, col2 HAVING NOT NULL NOT IN ( + COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6409
SELECT + 36 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( + 9 ) GROUP BY col2, col2, col0 HAVING NULL < + ( + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-6409
SELECT + 36 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( + 9 ) GROUP BY col2, col2, col0 HAVING NULL < + ( + COUNT ( * ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6410
SELECT CAST( NULL AS SIGNED ) + + 26 - + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6410
SELECT CAST ( NULL AS INTEGER ) + + 26 - + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6411
SELECT ALL - COUNT( ALL - NULLIF ( + col1, NULLIF ( ( NULLIF ( - ( col1 ), + ( 5 ) ) ), col2 ) * col1 ) ) * col2 AS col1 FROM tab1 AS cor0 WHERE col0 IS NULL GROUP BY col0, col2 HAVING + col0 + - col2 * col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6411
SELECT ALL - COUNT ( ALL - NULLIF ( + col1, NULLIF ( ( NULLIF ( - ( col1 ), + ( 5 ) ) ), col2 ) * col1 ) ) * col2 AS col1 FROM tab1 AS cor0 WHERE col0 IS NULL GROUP BY col0, col2 HAVING + col0 + - col2 * col0 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6412
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT + COUNT( * ) * - col2 * - - MAX( 33 ) NOT BETWEEN - 24 AND + COUNT( * ) + col1 * col2 )
----
45
71
8

skipif mysql # not compatible
query I rowsort label-6412
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT + COUNT ( * ) * - col2 * - - MAX ( 33 ) NOT BETWEEN - 24 AND + COUNT ( * ) + col1 * col2 )
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-6413
SELECT - col1 - - COUNT( * ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( + 66 * - col1 + - - col1 ) IS NOT NULL
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-6413
SELECT - col1 - - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( + 66 * - col1 + - - col1 ) IS NOT NULL
----
-40
-58
-60

query I rowsort
SELECT ALL + col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT - - col2 + - 57 IS NULL
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6415
SELECT DISTINCT + AVG ( ALL CAST( NULL AS SIGNED ) ) AS col0, col1 + - 49 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( 81 ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-6415
SELECT DISTINCT + AVG ( ALL CAST ( NULL AS INTEGER ) ) AS col0, col1 + - 49 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( 81 ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6416
SELECT + col1 * - - CAST( + col0 AS SIGNED ) * + col1 * 84 + + CASE - MAX( ( - col0 ) ) WHEN + col1 + 65 THEN ( - COUNT( * ) ) ELSE NULL END * COUNT( * ) + 39 - - col0 * 98 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6416
SELECT + col1 * - - CAST ( + col0 AS INTEGER ) * + col1 * 84 + + CASE - MAX ( ( - col0 ) ) WHEN + col1 + 65 THEN ( - COUNT ( * ) ) ELSE NULL END * COUNT ( * ) + 39 - - col0 * 98 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE - col0 * + + 76 < NULL GROUP BY col2, col1 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1, col2 HAVING ( 0 * - 24 <= ( NULL ) )
----

query I rowsort
SELECT 16 FROM tab1 GROUP BY col1
----
16
16
16

query I rowsort
SELECT - 2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2 HAVING ( NOT ( NULL ) <> NULL )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6421
SELECT col2 * col2 AS col2, 87 * + 76 * COALESCE ( + COUNT( * ), 86 * col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1444
6612
576
6612
6241
6612

skipif mysql # not compatible
query II rowsort label-6421
SELECT col2 * col2 AS col2, 87 * + 76 * COALESCE ( + COUNT ( * ), 86 * col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1444
6612
576
6612
6241
6612

query I rowsort
SELECT DISTINCT 51 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
51

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6423
SELECT DISTINCT 67 / - COALESCE ( - + ( + 50 ), - col2, + col2 + + - col2 + + 95 ) + CAST( 55 AS SIGNED ) * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN + 54 AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6423
SELECT DISTINCT 67 / - COALESCE ( - + ( + 50 ), - col2, + col2 + + - col2 + + 95 ) + CAST ( 55 AS INTEGER ) * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN + 54 AND ( NULL )
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING + col0 * + col0 * - 79 * col0 + + 54 <= ( NULL )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6425
SELECT 37 + + MIN( DISTINCT + col1 ), 72 AS col2 FROM tab0 GROUP BY col1
----
118
72
37
72

skipif mysql # not compatible
query II rowsort label-6425
SELECT 37 + + MIN ( DISTINCT + col1 ), 72 AS col2 FROM tab0 GROUP BY col1
----
118
72
37
72

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6426
SELECT + ( col1 ) * + 18 DIV ( + + COUNT( * ) ) FROM tab2 GROUP BY col1
----
1062
1098
738

skipif mysql # not compatible
query I rowsort label-6426
SELECT + ( col1 ) * + 18 / ( + + COUNT ( * ) ) FROM tab2 GROUP BY col1
----
1062
1098
738

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6427
SELECT DISTINCT - + col0 FROM tab1 WHERE 84 = col0 * 27 - - col1 GROUP BY col0 HAVING CAST( NULL AS DECIMAL ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-6427
SELECT DISTINCT - + col0 FROM tab1 WHERE 84 = col0 * 27 - - col1 GROUP BY col0 HAVING CAST ( NULL AS REAL ) >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6428
SELECT - col0 + 41 - + col0 * + col0 * + + col0 - + col0 * - COUNT( * ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT + - COUNT( * ) * + 31 IS NULL
----
-3334
-753530
-778647

skipif mysql # not compatible
query I rowsort label-6428
SELECT - col0 + 41 - + col0 * + col0 * + + col0 - + col0 * - COUNT ( * ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT + - COUNT ( * ) * + 31 IS NULL
----
-3334
-753530
-778647

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6429
SELECT col2 + + 96 - + ( col2 ) + CAST( NULL AS SIGNED ) * - + col2 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6429
SELECT col2 + + 96 - + ( col2 ) + CAST ( NULL AS INTEGER ) * - + col2 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 96 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( 67 IS NULL )
----

query I rowsort
SELECT - 9 FROM tab0 AS cor0 WHERE NOT NULL = NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - + col2 * - 16 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( + + 10 ) <> col2 + + col1
----
1136
128
720

query II rowsort
SELECT - col0, col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 82 AS col0 FROM tab1 GROUP BY col2
----
-82
-82
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-6435
SELECT DISTINCT - + COUNT( * ) FROM tab0 AS cor0 GROUP BY col1, col2
----
-1

skipif mysql # not compatible
query I rowsort label-6435
SELECT DISTINCT - + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1, col2
----
-1

query II rowsort
SELECT ALL + col2, + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
58
79
79
87
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6437
SELECT DISTINCT - COUNT( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN( ALL + col2 ) WHEN COUNT( * ) * col0 THEN NULL END
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6437
SELECT DISTINCT - COUNT ( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT ( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN ( ALL + col2 ) WHEN COUNT ( * ) * col0 THEN NULL END
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6438
SELECT 10 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - 67 * + ( - - COUNT( * ) ) <> + col2 - col0
----

skipif mysql # not compatible
query II rowsort label-6438
SELECT 10 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - 67 * + ( - - COUNT ( * ) ) <> + col2 - col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6439
SELECT - col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - 11 + + 82 + + - 32 * - 47 < ( + - CASE - COUNT( col2 ) WHEN - 90 THEN - col2 WHEN COUNT( ALL col1 ) THEN NULL END )
----

skipif mysql # not compatible
query I rowsort label-6439
SELECT - col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - 11 + + 82 + + - 32 * - 47 < ( + - CASE - COUNT ( col2 ) WHEN - 90 THEN - col2 WHEN COUNT ( ALL col1 ) THEN NULL END )
----

query I rowsort
SELECT ALL - 29 FROM tab2 GROUP BY col0, col2
----
-29
-29
-29

query I rowsort
SELECT - 46 * - - col2 * 63 AS col2 FROM tab1 GROUP BY col0, col2
----
-130410
-205758
-23184

query II rowsort
SELECT 70 + + - col0, + col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-12
71
42
45
48
8

onlyif mysql # aggregate syntax: 
query I rowsort label-6443
SELECT DISTINCT + SUM( - + 28 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-28

skipif mysql # not compatible
query I rowsort label-6443
SELECT DISTINCT + SUM ( - + 28 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + 3 col2, ( + col2 ) - + 40 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6445
SELECT - - col0 + + 94 + + col0 * col0 * CAST( + CAST( + 84 AS SIGNED ) AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + COUNT( * ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6445
SELECT - - col0 + + 94 + + col0 * col0 * CAST ( + CAST ( + 84 AS INTEGER ) AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + COUNT ( * ) ) IS NULL
----

query I rowsort
SELECT - col2 * col2 FROM tab1 cor0 WHERE NOT col0 NOT BETWEEN + col0 AND - col0 * - CASE WHEN col1 IS NULL THEN - col1 END GROUP BY col2, col2, col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6447
SELECT DISTINCT - CAST( + ( col2 ) AS SIGNED ) + ( - ( + 38 ) ) - + col2 / CAST( NULL AS SIGNED ) / + col2 + col2 FROM tab1 AS cor0 WHERE NOT ( 69 * - + col2 + 2 ) > NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6447
SELECT DISTINCT - CAST ( + ( col2 ) AS INTEGER ) + ( - ( + 38 ) ) - + col2 / CAST ( NULL AS INTEGER ) / + col2 + col2 FROM tab1 AS cor0 WHERE NOT ( 69 * - + col2 + 2 ) > NULL GROUP BY col2
----

query I rowsort
SELECT ALL - - 54 FROM tab0 AS cor0 GROUP BY col1
----
54
54

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6449
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 / col2 + - CAST( NULL AS SIGNED ) IS NULL
----
45
71
8

skipif mysql # not compatible
query I rowsort label-6449
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 / col2 + - CAST ( NULL AS INTEGER ) IS NULL
----
45
71
8

query II rowsort
SELECT 36 + 2 AS col2, col0 + + + col0 FROM tab0 GROUP BY col0, col0, col0, col2
----
38
166
38
52
38
86

onlyif mysql # aggregate syntax: 
query I rowsort label-6451
SELECT - col0 + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1, col0
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-6451
SELECT - col0 + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1, col0
----
-21
-27
-81

query I rowsort
SELECT ALL + 66 * + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-6006
-6072
-990

query I rowsort
SELECT ALL + 10 FROM tab1 GROUP BY col0, col0
----
10
10
10

query II rowsort
SELECT - - 88 AS col1, + AVG ( - col1 ) AS col2 FROM tab1 AS cor0 WHERE + col0 > NULL GROUP BY col1, col1
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6455
SELECT ALL + COUNT( * ) FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT + col0 - + + MIN( ALL + - COALESCE ( + 63, - col1 ) ) + - - MIN( - 34 ) * ( + ( + CAST( 48 AS SIGNED ) ) ) - - CAST( NULL AS SIGNED ) + CASE col0 WHEN - 29 THEN NULL WHEN NULLIF ( col1, 26 ) * + col2 THEN NULL ELSE COUNT( * ) END * col1 * - col1 IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6455
SELECT ALL + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT + col0 - + + MIN ( ALL + - COALESCE ( + 63, - col1 ) ) + - - MIN ( - 34 ) * ( + ( + CAST ( 48 AS INTEGER ) ) ) - - CAST ( NULL AS INTEGER ) + CASE col0 WHEN - 29 THEN NULL WHEN NULLIF ( col1, 26 ) * + col2 THEN NULL ELSE COUNT ( * ) END * col1 * - col1 IS NOT NULL
----
1
1
1

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-6457
SELECT col2 + - COUNT( * ) FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-6457
SELECT col2 + - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
57
78
86

query I rowsort
SELECT DISTINCT - col2 - - col2 * + 77 * - - 11 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
38070
60066
6768

onlyif mysql # DIV for integer division: 
query I rowsort label-6459
SELECT col1 + - col1 DIV + - col1 + + 84 + + 13 FROM tab1 GROUP BY col1
----
104
142
155

skipif mysql # not compatible
query I rowsort label-6459
SELECT col1 + - col1 / + - col1 + + 84 + + 13 FROM tab1 GROUP BY col1
----
104
142
155

query I rowsort
SELECT ALL + 90 FROM tab2 WHERE NOT NULL <= - col0 GROUP BY col2
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT - 53 * + 81 AS col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 * + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 71 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6464
SELECT ALL - ( + 64 ) DIV + CAST( + - col0 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
0
0
4

skipif mysql # not compatible
query I rowsort label-6464
SELECT ALL - ( + 64 ) / + CAST ( + - col0 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
0
0
4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6465
SELECT ALL col1 + - CAST( NULL AS SIGNED ) + + 18 - - + col1 + col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6465
SELECT ALL col1 + - CAST ( NULL AS INTEGER ) + + 18 - - + col1 + col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-6466
SELECT - col1 DIV - 89 FROM tab1 AS cor0 GROUP BY col1, col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6466
SELECT - col1 / - 89 FROM tab1 AS cor0 GROUP BY col1, col1
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6467
SELECT DISTINCT SUM( - - col2 ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-6467
SELECT DISTINCT SUM ( - - col2 ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6468
SELECT col0 + - CAST( COUNT( * ) AS SIGNED ) col1 FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6468
SELECT col0 + - CAST ( COUNT ( * ) AS INTEGER ) col1 FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

query I rowsort
SELECT DISTINCT col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 GROUP BY col0, col0
----
15
91
92

query II rowsort
SELECT + + 1, 7 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6472
SELECT MIN( - + col2 ) AS col1, - 14 FROM tab1 GROUP BY col2, col2
----
-45
-14
-71
-14
-8
-14

skipif mysql # not compatible
query II rowsort label-6472
SELECT MIN ( - + col2 ) AS col1, - 14 FROM tab1 GROUP BY col2, col2
----
-45
-14
-71
-14
-8
-14

onlyif mysql # aggregate syntax: 
query II rowsort label-6473
SELECT - col1, MAX( ALL - col1 ) * - col1 * col1 + - col1 + - 74 + - col1 AS col2 FROM tab2 AS cor0 WHERE 96 + - col1 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-6473
SELECT - col1, MAX ( ALL - col1 ) * - col1 * col1 + - col1 + - 74 + - col1 AS col2 FROM tab2 AS cor0 WHERE 96 + - col1 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6474
SELECT ALL + - col1 + + + col1 AS col1, - 9 + - CAST( + col1 AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IN ( 35 )
----

skipif mysql # not compatible
query II rowsort label-6474
SELECT ALL + - col1 + + + col1 AS col1, - 9 + - CAST ( + col1 AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IN ( 35 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6475
SELECT ALL MAX( DISTINCT - + col0 ) + + 97 * - + 9 FROM tab0 AS cor0 GROUP BY col0, col1
----
-899
-916
-956

skipif mysql # not compatible
query I rowsort label-6475
SELECT ALL MAX ( DISTINCT - + col0 ) + + 97 * - + 9 FROM tab0 AS cor0 GROUP BY col0, col1
----
-899
-916
-956

query I rowsort
SELECT + col2 * col2 + + - 4 + 44 + + 24 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT + - 29 * - col1 + + col1 + + col1 * col1 * + col1 + + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
533952

onlyif mysql # aggregate syntax: 
query I rowsort label-6478
SELECT COUNT( * ) AS col0 FROM tab1 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6478
SELECT COUNT ( * ) AS col0 FROM tab1 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ( col0 ) FROM tab1 GROUP BY col0
----
22
28
82

onlyif mysql # aggregate syntax: 
query I rowsort label-6480
SELECT + 1 * - - 33 + + col0 * - + col0 * - COUNT( * ) + + 42 + - col0 FROM tab0 GROUP BY col0
----
1881
6881
725

skipif mysql # not compatible
query I rowsort label-6480
SELECT + 1 * - - 33 + + col0 * - + col0 * - COUNT ( * ) + + 42 + - col0 FROM tab0 GROUP BY col0
----
1881
6881
725

onlyif mysql # DIV for integer division: 
query I rowsort label-6481
SELECT DISTINCT col2 DIV col2 + + - 69 FROM tab0 GROUP BY col2
----
-68

skipif mysql # not compatible
query I rowsort label-6481
SELECT DISTINCT col2 / col2 + + - 69 FROM tab0 GROUP BY col2
----
-68

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6482
SELECT col1 DIV - col1 + - MAX( col1 ) col0 FROM tab1 GROUP BY col1
----
-45
-58
-7

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6482
SELECT col1 / - col1 + - MAX ( col1 ) col0 FROM tab1 GROUP BY col1
----
-45
-58
-7

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6483
SELECT - 84 + + - CAST( col1 AS SIGNED ) - - + 97 AS col0, col1 + col1 AS col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1
----
-68
162
13
0

skipif mysql # not compatible
query II rowsort label-6483
SELECT - 84 + + - CAST ( col1 AS INTEGER ) - - + 97 AS col0, col1 + col1 AS col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1
----
-68
162
13
0

query I rowsort
SELECT col1 * - col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 89 AS col0, col1 * - - col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
89
1936
89
3249
89
36

onlyif mysql # aggregate syntax: 
query I rowsort label-6486
SELECT COUNT( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - - COUNT( * ) * + COALESCE ( - col2, - - col0, + col0 ) = NULL
----

skipif mysql # not compatible
query I rowsort label-6486
SELECT COUNT ( * ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - - COUNT ( * ) * + COALESCE ( - col2, - - col0, + col0 ) = NULL
----

query I rowsort
SELECT ALL - col2 + + - col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL >= col1 * - col2 + + 2 + + 83
----

query I rowsort
SELECT + 82 FROM tab2 GROUP BY col1, col0
----
82
82
82

onlyif mysql # aggregate syntax: 
query I rowsort label-6489
SELECT + COUNT( * ) FROM tab1 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6489
SELECT + COUNT ( * ) FROM tab1 GROUP BY col1, col1
----
1
1
1

query II rowsort
SELECT ALL col1 * + 1, col1 AS col2 FROM tab2 GROUP BY col2, col1
----
41
41
59
59
61
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6491
SELECT - CAST( - col0 AS SIGNED ) FROM tab2 GROUP BY col1, col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6491
SELECT - CAST ( - col0 AS INTEGER ) FROM tab2 GROUP BY col1, col0
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-6492
SELECT DISTINCT - COUNT( * ) + col2 + - 46 FROM tab2 GROUP BY col2, col2
----
11
32
40

skipif mysql # not compatible
query I rowsort label-6492
SELECT DISTINCT - COUNT ( * ) + col2 + - 46 FROM tab2 GROUP BY col2, col2
----
11
32
40

query I rowsort
SELECT DISTINCT - col2 + 53 FROM tab1 cor0 GROUP BY col2 HAVING col2 > 3
----
-18
45
8

query I rowsort
SELECT DISTINCT 16 AS col1 FROM tab2 GROUP BY col0
----
16

query I rowsort
SELECT 99 AS col0 FROM tab0 GROUP BY col1
----
99
99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6496
SELECT 50 FROM tab1 GROUP BY col2 HAVING + CAST( NULL AS SIGNED ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-6496
SELECT 50 FROM tab1 GROUP BY col2 HAVING + CAST ( NULL AS INTEGER ) >= NULL
----

query I rowsort
SELECT ALL + 53 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - + 83 + + - col1 - + + AVG ( + - col1 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6498
SELECT ALL + col1 + - + COUNT( * ) - - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6498
SELECT ALL + col1 + - + COUNT ( * ) - - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6499
SELECT ALL - - col1 DIV - col1 - + COUNT( * ) col2 FROM tab1 cor0 GROUP BY col1
----
-2
-2
-2

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6499
SELECT ALL - - col1 / - col1 - + COUNT ( * ) col2 FROM tab1 cor0 GROUP BY col1
----
-2
-2
-2

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + + col2 IS NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-6501
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 65 * + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6501
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 65 * + COUNT ( * ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 * + - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
484
6724
784

query I rowsort
SELECT 51 * + - col1 + + COALESCE ( - col1, + - 9 ) FROM tab1 GROUP BY col1
----
-2288
-2964
-312

query I rowsort
SELECT 8 FROM tab0 GROUP BY col0
----
8
8
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6505
SELECT DISTINCT + col2 - + - col2 + col2 DIV - col2 * + + 73 DIV + + 51 + - col2 AS col1 FROM tab0 GROUP BY col2
----
23
37
78

skipif mysql # not compatible
query I rowsort label-6505
SELECT DISTINCT + col2 - + - col2 + col2 / - col2 * + + 73 / + + 51 + - col2 AS col1 FROM tab0 GROUP BY col2
----
23
37
78

query I rowsort
SELECT + ( + col2 ) FROM tab2 GROUP BY col2, col2
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6507
SELECT MIN( DISTINCT - + col2 ) AS col0 FROM tab0 GROUP BY col2, col2 HAVING col2 + COUNT( * ) <> col2
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-6507
SELECT MIN ( DISTINCT - + col2 ) AS col0 FROM tab0 GROUP BY col2, col2 HAVING col2 + COUNT ( * ) <> col2
----
-24
-38
-79

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query II rowsort label-6508
SELECT - COUNT( * ) AS col1, col0 - + 4 - + 70 * + - CAST( - - col0 AS DECIMAL ) - - MIN( ( col0 ) ) AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) < NULL
----

skipif mysql # not compatible
query II rowsort label-6508
SELECT - COUNT ( * ) AS col1, col0 - + 4 - + 70 * + - CAST ( - - col0 AS REAL ) - - MIN ( ( col0 ) ) AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) < NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6509
SELECT ALL - col0 AS col2, COUNT( * ) col2 FROM tab0 GROUP BY col0, col1
----
-26
1
-43
1
-83
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6509
SELECT ALL - col0 AS col2, COUNT ( * ) col2 FROM tab0 GROUP BY col0, col1
----
-26
1
-43
1
-83
1

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6510
SELECT DISTINCT 68 + - + col2 * ( col0 ) + + - col2 * - + col2 AS col2, 18 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + 89 + - CAST( NULL AS DECIMAL ) NOT IN ( + - ( + 35 ) )
----

skipif mysql # not compatible
query II rowsort label-6510
SELECT DISTINCT 68 + - + col2 * ( col0 ) + + - col2 * - + col2 AS col2, 18 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + 89 + - CAST ( NULL AS REAL ) NOT IN ( + - ( + 35 ) )
----

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT 12 * + - col2 - + col0 + + ( - 47 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
-1086
-1106
-835

query I rowsort
SELECT + 51 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL < 0
----

query I rowsort
SELECT DISTINCT col1 + 13 FROM tab2 AS cor0 GROUP BY col1, col0
----
54
72
74

query I rowsort
SELECT + 59 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
59
59
59

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 WHERE NULL BETWEEN ( NULL ) AND col1 GROUP BY col1
----

query I rowsort
SELECT + ( + col2 ) * + 1 - + col2 - - 11 AS col1 FROM tab1 GROUP BY col2
----
11
11
11

query I rowsort
SELECT 93 + + col0 FROM tab1 GROUP BY col0
----
115
121
175

onlyif mysql # aggregate syntax: 
query I rowsort label-6519
SELECT COUNT( * ) FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6519
SELECT COUNT ( * ) FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL col0 * 5 AS col1 FROM tab2 WHERE NOT - + 25 >= NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6521
SELECT SUM( + col2 ) * - col2 * - COUNT( * ) AS col1, - col2 DIV - 39 + + - 8 * + ( + - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
465
6241
634
7569
698

skipif mysql # not compatible
query II rowsort label-6521
SELECT SUM ( + col2 ) * - col2 * - COUNT ( * ) AS col1, - col2 / - 39 + + - 8 * + ( + - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
465
6241
634
7569
698

onlyif mysql # aggregate syntax: 
query I rowsort label-6522
SELECT COUNT( * ) - col2 + - 58 * + col2 * 25 FROM tab0 GROUP BY col2
----
-114628
-34823
-55137

skipif mysql # not compatible
query I rowsort label-6522
SELECT COUNT ( * ) - col2 + - 58 * + col2 * 25 FROM tab0 GROUP BY col2
----
-114628
-34823
-55137

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col1, col0
----
-81
0
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6524
SELECT COUNT( * ) FROM tab2 AS cor0 WHERE + col1 BETWEEN + - col2 + - col1 AND + - 61 / col1 - - - CAST( + CAST( + 70 AS SIGNED ) AS SIGNED ) * col1 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6524
SELECT COUNT ( * ) FROM tab2 AS cor0 WHERE + col1 BETWEEN + - col2 + - col1 AND + - 61 / col1 - - - CAST ( + CAST ( + 70 AS INTEGER ) AS INTEGER ) * col1 GROUP BY col2
----

query I rowsort
SELECT - 79 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-79
-79
-79

query I rowsort
SELECT + col0 * - - 23 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-3036
-36708
-82984

query I rowsort
SELECT ALL + ( ( 63 ) ) + col0 + + 34 AS col0 FROM tab2 GROUP BY col2, col0
----
112
188
189

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2 HAVING NOT col2 NOT BETWEEN NULL AND - - 62 * + - 70
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6529
SELECT - 94 DIV - - col1 FROM tab2 GROUP BY col1
----
-1
-1
-2

skipif mysql # not compatible
query I rowsort label-6529
SELECT - 94 / - - col1 FROM tab2 GROUP BY col1
----
-1
-1
-2

onlyif mysql # DIV for integer division: 
query I rowsort label-6530
SELECT ALL + - ( - col0 ) DIV col2 col1 FROM tab2 cor0 GROUP BY col0, col2
----
0
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6530
SELECT ALL + - ( - col0 ) / col2 col1 FROM tab2 cor0 GROUP BY col0, col2
----
0
1
1

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 WHERE 23 = - + col1 * ( + col2 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col2 + - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-102
-115
-14

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT + 49 * - 93 FROM tab0 AS cor0 GROUP BY col2 HAVING 42 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6535
SELECT + COUNT( * ) + COUNT( * ) * col0 FROM tab0 AS cor0 GROUP BY col0
----
27
44
84

skipif mysql # not compatible
query I rowsort label-6535
SELECT + COUNT ( * ) + COUNT ( * ) * col0 FROM tab0 AS cor0 GROUP BY col0
----
27
44
84

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col1 HAVING + + col1 >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6537
SELECT DISTINCT + COUNT( - ( col1 ) ) + - ( - + col1 ) FROM tab0 GROUP BY col1 HAVING - + col1 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-6537
SELECT DISTINCT + COUNT ( - ( col1 ) ) + - ( - + col1 ) FROM tab0 GROUP BY col1 HAVING - + col1 NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6538
SELECT col0 DIV + col0 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6538
SELECT col0 / + col0 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT 7 AS col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL AND - 82 < ( NULL ) GROUP BY col0
----

query I rowsort
SELECT ALL col2 * + - col2 + - col2 AS col2 FROM tab1 GROUP BY col2, col2
----
-2070
-5112
-72

query I rowsort
SELECT + col2 + col2 FROM tab0 GROUP BY col2, col0
----
158
48
76

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col2, col0 HAVING ( + + ( + col2 ) + - col2 ) IS NOT NULL
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-6543
SELECT - MIN( DISTINCT + 6 ) * COUNT( * ) FROM tab2 GROUP BY col0, col2 HAVING - 29 + col2 > NULL
----

skipif mysql # not compatible
query I rowsort label-6543
SELECT - MIN ( DISTINCT + 6 ) * COUNT ( * ) FROM tab2 GROUP BY col0, col2 HAVING - 29 + col2 > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6544
SELECT + - col1 + + COUNT( * ) + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6544
SELECT + - col1 + + COUNT ( * ) + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT col2 + - col2 + col2 AS col1 FROM tab2 GROUP BY col2
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6546
SELECT COUNT( * ) + + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND 26
----

skipif mysql # not compatible
query I rowsort label-6546
SELECT COUNT ( * ) + + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND 26
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 90 * - col1 col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6548
SELECT CAST( NULL AS SIGNED ) / 76 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-6548
SELECT CAST ( NULL AS INTEGER ) / 76 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 23 FROM tab1 GROUP BY col0
----
-23
-23
-23

onlyif mysql # aggregate syntax: 
query I rowsort label-6550
SELECT + - col1 * + + col1 * + col1 + - col1 FROM tab1 WHERE NOT + col0 + + - ( + ( 8 ) ) NOT BETWEEN NULL AND + + ( - 81 ) * - - 43 + - - 20 GROUP BY col1 HAVING 48 + + + col1 < - MIN( DISTINCT - col2 )
----

skipif mysql # not compatible
query I rowsort label-6550
SELECT + - col1 * + + col1 * + col1 + - col1 FROM tab1 WHERE NOT + col0 + + - ( + ( 8 ) ) NOT BETWEEN NULL AND + + ( - 81 ) * - - 43 + - - 20 GROUP BY col1 HAVING 48 + + + col1 < - MIN ( DISTINCT - col2 )
----

query I rowsort
SELECT + col1 * col1 * + col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING ( ( NULL ) NOT BETWEEN NULL AND - 97 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6552
SELECT ALL 83 - + - col2 * - 0 DIV + + col2 * - - ( - + col2 ) * - col2 FROM tab1 AS cor0 GROUP BY col2
----
83
83
83

skipif mysql # not compatible
query I rowsort label-6552
SELECT ALL 83 - + - col2 * - 0 / + + col2 * - - ( - + col2 ) * - col2 FROM tab1 AS cor0 GROUP BY col2
----
83
83
83

query I rowsort
SELECT + col1 FROM tab0 WHERE - col2 BETWEEN - ( - col1 ) AND - ( + ( - - col1 ) ) GROUP BY col1, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6554
SELECT DISTINCT + 95 + + + col0 * + 41 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( - ( + 39 ) ) * - col0 * - MAX( ALL + col2 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6554
SELECT DISTINCT + 95 + + + col0 * + 41 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( - ( + 39 ) ) * - col0 * - MAX ( ALL + col2 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6555
SELECT + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT + CAST( col1 AS SIGNED ) * - col2 - + col2 + + ( + col1 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6555
SELECT + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT + CAST ( col1 AS INTEGER ) * - col2 - + col2 + + ( + col1 ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-6556
SELECT - - COALESCE ( 23, - + CASE + col1 WHEN - - 20 + + MIN( ALL + + CAST( NULL AS SIGNED ) ) THEN + col0 * + col0 ELSE - 39 * + 45 END + 33 + 73 * + col2, col1, + col0 ) * + col1, 73 * col1 col0 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
1012
3212
1311
4161
138
438

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6556
SELECT - - COALESCE ( 23, - + CASE + col1 WHEN - - 20 + + MIN ( ALL + + CAST ( NULL AS INTEGER ) ) THEN + col0 * + col0 ELSE - 39 * + 45 END + 33 + 73 * + col2, col1, + col0 ) * + col1, 73 * col1 col0 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
1012
3212
1311
4161
138
438

onlyif mysql # DIV for integer division: 
query I rowsort label-6557
SELECT DISTINCT + col1 DIV + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-6557
SELECT DISTINCT + col1 / + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1

query I rowsort
SELECT DISTINCT + col1 / + 36 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT col2 * - + col2 * - 91 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
306124
567931
688779

onlyif mysql # aggregate syntax: 
query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT( * ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6561
SELECT - - SUM( + 56 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + 59 IS NOT NULL
----
56
56
56

skipif mysql # not compatible
query I rowsort label-6561
SELECT - - SUM ( + 56 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + 59 IS NOT NULL
----
56
56
56

query I rowsort
SELECT DISTINCT - col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0, col2
----
-22
-28
-82

query I rowsort
SELECT + 31 * + 12 + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
394
400
454

onlyif mysql # aggregate syntax: 
query I rowsort label-6564
SELECT - - col2 / - + ( - + col2 ) + + - COUNT( * ) FROM tab2 AS cor0 WHERE + col2 IS NULL GROUP BY col2 HAVING 56 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6564
SELECT - - col2 / - + ( - + col2 ) + + - COUNT ( * ) FROM tab2 AS cor0 WHERE + col2 IS NULL GROUP BY col2 HAVING 56 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + AVG ( - col1 ) AS col0 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT DISTINCT - col1 * + col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1640
-3422
-3660

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( col0 ) + col0 col1 FROM tab2 GROUP BY col0 HAVING - + 92 IS NOT NULL
----
182
184
30

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6569
SELECT COUNT( * ) * + 29 + + COUNT( * ) FROM tab0 GROUP BY col0
----
30
30
30

skipif mysql # not compatible
query I rowsort label-6569
SELECT COUNT ( * ) * + 29 + + COUNT ( * ) FROM tab0 GROUP BY col0
----
30
30
30

query I rowsort
SELECT DISTINCT ( - + col1 ) FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6571
SELECT + CAST( - COUNT( * ) AS SIGNED ) DIV + col0 * + COUNT( * ) + + + col0 FROM tab2 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6571
SELECT + CAST ( - COUNT ( * ) AS INTEGER ) / + col0 * + COUNT ( * ) + + + col0 FROM tab2 GROUP BY col0
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-6572
SELECT ALL + COUNT( * ) FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6572
SELECT ALL + COUNT ( * ) FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT + 16 IS NOT NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6574
SELECT - COUNT( * ) FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-6574
SELECT - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6575
SELECT - 10 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= + - CAST( NULL AS SIGNED ) - COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6575
SELECT - 10 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= + - CAST ( NULL AS INTEGER ) - COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6576
SELECT SUM( ALL 75 ) * col2 * + col2 * + - col2 * col2 * + - 16 / + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

skipif mysql # not compatible
query I rowsort label-6576
SELECT SUM ( ALL 75 ) * col2 * + col2 * + - col2 * col2 * + - 16 / + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT - 2 FROM tab2 AS cor0 GROUP BY col1
----
-2
-2
-2

query I rowsort
SELECT - - col1 - + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING - 52 IS NOT NULL
----
0
0

query I rowsort
SELECT ALL col2 / col2 FROM tab2 WHERE NULL >= - col0 GROUP BY col2
----

query I rowsort
SELECT 67 FROM tab1 GROUP BY col1, col0, col0, col2
----
67
67
67

onlyif mysql # aggregate syntax: 
query I rowsort label-6581
SELECT + + ( - - 71 ) + - SUM( COALESCE ( + col1, - 79 ) ) FROM tab0 cor0 GROUP BY col1
----
-10
71

skipif mysql # not compatible
query I rowsort label-6581
SELECT + + ( - - 71 ) + - SUM ( COALESCE ( + col1, - 79 ) ) FROM tab0 cor0 GROUP BY col1
----
-10
71

query I rowsort
SELECT ( - + col2 ) * - - 73 FROM tab2 AS cor0 GROUP BY col2 HAVING 7 IS NOT NULL
----
-4234
-5767
-6351

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6583
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING COUNT( + ( + - col2 ) ) * col2 * - + CAST( NULL AS DECIMAL ) IS NULL
----
58
79
87

skipif mysql # not compatible
query I rowsort label-6583
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING COUNT ( + ( + - col2 ) ) * col2 * - + CAST ( NULL AS REAL ) IS NULL
----
58
79
87

query I rowsort
SELECT ALL 60 * - AVG ( ALL + + col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6585
SELECT - - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6585
SELECT - - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-6586
SELECT + - col2 DIV - ( - + col2 ) + 42 + + ( - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-16
-3
35

skipif mysql # not compatible
query I rowsort label-6586
SELECT + - col2 / - ( - + col2 ) + 42 + + ( - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-16
-3
35

query I rowsort
SELECT 68 AS col2 FROM tab2 cor0 GROUP BY col0
----
68
68
68

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NULL <> col0 + - - col0 + - col0 * + 16 GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6589
SELECT COUNT( * ) * - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = - 61
----

skipif mysql # not compatible
query I rowsort label-6589
SELECT COUNT ( * ) * - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = - 61
----

query I rowsort
SELECT col1 + 91 FROM tab0 GROUP BY col1
----
172
91

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 AS cor0 WHERE NOT col2 <= NULL GROUP BY col0 HAVING NOT - + 53 >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6592
SELECT ALL - COUNT( * ) * 40 + + col1 FROM tab1 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-6592
SELECT ALL - COUNT ( * ) * 40 + + col1 FROM tab1 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col2
----

query I rowsort
SELECT + 34 FROM tab1 cor0 GROUP BY col0
----
34
34
34

query I rowsort
SELECT DISTINCT - - 44 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
44

onlyif mysql # aggregate syntax: 
query I rowsort label-6595
SELECT ALL - + 93 FROM tab2 AS cor0 WHERE col1 + col0 IS NULL GROUP BY col2, col1 HAVING NOT ( ( NULL ) BETWEEN - COUNT( - col0 ) AND + 60 )
----

skipif mysql # not compatible
query I rowsort label-6595
SELECT ALL - + 93 FROM tab2 AS cor0 WHERE col1 + col0 IS NULL GROUP BY col2, col1 HAVING NOT ( ( NULL ) BETWEEN - COUNT ( - col0 ) AND + 60 )
----

query I rowsort
SELECT - 24 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-24
-24
-24

onlyif mysql # aggregate syntax: 
query I rowsort label-6597
SELECT + 7 * ( col0 ) AS col1 FROM tab2 GROUP BY col0, col0, col0 HAVING ( - col0 ) + COUNT( * ) IS NOT NULL
----
105
637
644

skipif mysql # not compatible
query I rowsort label-6597
SELECT + 7 * ( col0 ) AS col1 FROM tab2 GROUP BY col0, col0, col0 HAVING ( - col0 ) + COUNT ( * ) IS NOT NULL
----
105
637
644

onlyif mysql # aggregate syntax: 
query I rowsort label-6598
SELECT + ( + 89 ) col1 FROM tab1 WHERE NOT NULL <> + col2 GROUP BY col0 HAVING + MIN( - 39 ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6598
SELECT + ( + 89 ) col1 FROM tab1 WHERE NOT NULL <> + col2 GROUP BY col0 HAVING + MIN ( - 39 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6599
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT CAST( NULL AS SIGNED ) < NULL
----

skipif mysql # not compatible
query I rowsort label-6599
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT CAST ( NULL AS INTEGER ) < NULL
----

query I rowsort
SELECT 0 + col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6601
SELECT DISTINCT SUM( DISTINCT - col1 ) AS col2 FROM tab1 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-6601
SELECT DISTINCT SUM ( DISTINCT - col1 ) AS col2 FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN + 21 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6603
SELECT ALL COUNT( * ) - + col2 FROM tab1 WHERE ( col1 ) BETWEEN NULL AND 39 GROUP BY col2, col1 HAVING ( NULL ) > col2 * 17
----

skipif mysql # not compatible
query I rowsort label-6603
SELECT ALL COUNT ( * ) - + col2 FROM tab1 WHERE ( col1 ) BETWEEN NULL AND 39 GROUP BY col2, col1 HAVING ( NULL ) > col2 * 17
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6604
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT - 87 IN ( COUNT( * ) * col2 )
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6604
SELECT col1 FROM tab2 GROUP BY col2, col1 HAVING NOT - 87 IN ( COUNT ( * ) * col2 )
----
41
59
61

onlyif mysql # aggregate syntax: 
query I rowsort label-6605
SELECT 81 + NULLIF ( - COUNT( * ) - - col2, 87 ) FROM tab2 WHERE NOT + col1 > - 65 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6605
SELECT 81 + NULLIF ( - COUNT ( * ) - - col2, 87 ) FROM tab2 WHERE NOT + col1 > - 65 GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6606
SELECT DISTINCT 76 * - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> - COUNT( * ) * + 97
----

skipif mysql # not compatible
query I rowsort label-6606
SELECT DISTINCT 76 * - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> - COUNT ( * ) * + 97
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) = col0
----

query I rowsort
SELECT + col2 + col1 AS col2 FROM tab1 GROUP BY col2, col1
----
102
115
14

onlyif mysql # aggregate syntax: 
query I rowsort label-6609
SELECT + COUNT( * ) FROM tab1 WHERE NOT - col1 IS NOT NULL GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-6609
SELECT + COUNT ( * ) FROM tab1 WHERE NOT - col1 IS NOT NULL GROUP BY col2, col1
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6610
SELECT 71 * col2 AS col1 FROM tab2 WHERE col0 IS NULL GROUP BY col2 HAVING - CAST( NULL AS SIGNED ) * 10 + - SUM( DISTINCT ( 32 ) ) NOT IN ( 70 )
----

skipif mysql # not compatible
query I rowsort label-6610
SELECT 71 * col2 AS col1 FROM tab2 WHERE col0 IS NULL GROUP BY col2 HAVING - CAST ( NULL AS INTEGER ) * 10 + - SUM ( DISTINCT ( 32 ) ) NOT IN ( 70 )
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

onlyif mysql # aggregate syntax: 
query I rowsort label-6612
SELECT ALL - col1 + COUNT( * ) FROM tab2 GROUP BY col1
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-6612
SELECT ALL - col1 + COUNT ( * ) FROM tab2 GROUP BY col1
----
-40
-58
-60

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6613
SELECT + col0 * col0 + col0 FROM tab0 GROUP BY col0 HAVING NOT 45 NOT IN ( - col0 * CAST( + 15 AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-6613
SELECT + col0 * col0 + col0 FROM tab0 GROUP BY col0 HAVING NOT 45 NOT IN ( - col0 * CAST ( + 15 AS REAL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6614
SELECT - 8 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2 HAVING ( + 63 ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6614
SELECT - 8 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2 HAVING ( + 63 ) IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT - 20 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT 81 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6616
SELECT ALL - 64 * COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
-64
-64
-64

skipif mysql # not compatible
query I rowsort label-6616
SELECT ALL - 64 * COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
-64
-64
-64

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING 65 IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: DIV for integer division: 
query I rowsort label-6618
SELECT + 23 DIV + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST( NULL AS SIGNED ) ), CAST( - COUNT( 12 ) AS DECIMAL ) - col2 ) IS NOT NULL
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6618
SELECT + 23 / + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST ( NULL AS INTEGER ) ), CAST ( - COUNT ( 12 ) AS REAL ) - col2 ) IS NOT NULL
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT( * ) + col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT ( * ) + col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6620
SELECT ALL + COUNT( * ) - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6620
SELECT ALL + COUNT ( * ) - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <> + 13
----

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6623
SELECT col0 + 86 DIV col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
16
92
94

skipif mysql # not compatible
query I rowsort label-6623
SELECT col0 + 86 / col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
16
92
94

query I rowsort
SELECT - ( col0 ) FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT 37 FROM tab0 GROUP BY col1
----
37

query I rowsort
SELECT 32 FROM tab2 GROUP BY col0, col0
----
32
32
32

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + 55 AS col2 FROM tab1 GROUP BY col1, col1
----
55

onlyif mysql # aggregate syntax: 
query I rowsort label-6629
SELECT - COUNT( * ) * COUNT( * ) FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6629
SELECT - COUNT ( * ) * COUNT ( * ) FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-6630
SELECT ALL - - col2 / - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - 46 + col2 * COUNT( * ) BETWEEN NULL AND ( + 12 * - AVG ( col1 ) )
----

skipif mysql # not compatible
query I rowsort label-6630
SELECT ALL - - col2 / - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - 46 + col2 * COUNT ( * ) BETWEEN NULL AND ( + 12 * - AVG ( col1 ) )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6631
SELECT DISTINCT CAST( NULL AS SIGNED ) - + col2 * + - COUNT( * ) - - col2 / 73 AS col1 FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-6631
SELECT DISTINCT CAST ( NULL AS INTEGER ) - + col2 * + - COUNT ( * ) - - col2 / 73 AS col1 FROM tab1 GROUP BY col2
----
NULL

query I rowsort
SELECT - 38 / - col2 FROM tab0 GROUP BY col2 HAVING NOT NULL <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6633
SELECT ALL + 48 * + 32 - col2 + - col2 * - COUNT( * ) * - COUNT( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING SUM( - col2 ) * 62 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6633
SELECT ALL + 48 * + 32 - col2 + - col2 * - COUNT ( * ) * - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING SUM ( - col2 ) * 62 IS NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 WHERE NOT - ( + 8 ) IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6635
SELECT + + CAST( - - col0 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6635
SELECT + + CAST ( - - col0 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query II rowsort
SELECT 28 AS col1, col0 * + col0 * ( col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - - col0 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

onlyif mysql # aggregate syntax: 
query I rowsort label-6638
SELECT col2 * MAX( DISTINCT + col2 ) FROM tab0 GROUP BY col2
----
1444
576
6241

skipif mysql # not compatible
query I rowsort label-6638
SELECT col2 * MAX ( DISTINCT + col2 ) FROM tab0 GROUP BY col2
----
1444
576
6241

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6639
SELECT ALL col1 * col1 + + COUNT( * ) + - + col1 DIV + 47 FROM tab0 GROUP BY col1
----
2
6561

skipif mysql # not compatible
query I rowsort label-6639
SELECT ALL col1 * col1 + + COUNT ( * ) + - + col1 / + 47 FROM tab0 GROUP BY col1
----
2
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( - 33 + + col1 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6641
SELECT + - col2 * - - col2 - + col1 + + 62 DIV col2 + - col1 * - 75 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-1443
-6241
5420

skipif mysql # not compatible
query I rowsort label-6641
SELECT + - col2 * - - col2 - + col1 + + 62 / col2 + - col1 * - 75 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-1443
-6241
5420

query I rowsort
SELECT DISTINCT + 40 FROM tab1 AS cor0 WHERE 47 * 71 IN ( - col1 + col0 ) GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6643
SELECT DISTINCT - col0 * COUNT( * ) FROM tab1 GROUP BY col0, col2, col0 HAVING ( + 51 NOT BETWEEN col2 / + MIN( - 97 ) AND ( - 50 ) )
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-6643
SELECT DISTINCT - col0 * COUNT ( * ) FROM tab1 GROUP BY col0, col2, col0 HAVING ( + 51 NOT BETWEEN col2 / + MIN ( - 97 ) AND ( - 50 ) )
----
-22
-28
-82

query I rowsort
SELECT - + col1 AS col1 FROM tab1 WHERE + - 7 + + - col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT + 27 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-16
-56
1

query I rowsort
SELECT 44 FROM tab2 cor0 GROUP BY col1
----
44
44
44

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <> - NULLIF ( + 3, + col1 )
----

query II rowsort
SELECT + ( - + ( - ( col0 ) ) ) AS col0, + 33 + - col2 FROM tab0 GROUP BY col2, col0
----
26
-46
43
9
83
-5

onlyif mysql # aggregate syntax: 
query II rowsort label-6650
SELECT col2 AS col0, COUNT( + col0 ) * + - col2 * col2 + + + AVG ( col2 ) FROM tab2 GROUP BY col2, col0, col2 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-6650
SELECT col2 AS col0, COUNT ( + col0 ) * + - col2 * col2 + + + AVG ( col2 ) FROM tab2 GROUP BY col2, col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 + 25 AS col1 FROM tab1 GROUP BY col2, col2
----
33
70
96

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 WHERE 16 BETWEEN col1 + + - 19 * 19 * - col1 AND col0 * - col2 + - 51 * + col1 GROUP BY col0 HAVING NULL NOT IN ( - 59 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6653
SELECT DISTINCT col2 * - - AVG ( ALL - + CAST( NULL AS SIGNED ) ) FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-6653
SELECT DISTINCT col2 * - - AVG ( ALL - + CAST ( NULL AS INTEGER ) ) FROM tab2 GROUP BY col2
----
NULL

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6654
SELECT - COUNT( + - col1 ) * + - CAST( COUNT( * ) AS DECIMAL ) * + COUNT( ALL + 87 ) * - SUM( ALL + col1 ) + + col1 * + col1 - col1 / - COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6654
SELECT - COUNT ( + - col1 ) * + - CAST ( COUNT ( * ) AS REAL ) * + COUNT ( ALL + 87 ) * - SUM ( ALL + col1 ) + + col1 * + col1 - col1 / - COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6655
SELECT DISTINCT COUNT( * ) DIV col2 + + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-6655
SELECT DISTINCT COUNT ( * ) / col2 + + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-6656
SELECT ALL + col2 + + col2 + + + COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
159
49
77

skipif mysql # not compatible
query I rowsort label-6656
SELECT ALL + col2 + + col2 + + + COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
159
49
77

onlyif mysql # aggregate syntax: 
query I rowsort label-6657
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT + - MAX( DISTINCT col2 ) NOT BETWEEN + 37 AND + 73
----

skipif mysql # not compatible
query I rowsort label-6657
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT + - MAX ( DISTINCT col2 ) NOT BETWEEN + 37 AND + 73
----

query II rowsort
SELECT - 15 AS col1, - col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <> NULL GROUP BY col2, col0, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6659
SELECT ALL COUNT( * ) + + col2 + - col2 * + col2 * - ( - + 5 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-16761
-31125
-37757

skipif mysql # not compatible
query I rowsort label-6659
SELECT ALL COUNT ( * ) + + col2 + - col2 * + col2 * - ( - + 5 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-16761
-31125
-37757

query I rowsort
SELECT - 68 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-68
-68
-68

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6661
SELECT 72 + - col0 * - + col0 DIV COUNT( * ) AS col1 FROM tab0 GROUP BY col0
----
1921
6961
748

skipif mysql # not compatible
query I rowsort label-6661
SELECT 72 + - col0 * - + col0 / COUNT ( * ) AS col1 FROM tab0 GROUP BY col0
----
1921
6961
748

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST( + 89 AS SIGNED ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT( * ) - ( + 5 ) * + col2 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST ( + 89 AS INTEGER ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT ( * ) - ( + 5 ) * + col2 = NULL
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 WHERE ( NULL ) = NULL GROUP BY col2
----

query I rowsort
SELECT + 30 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + 22 FROM tab2 AS cor0 GROUP BY col2, col1
----
22
22
22

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6666
SELECT ALL ( - + COUNT( * ) ) + + MAX( DISTINCT - col0 ) + COUNT( ALL CAST( - 60 AS SIGNED ) ) * + col0 / - - COUNT( * ) * + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING 21 * + 42 + COUNT( * ) < ( - col0 )
----

skipif mysql # not compatible
query I rowsort label-6666
SELECT ALL ( - + COUNT ( * ) ) + + MAX ( DISTINCT - col0 ) + COUNT ( ALL CAST ( - 60 AS INTEGER ) ) * + col0 / - - COUNT ( * ) * + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING 21 * + 42 + COUNT ( * ) < ( - col0 )
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6668
SELECT DISTINCT MIN( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT( * )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6668
SELECT DISTINCT MIN ( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT ( * )
----

query I rowsort
SELECT - col1 + + col1 + - 39 + col1 FROM tab0 GROUP BY col1
----
-39
42

query I rowsort
SELECT DISTINCT col0 - 6 + col0 AS col1 FROM tab0 GROUP BY col1, col0
----
160
46
80

onlyif mysql # aggregate syntax: 
query I rowsort label-6671
SELECT ( - col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN COUNT( * ) AND ( + ( + 88 ) / - NULLIF ( - col1, + COUNT( * ) - 78 * MAX( ALL - 76 ) ) * col1 )
----

skipif mysql # not compatible
query I rowsort label-6671
SELECT ( - col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN COUNT ( * ) AND ( + ( + 88 ) / - NULLIF ( - col1, + COUNT ( * ) - 78 * MAX ( ALL - 76 ) ) * col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6672
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col1, col0 HAVING - col1 NOT BETWEEN ( + col1 + - ( - + col0 ) * - + COUNT( * ) ) AND ( NULL )
----
43

skipif mysql # not compatible
query I rowsort label-6672
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col1, col0 HAVING - col1 NOT BETWEEN ( + col1 + - ( - + col0 ) * - + COUNT ( * ) ) AND ( NULL )
----
43

query I rowsort
SELECT col1 * + 59 + + - ( - col1 ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING ( - - col2 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6674
SELECT ALL col1 * - NULLIF ( - col1, + - ( + COUNT( * ) ) ) AS col2 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

skipif mysql # not compatible
query I rowsort label-6674
SELECT ALL col1 * - NULLIF ( - col1, + - ( + COUNT ( * ) ) ) AS col2 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query II rowsort
SELECT DISTINCT - + col2 AS col1, ( - 21 ) * - - 12 * - col2 + - - col2 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) BETWEEN NULL AND + 24 GROUP BY col2 HAVING ( NULL ) >= 44
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6676
SELECT col0 AS col0, CAST( NULL AS SIGNED ) * - AVG ( ALL + 67 ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
92
NULL

skipif mysql # not compatible
query II rowsort label-6676
SELECT col0 AS col0, CAST ( NULL AS INTEGER ) * - AVG ( ALL + 67 ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
92
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-6677
SELECT ALL 99 DIV - 85 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6677
SELECT ALL 99 / - 85 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - - col1 IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6679
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NOT COUNT( DISTINCT 52 ) >= col2 ) OR NOT - col2 NOT IN ( + CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-6679
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NOT COUNT ( DISTINCT 52 ) >= col2 ) OR NOT - col2 NOT IN ( + CAST ( NULL AS INTEGER ) )
----

query II rowsort
SELECT ALL - col2 - - - col0, + col0 * + - col0 AS col2 FROM tab0 GROUP BY col2, col0
----
-105
-676
-121
-6889
-67
-1849

onlyif mysql # DIV for integer division: 
query I rowsort label-6681
SELECT ALL col0 DIV 60 + + col0 AS col0 FROM tab1 GROUP BY col0
----
22
28
83

skipif mysql # not compatible
query I rowsort label-6681
SELECT ALL col0 / 60 + + col0 AS col0 FROM tab1 GROUP BY col0
----
22
28
83

query I rowsort
SELECT ALL col1 + - col0 + - - col1 * + - 90 * - col1 * - - 13 * - + col0 + + - 77 FROM tab1 AS cor0 GROUP BY col0, col1
----
-106437288
-185739955
-926733

query I rowsort
SELECT DISTINCT - col1 * 59 FROM tab0 AS cor0 GROUP BY col1, col2
----
-4779
0

query I rowsort
SELECT ALL + 79 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
79
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 3 col0 FROM tab2 cor0 GROUP BY col1, col2
----
3
3
3

onlyif mysql # aggregate syntax: 
query I rowsort label-6686
SELECT COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6686
SELECT COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT - + col1 * + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

onlyif mysql # aggregate syntax: 
query I rowsort label-6689
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( + 72 + - col1 + - - 29 + + col1 + COUNT( * ) * - - COUNT( * ) + - + 43 ) IS NOT NULL
----
-81
0

skipif mysql # not compatible
query I rowsort label-6689
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( + 72 + - col1 + - - 29 + + col1 + COUNT ( * ) * - - COUNT ( * ) + - + 43 ) IS NOT NULL
----
-81
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6690
SELECT DISTINCT - COUNT( * ) FROM tab1 cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-6690
SELECT DISTINCT - COUNT ( * ) FROM tab1 cor0 GROUP BY col2
----
-1

query I rowsort
SELECT + ( + col2 ) + + 70 + + col2 * col2 AS col2 FROM tab0 GROUP BY col0, col2
----
1552
6390
670

onlyif mysql # aggregate syntax: 
query I rowsort label-6692
SELECT DISTINCT COUNT( * ) + - col1 + - col1 + + 59 * + + col1 FROM tab0 GROUP BY col1
----
2
4618

skipif mysql # not compatible
query I rowsort label-6692
SELECT DISTINCT COUNT ( * ) + - col1 + - col1 + + 59 * + + col1 FROM tab0 GROUP BY col1
----
2
4618

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL = NULL
----

query I rowsort
SELECT - 33 FROM tab0 GROUP BY col0, col1 HAVING NOT - 45 / col1 BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col1, col0 HAVING 97 BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col1 - 55 FROM tab0 AS cor0 GROUP BY col1
----
-55
26

onlyif mysql # aggregate syntax: 
query I rowsort label-6697
SELECT ALL + COUNT( * ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING - COUNT( * ) IS NULL AND NOT + col2 <> + + 92 + - col2 + - 85
----

skipif mysql # not compatible
query I rowsort label-6697
SELECT ALL + COUNT ( * ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING - COUNT ( * ) IS NULL AND NOT + col2 <> + + 92 + - col2 + - 85
----

query I rowsort
SELECT AVG ( ALL - - col0 ) FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 40 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
40
40
40

onlyif mysql # aggregate syntax: 
query I rowsort label-6700
SELECT ALL COUNT( * ) + - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN COUNT( * ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6700
SELECT ALL COUNT ( * ) + - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN COUNT ( * ) AND NULL
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NOT + 84 + + col0 IS NOT NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6702
SELECT DISTINCT COUNT( * ) FROM tab2 AS cor0 WHERE NOT + col2 / - col1 * 75 IS NULL GROUP BY col2, col1
----
1

skipif mysql # not compatible
query I rowsort label-6702
SELECT DISTINCT COUNT ( * ) FROM tab2 AS cor0 WHERE NOT + col2 / - col1 * 75 IS NULL GROUP BY col2, col1
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col2 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query II rowsort
SELECT DISTINCT - col2, + col2 FROM tab1 cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

onlyif mysql # aggregate syntax: 
query II rowsort label-6706
SELECT col1 AS col2, - COUNT( * ) * + col1 * 67 FROM tab1 GROUP BY col2, col0, col1
----
44
-2948
57
-3819
6
-402

skipif mysql # not compatible
query II rowsort label-6706
SELECT col1 AS col2, - COUNT ( * ) * + col1 * 67 FROM tab1 GROUP BY col2, col0, col1
----
44
-2948
57
-3819
6
-402

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6707
SELECT DISTINCT CAST( NULL AS SIGNED ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST( NULL AS SIGNED ) ) / 44 + - 73 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6707
SELECT DISTINCT CAST ( NULL AS INTEGER ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST ( NULL AS INTEGER ) ) / 44 + - 73 )
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6708
SELECT + 80 DIV - - 8, + col1 col1 FROM tab2 GROUP BY col1, col2
----
10
41
10
59
10
61

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6708
SELECT + 80 / - - 8, + col1 col1 FROM tab2 GROUP BY col1, col2
----
10
41
10
59
10
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6709
SELECT DISTINCT - col0 * + CAST( NULL AS SIGNED ) FROM tab1 WHERE - col0 NOT BETWEEN - + CAST( NULL AS SIGNED ) * - col1 AND - col1 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-6709
SELECT DISTINCT - col0 * + CAST ( NULL AS INTEGER ) FROM tab1 WHERE - col0 NOT BETWEEN - + CAST ( NULL AS INTEGER ) * - col1 AND - col1 GROUP BY col0, col2
----
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6710
SELECT col1 + col1 - - + CASE WHEN NULL IS NOT NULL THEN NULL WHEN NOT - CAST( NULL AS SIGNED ) IS NOT NULL THEN + COUNT( * ) END * + COALESCE ( + + COUNT( * ), col1 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + - col1 IS NOT NULL
----
115
13
89

skipif mysql # not compatible
query I rowsort label-6710
SELECT col1 + col1 - - + CASE WHEN NULL IS NOT NULL THEN NULL WHEN NOT - CAST ( NULL AS INTEGER ) IS NOT NULL THEN + COUNT ( * ) END * + COALESCE ( + + COUNT ( * ), col1 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + - col1 IS NOT NULL
----
115
13
89

query I rowsort
SELECT ALL - + col1 + + + NULLIF ( + + ( - col1 ), - 28 ) * + + 33 AS col2 FROM tab2 cor0 GROUP BY col2, col0, col1
----
-1394
-2006
-2074

onlyif mysql # aggregate syntax: 
query I rowsort label-6712
SELECT ALL + + COUNT( * ) * COUNT( * ) - + - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
59
80
88

skipif mysql # not compatible
query I rowsort label-6712
SELECT ALL + + COUNT ( * ) * COUNT ( * ) - + - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
59
80
88

onlyif mysql # aggregate syntax: 
query I rowsort label-6713
SELECT 97 * + COUNT( * ) * - col1 col2 FROM tab0 GROUP BY col1
----
-7857
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6713
SELECT 97 * + COUNT ( * ) * - col1 col2 FROM tab0 GROUP BY col1
----
-7857
0

query I rowsort
SELECT DISTINCT + 11 AS col2 FROM tab2 GROUP BY col0 HAVING + col0 + - 36 = + 19
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6715
SELECT ALL - - col1 * + col1 + + - SUM( DISTINCT - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

skipif mysql # not compatible
query I rowsort label-6715
SELECT ALL - - col1 * + col1 + + - SUM ( DISTINCT - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

onlyif mysql # aggregate syntax: 
query I rowsort label-6716
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6716
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT ( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

onlyif mysql # aggregate syntax: 
query I rowsort label-6717
SELECT + SUM( + col2 ) * col1 + + - COUNT( * ) col0 FROM tab2 GROUP BY col2, col1 HAVING 67 * + ( 40 ) * 29 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6717
SELECT + SUM ( + col2 ) * col1 + + - COUNT ( * ) col0 FROM tab2 GROUP BY col2, col1 HAVING 67 * + ( 40 ) * 29 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6718
SELECT ALL ( CAST( AVG ( ALL col2 ) AS SIGNED ) ), - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col2
----
58
-92
79
-91
87
-15

skipif mysql # not compatible
query II rowsort label-6718
SELECT ALL ( CAST ( AVG ( ALL col2 ) AS INTEGER ) ), - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col2
----
58
-92
79
-91
87
-15

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6719
SELECT + col1 + + col1 FROM tab0 GROUP BY col1 HAVING + col1 / 82 / 76 + - 85 + CAST( + - col1 AS SIGNED ) * - - MIN( DISTINCT 38 ) < NULL
----

skipif mysql # not compatible
query I rowsort label-6719
SELECT + col1 + + col1 FROM tab0 GROUP BY col1 HAVING + col1 / 82 / 76 + - 85 + CAST ( + - col1 AS INTEGER ) * - - MIN ( DISTINCT 38 ) < NULL
----

query I rowsort
SELECT DISTINCT + 81 AS col1 FROM tab0 GROUP BY col1, col1 HAVING - - col1 NOT BETWEEN 86 AND NULL
----
81

query I rowsort
SELECT + 36 AS col1 FROM tab0 GROUP BY col0
----
36
36
36

onlyif mysql # aggregate syntax: 
query II rowsort label-6722
SELECT + - COUNT( * ) / + col2 / + ( - 55 ) - COUNT( * ) * + MIN( 45 ) * - col0 + + col2 + col0 AS col1, + col0 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-6722
SELECT + - COUNT ( * ) / + col2 / + ( - 55 ) - COUNT ( * ) * + MIN ( 45 ) * - col0 + + col2 + col0 AS col1, + col0 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 31 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
2821
2852
465

onlyif mysql # aggregate syntax: 
query I rowsort label-6724
SELECT + - MAX( - col2 ) - col2 + + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-6724
SELECT + - MAX ( - col2 ) - col2 + + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query II rowsort
SELECT - col1 AS col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6726
SELECT - SUM( DISTINCT + 60 ) FROM tab1 cor0 GROUP BY col2
----
-60
-60
-60

skipif mysql # not compatible
query I rowsort label-6726
SELECT - SUM ( DISTINCT + 60 ) FROM tab1 cor0 GROUP BY col2
----
-60
-60
-60

onlyif mysql # aggregate syntax: 
query I rowsort label-6727
SELECT MAX( col2 ) FROM tab1 GROUP BY col2 HAVING + - ( col2 ) BETWEEN + col2 AND NULL
----

skipif mysql # not compatible
query I rowsort label-6727
SELECT MAX ( col2 ) FROM tab1 GROUP BY col2 HAVING + - ( col2 ) BETWEEN + col2 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6728
SELECT ( + - CAST( NULL AS SIGNED ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6728
SELECT ( + - CAST ( NULL AS INTEGER ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6730
SELECT + 68 * SUM( 84 ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
5712
5712
5712

skipif mysql # not compatible
query I rowsort label-6730
SELECT + 68 * SUM ( 84 ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
5712
5712
5712

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab1 GROUP BY col2 HAVING NULL < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6732
SELECT CAST( NULL AS SIGNED ) / - col0 FROM tab0 AS cor0 WHERE NOT col2 * + + col1 * + 34 IS NULL GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6732
SELECT CAST ( NULL AS INTEGER ) / - col0 FROM tab0 AS cor0 WHERE NOT col2 * + + col1 * + 34 IS NULL GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 92 FROM tab0 AS cor0 GROUP BY col1, col0
----
92

query II rowsort
SELECT ALL col2, - 68 AS col1 FROM tab2 AS cor0 WHERE NOT + col2 NOT BETWEEN ( + col1 * + + col1 ) AND col0 GROUP BY col2
----

query I rowsort
SELECT ALL + 62 FROM tab1 AS cor0 GROUP BY col1
----
62
62
62

query I rowsort
SELECT ALL - col1 * + col1 + - 28 FROM tab1 AS cor0 GROUP BY col1
----
-1964
-3277
-64

onlyif mysql # aggregate syntax: 
query I rowsort label-6737
SELECT ALL + 12 + - 55 + COUNT( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-41
-42

skipif mysql # not compatible
query I rowsort label-6737
SELECT ALL + 12 + - 55 + COUNT ( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-41
-42

onlyif mysql # aggregate syntax: 
query I rowsort label-6738
SELECT COUNT( * ) + COUNT( * ) FROM tab2 GROUP BY col0, col2
----
2
2
2

skipif mysql # not compatible
query I rowsort label-6738
SELECT COUNT ( * ) + COUNT ( * ) FROM tab2 GROUP BY col0, col2
----
2
2
2

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col1, col2
----
-45
-71
-8

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * ( 67 ) AS col1 FROM tab0 GROUP BY col2, col2, col2 HAVING NULL = + col2
----

query I rowsort
SELECT - ( col2 ) + - ( + 56 ) FROM tab0 GROUP BY col2
----
-135
-80
-94

query I rowsort
SELECT ALL 84 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
84
84
84

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6744
SELECT ALL - col0 + + 13 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING - - CAST( NULL AS SIGNED ) + + + col0 IS NULL
----
-13
-30
-70

skipif mysql # not compatible
query I rowsort label-6744
SELECT ALL - col0 + + 13 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING - - CAST ( NULL AS INTEGER ) + + + col0 IS NULL
----
-13
-30
-70

query I rowsort
SELECT ALL - + col1 * + 21 FROM tab0 cor0 GROUP BY col1
----
-1701
0

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE NOT col2 > NULL GROUP BY col2, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6747
SELECT ALL + + ( + + COUNT( * ) ) FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6747
SELECT ALL + + ( + + COUNT ( * ) ) FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-6748
SELECT DISTINCT + + col2 + MAX( + - col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-6748
SELECT DISTINCT + + col2 + MAX ( + - col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 57 AS col0 FROM tab2 WHERE NOT NULL <> 12 + 35 * + col1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL 23 * - col2 AS col2 FROM tab0 GROUP BY col2
----
-1817
-552
-874

onlyif mysql # aggregate syntax: 
query II rowsort label-6751
SELECT + + col0, 89 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - NULLIF ( + COUNT( * ), COUNT( * ) ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-6751
SELECT + + col0, 89 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - NULLIF ( + COUNT ( * ), COUNT ( * ) ) IS NULL
----

query I rowsort
SELECT DISTINCT - 40 + + - col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT ( NULL ) BETWEEN 91 AND NULL
----

query I rowsort
SELECT + ( col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL = NULL )
----

query I rowsort
SELECT DISTINCT - 42 * - + col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL <= - 49 / + col2
----

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - + 32 NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6756
SELECT - MAX( - + col0 ) + + col0 * + + 74 FROM tab1 cor0 GROUP BY col0
----
1650
2100
6150

skipif mysql # not compatible
query I rowsort label-6756
SELECT - MAX ( - + col0 ) + + col0 * + + 74 FROM tab1 cor0 GROUP BY col0
----
1650
2100
6150

onlyif mysql # aggregate syntax: 
query I rowsort label-6757
SELECT ALL COUNT( DISTINCT - - CASE - + col0 WHEN - 75 * col2 THEN + 20 * 76 - + - col1 / + - col0 ELSE NULL END ) + - 98 FROM tab0 GROUP BY col0
----
-98
-98
-98

skipif mysql # not compatible
query I rowsort label-6757
SELECT ALL COUNT ( DISTINCT - - CASE - + col0 WHEN - 75 * col2 THEN + 20 * 76 - + - col1 / + - col0 ELSE NULL END ) + - 98 FROM tab0 GROUP BY col0
----
-98
-98
-98

query I rowsort
SELECT ALL 55 FROM tab0 GROUP BY col1
----
55
55

query II rowsort
SELECT col1 AS col2, col1 FROM tab0 GROUP BY col1, col0
----
0
0
0
0
81
81

query I rowsort
SELECT DISTINCT col1 + + col1 AS col0 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + - 80 * + col1 * - 26 + - col1 * + - col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
12696
176704
303753

query I rowsort
SELECT - 88 FROM tab2 AS cor0 GROUP BY col1
----
-88
-88
-88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - ( + ( 17 ) ) col1 FROM tab1 AS cor0 GROUP BY col2
----
-17

query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 WHERE NOT + 98 IS NOT NULL GROUP BY col2, col0
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6765
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT + 29 - col1 * - - col0 + + + 54 IS NULL GROUP BY col2, col1, col0 HAVING NOT MAX( ALL 13 ) - - - 33 <= + SUM( ALL col1 ) + - CAST( SUM( DISTINCT col2 ) AS DECIMAL )
----
44

skipif mysql # not compatible
query I rowsort label-6765
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT + 29 - col1 * - - col0 + + + 54 IS NULL GROUP BY col2, col1, col0 HAVING NOT MAX ( ALL 13 ) - - - 33 <= + SUM ( ALL col1 ) + - CAST ( SUM ( DISTINCT col2 ) AS REAL )
----
44

query I rowsort
SELECT ( + col2 ) * + col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

onlyif mysql # aggregate syntax: 
query II rowsort label-6767
SELECT COUNT( * ) + + 79 + + 50, - 52 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-6767
SELECT COUNT ( * ) + + 79 + + 50, - 52 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 13 FROM tab0 GROUP BY col1
----
13
13

onlyif mysql # DIV for integer division: 
query I rowsort label-6769
SELECT DISTINCT col0 + - col0 * col0 DIV - NULLIF ( - 49, - col0 ) FROM tab0 GROUP BY col0, col0
----
-57
13
6

skipif mysql # not compatible
query I rowsort label-6769
SELECT DISTINCT col0 + - col0 * col0 / - NULLIF ( - 49, - col0 ) FROM tab0 GROUP BY col0, col0
----
-57
13
6

query I rowsort
SELECT ( col0 ) AS col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col0 + - + 15 AS col1 FROM tab0 GROUP BY col0, col1
----
11
28
68

query I rowsort
SELECT col2 * + 45 FROM tab0 GROUP BY col1, col2
----
1080
1710
3555

query I rowsort
SELECT - + col1 * + col1 + + 37 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1644
-3444
-3684

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 33 * col0 col2 FROM tab2 cor0 GROUP BY col0
----
3003
3036
495

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6775
SELECT CAST( + col1 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-6775
SELECT CAST ( + col1 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT ALL + + col2 AS col1, 28 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
28
79
28
87
28

query II rowsort
SELECT + 26, col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
26
15
26
91
26
92

query I rowsort
SELECT DISTINCT col0 + + COALESCE ( - col0, - COALESCE ( + 41, col0 ) ) FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6779
SELECT DISTINCT 93 AS col1, 35 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NOT - col0 NOT BETWEEN + + NULLIF ( + SUM( col0 ), + col2 + - - 10 + 31 * col2 ) AND - NULLIF ( - MIN( ALL + 39 ), - + 26 )
----

skipif mysql # not compatible
query II rowsort label-6779
SELECT DISTINCT 93 AS col1, 35 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NOT - col0 NOT BETWEEN + + NULLIF ( + SUM ( col0 ), + col2 + - - 10 + 31 * col2 ) AND - NULLIF ( - MIN ( ALL + 39 ), - + 26 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 AS col2, col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) = - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 GROUP BY col1 HAVING - 77 - 52 IS NOT NULL
----
44
57
6

query II rowsort
SELECT ALL - 73 * - - col2 AS col1, col0 FROM tab1 GROUP BY col2, col0
----
-3285
28
-5183
82
-584
22

onlyif mysql # aggregate syntax: 
query I rowsort label-6783
SELECT DISTINCT - + 86 + - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - ( - 22 ) NOT BETWEEN ( - + COUNT( * ) ) * - - col0 - + AVG ( + - col2 ) AND 37
----
-129
-169

skipif mysql # not compatible
query I rowsort label-6783
SELECT DISTINCT - + 86 + - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - ( - 22 ) NOT BETWEEN ( - + COUNT ( * ) ) * - - col0 - + AVG ( + - col2 ) AND 37
----
-129
-169

query I rowsort
SELECT DISTINCT col2 + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
105
121
67

onlyif mysql # aggregate syntax: 
query I rowsort label-6785
SELECT + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6785
SELECT + - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-6786
SELECT + 41 FROM tab0 GROUP BY col0 HAVING NOT + - col0 >= - + ( + COUNT( * ) )
----
41
41
41

skipif mysql # not compatible
query I rowsort label-6786
SELECT + 41 FROM tab0 GROUP BY col0 HAVING NOT + - col0 >= - + ( + COUNT ( * ) )
----
41
41
41

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6788
SELECT - 64 + + - COUNT( * ) DIV + 45 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-64
-64
-64

skipif mysql # not compatible
query I rowsort label-6788
SELECT - 64 + + - COUNT ( * ) / + 45 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-64
-64
-64

onlyif mysql # DIV for integer division: 
query II rowsort label-6789
SELECT DISTINCT - 54 DIV 27 AS col0, 74 FROM tab0 GROUP BY col0, col0
----
-2
74

skipif mysql # not compatible
query II rowsort label-6789
SELECT DISTINCT - 54 / 27 AS col0, 74 FROM tab0 GROUP BY col0, col0
----
-2
74

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + NULLIF ( col0, - - 92 ) AS col2 FROM tab1 GROUP BY col0 HAVING NULL < - col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
44
57
6

query I rowsort
SELECT ALL + 93 FROM tab1 AS cor0 GROUP BY col1 HAVING + 64 <> col1
----
93
93
93

query II rowsort
SELECT ALL + + NULLIF ( + col2, col2 ) AS col2, - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
-45
NULL
-71
NULL
-8

query I rowsort
SELECT - + 34 FROM tab0 WHERE ( NOT ( NULL ) < ( + ( - + col2 ) ) * col1 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 WHERE NOT + col0 * - + 10 - + col0 IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 * - col0 FROM tab0 GROUP BY col2, col0, col2
----
-1032
-2054
-3154

onlyif mysql # aggregate syntax: 
query II rowsort label-6797
SELECT COUNT( * ), + COUNT( * ) FROM tab1 GROUP BY col0, col0
----
1
1
1
1
1
1

skipif mysql # not compatible
query II rowsort label-6797
SELECT COUNT ( * ), + COUNT ( * ) FROM tab1 GROUP BY col0, col0
----
1
1
1
1
1
1

query I rowsort
SELECT + 15 * + - col0 AS col2 FROM tab1 WHERE - + col2 <= NULL GROUP BY col0
----

query I rowsort
SELECT col0 + ( - - 81 ) * + 90 * + col0 FROM tab1 GROUP BY col2, col0
----
160402
204148
597862

onlyif mysql # aggregate syntax: 
query I rowsort label-6800
SELECT ALL + COUNT( ALL + col0 ) FROM tab2 WHERE + 82 <= NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-6800
SELECT ALL + COUNT ( ALL + col0 ) FROM tab2 WHERE + 82 <= NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6801
SELECT DISTINCT + 84, - CAST( 10 AS SIGNED ) col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT col1 IS NULL
----
84
-10

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6801
SELECT DISTINCT + 84, - CAST ( 10 AS INTEGER ) col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT col1 IS NULL
----
84
-10

query I rowsort
SELECT ALL - 1 * + col0 AS col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-6803
SELECT ALL + col0 * 28 + + col0 - col0 * - - 75 * col0 * + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6803
SELECT ALL + col0 * 28 + + col0 - col0 * - - 75 * col0 * + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> + COUNT ( * )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6804
SELECT COUNT( * ) + 39 FROM tab1 cor0 WHERE NOT - CAST( NULL AS SIGNED ) IS NOT NULL GROUP BY col2, col1
----
40
40
40

skipif mysql # not compatible
query I rowsort label-6804
SELECT COUNT ( * ) + 39 FROM tab1 cor0 WHERE NOT - CAST ( NULL AS INTEGER ) IS NOT NULL GROUP BY col2, col1
----
40
40
40

onlyif mysql # aggregate syntax: 
query I rowsort label-6805
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING 46 + + col2 NOT BETWEEN - - COUNT( * ) AND ( - 62 * + col2 )
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-6805
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING 46 + + col2 NOT BETWEEN - - COUNT ( * ) AND ( - 62 * + col2 )
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-6806
SELECT DISTINCT COUNT( * ) FROM tab0 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-6806
SELECT DISTINCT COUNT ( * ) FROM tab0 GROUP BY col1
----
1
2

query I rowsort
SELECT col1 + + + col0 AS col2 FROM tab1 GROUP BY col1, col0
----
126
28
85

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6808
SELECT - COALESCE ( - + 77, + COUNT( + col0 ), + + 2 + - + col1 - col2 + - SUM( DISTINCT - + 97 ) + - - col1 DIV - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6808
SELECT - COALESCE ( - + 77, + COUNT ( + col0 ), + + 2 + - + col1 - col2 + - SUM ( DISTINCT - + 97 ) + - - col1 / - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6809
SELECT + col2 FROM tab1 AS cor0 WHERE NULL <> - CAST( NULL AS SIGNED ) - - col0 * + col0 GROUP BY col2 HAVING + col2 * + col2 + + - 59 + + + 65 >= 42 * - ( + 56 )
----

skipif mysql # not compatible
query I rowsort label-6809
SELECT + col2 FROM tab1 AS cor0 WHERE NULL <> - CAST ( NULL AS INTEGER ) - - col0 * + col0 GROUP BY col2 HAVING + col2 * + col2 + + - 59 + + + 65 >= 42 * - ( + 56 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6810
SELECT ALL + NULLIF ( + 17, - col1 * col1 + COUNT( * ) ) AS col0 FROM tab0 GROUP BY col2, col2, col1
----
17
17
17

skipif mysql # not compatible
query I rowsort label-6810
SELECT ALL + NULLIF ( + 17, - col1 * col1 + COUNT ( * ) ) AS col0 FROM tab0 GROUP BY col2, col2, col1
----
17
17
17

query I rowsort
SELECT ALL + 68 FROM tab2 AS cor0 WHERE + 45 * + 91 IN ( + col0, col2 + + col2 ) GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 cor0 GROUP BY col1, col0, col0
----
41
59
61

onlyif mysql # aggregate syntax: 
query I rowsort label-6813
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING col0 NOT BETWEEN NULL AND + COUNT( * )
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-6813
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING col0 NOT BETWEEN NULL AND + COUNT ( * )
----
-24
-38
-79

query I rowsort
SELECT - col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-484
-6724
-784

onlyif mysql # aggregate syntax: 
query I rowsort label-6815
SELECT - MAX( DISTINCT 55 ) FROM tab2 AS cor0 GROUP BY col2, col2
----
-55
-55
-55

skipif mysql # not compatible
query I rowsort label-6815
SELECT - MAX ( DISTINCT 55 ) FROM tab2 AS cor0 GROUP BY col2, col2
----
-55
-55
-55

query I rowsort
SELECT + col0 + + - 17 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
1494
468
774

query II rowsort
SELECT ALL col0, + col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL col2 - col2 FROM tab2 WHERE NOT col2 / + 32 <= NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6819
SELECT COUNT( * ) - - col2 + COUNT( * ) + COUNT( * ) * - - col1 col0 FROM tab1 GROUP BY col1, col2 HAVING + + col1 IS NOT NULL
----
104
117
16

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6819
SELECT COUNT ( * ) - - col2 + COUNT ( * ) + COUNT ( * ) * - - col1 col0 FROM tab1 GROUP BY col1, col2 HAVING + + col1 IS NOT NULL
----
104
117
16

query I rowsort
SELECT ALL col0 + + 95 - + col0 * - col0 FROM tab0 GROUP BY col0
----
1987
7067
797

onlyif mysql # aggregate syntax: 
query I rowsort label-6821
SELECT COUNT( * ) * - 49 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL <> NULL
----

skipif mysql # not compatible
query I rowsort label-6821
SELECT COUNT ( * ) * - 49 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6822
SELECT DISTINCT CAST( - COUNT( * ) AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - - ( + + 2 ) IS NULL
----
-1

skipif mysql # not compatible
query I rowsort label-6822
SELECT DISTINCT CAST ( - COUNT ( * ) AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - - ( + + 2 ) IS NULL
----
-1

query I rowsort
SELECT - ( + col1 ) AS col1 FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6824
SELECT + SUM( DISTINCT 91 ) FROM tab0 GROUP BY col2
----
91
91
91

skipif mysql # not compatible
query I rowsort label-6824
SELECT + SUM ( DISTINCT 91 ) FROM tab0 GROUP BY col2
----
91
91
91

query I rowsort
SELECT - - col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 52 AS col0 FROM tab0 GROUP BY col0, col2
----
52
52
52

onlyif mysql # aggregate syntax: 
query I rowsort label-6827
SELECT - col2 * + 56 AS col0 FROM tab2 GROUP BY col2, col1 HAVING - 1 * COUNT( ALL - col2 ) + - NULLIF ( - col2, + + col2 / - col1 * - - 36 + + MAX( ALL 41 ) ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-6827
SELECT - col2 * + 56 AS col0 FROM tab2 GROUP BY col2, col1 HAVING - 1 * COUNT ( ALL - col2 ) + - NULLIF ( - col2, + + col2 / - col1 * - - 36 + + MAX ( ALL 41 ) ) >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6828
SELECT DISTINCT col0 * + - col0 * - - 49 * - NULLIF ( + col0, + + 98 ) FROM tab1 GROUP BY col0 HAVING NOT + CAST( NULL AS SIGNED ) IS NOT NULL
----
1075648
27017032
521752

skipif mysql # not compatible
query I rowsort label-6828
SELECT DISTINCT col0 * + - col0 * - - 49 * - NULLIF ( + col0, + + 98 ) FROM tab1 GROUP BY col0 HAVING NOT + CAST ( NULL AS INTEGER ) IS NOT NULL
----
1075648
27017032
521752

query I rowsort
SELECT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6830
SELECT ALL + col1 + - COUNT( ALL - col1 ) AS col2, - COUNT( * ) DIV + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING - col1 IS NOT NULL
----
43
0
5
0
56
0

skipif mysql # not compatible
query II rowsort label-6830
SELECT ALL + col1 + - COUNT ( ALL - col1 ) AS col2, - COUNT ( * ) / + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING - col1 IS NOT NULL
----
43
0
5
0
56
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + + 49 col0, + col1 + - 35 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
49
-35
49
-35
49
46

query I rowsort
SELECT ( + + col1 ) AS col2 FROM tab1 GROUP BY col2, col1
----
44
57
6

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6833
SELECT DISTINCT 29 + - - COUNT( * ) DIV - ( col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
29

skipif mysql # not compatible
query I rowsort label-6833
SELECT DISTINCT 29 + - - COUNT ( * ) / - ( col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
29

onlyif mysql # aggregate syntax: 
query I rowsort label-6834
SELECT + COUNT( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6834
SELECT + COUNT ( * ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT 83 FROM tab0 GROUP BY col0
----
83
83
83

onlyif mysql # aggregate syntax: 
query I rowsort label-6836
SELECT ALL + COUNT( * ) FROM tab2 cor0 WHERE NULL NOT BETWEEN - col2 * - 90 * ( + + col0 ) / + col2 - - ( - 71 ) AND NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-6836
SELECT ALL + COUNT ( * ) FROM tab2 cor0 WHERE NULL NOT BETWEEN - col2 * - 90 * ( + + col0 ) / + col2 - - ( - 71 ) AND NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6837
SELECT + col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6837
SELECT + col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6838
SELECT ALL - - col0 * - COUNT( * ) + - 15 FROM tab2 cor0 GROUP BY col0
----
-106
-107
-30

skipif mysql # not compatible
query I rowsort label-6838
SELECT ALL - - col0 * - COUNT ( * ) + - 15 FROM tab2 cor0 GROUP BY col0
----
-106
-107
-30

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-6840
SELECT col2 + - - COUNT( * ) FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN col2 / CAST( - + col2 AS DECIMAL ) AND + 14 GROUP BY col2, col2, col2
----

skipif mysql # not compatible
query I rowsort label-6840
SELECT col2 + - - COUNT ( * ) FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN col2 / CAST ( - + col2 AS REAL ) AND + 14 GROUP BY col2, col2, col2
----

query I rowsort
SELECT ALL - 22 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-22
-22
-22

query I rowsort
SELECT + col0 + - 82 FROM tab1 GROUP BY col0, col2
----
-54
-60
0

query II rowsort
SELECT 4 AS col1, col0 FROM tab2 GROUP BY col2, col0, col1
----
4
15
4
91
4
92

query I rowsort
SELECT DISTINCT ( 32 ) AS col0 FROM tab2 GROUP BY col1, col0 HAVING col1 BETWEEN - + col1 AND - + 66 * - - col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6845
SELECT + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6845
SELECT + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1, col0
----
NULL
NULL
NULL

query II rowsort
SELECT col2, + 51 FROM tab2 cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
51
79
51
87
51

query I rowsort
SELECT + 33 * 92 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6848
SELECT ALL - col0 + col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULLIF ( 75, + col0 * - col2 * 95 ) IS NOT NULL GROUP BY col0 HAVING NOT - - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6848
SELECT ALL - col0 + col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULLIF ( 75, + col0 * - col2 * 95 ) IS NOT NULL GROUP BY col0 HAVING NOT - - COUNT ( * ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 93 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-93
-93
-93

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6851
SELECT DISTINCT + + 65 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - MIN( ALL - 74 ) IS NULL
----
65

skipif mysql # not compatible
query I rowsort label-6851
SELECT DISTINCT + + 65 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - MIN ( ALL - 74 ) IS NULL
----
65

onlyif mysql # aggregate syntax: 
query I rowsort label-6852
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > - MIN( DISTINCT ( 96 ) )
----

skipif mysql # not compatible
query I rowsort label-6852
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > - MIN ( DISTINCT ( 96 ) )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query II rowsort label-6853
SELECT col0 DIV - - 20 col1, + COUNT( * ) + + ( CAST( NULL AS SIGNED ) ) FROM tab2 AS cor0 GROUP BY col0
----
0
NULL
4
NULL
4
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6853
SELECT col0 / - - 20 col1, + COUNT ( * ) + + ( CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col0
----
0
NULL
4
NULL
4
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6854
SELECT ALL - col2 * + CAST( - 1 AS SIGNED ) + - - 9 * + col2 col1 FROM tab0 GROUP BY col2
----
240
380
790

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6854
SELECT ALL - col2 * + CAST ( - 1 AS INTEGER ) + - - 9 * + col2 col1 FROM tab0 GROUP BY col2
----
240
380
790

query I rowsort
SELECT ALL col2 * - ( - col2 ) AS col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + 27 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND col0
----

query I rowsort
SELECT 48 FROM tab2 GROUP BY col0, col0 HAVING + 58 IS NOT NULL
----
48
48
48

onlyif mysql # aggregate syntax: 
query I rowsort label-6858
SELECT ALL - MAX( ALL col1 ) * + col1 FROM tab0 GROUP BY col0, col1, col1
----
-6561
0
0

skipif mysql # not compatible
query I rowsort label-6858
SELECT ALL - MAX ( ALL col1 ) * + col1 FROM tab0 GROUP BY col0, col1, col1
----
-6561
0
0

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6860
SELECT DISTINCT + 72 + - col0 FROM tab0 GROUP BY col0, col1, col0 HAVING NOT NULL BETWEEN ( COUNT( * ) ) AND - 87
----

skipif mysql # not compatible
query I rowsort label-6860
SELECT DISTINCT + 72 + - col0 FROM tab0 GROUP BY col0, col1, col0 HAVING NOT NULL BETWEEN ( COUNT ( * ) ) AND - 87
----

query I rowsort
SELECT ALL - 57 AS col1 FROM tab2 GROUP BY col0
----
-57
-57
-57

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6862
SELECT 14 * - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6862
SELECT 14 * - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6863
SELECT DISTINCT + col0 + - COUNT( * ) AS col2 FROM tab1 GROUP BY col0, col1
----
21
27
81

skipif mysql # not compatible
query I rowsort label-6863
SELECT DISTINCT + col0 + - COUNT ( * ) AS col2 FROM tab1 GROUP BY col0, col1
----
21
27
81

query I rowsort
SELECT + ( + col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( + ( 12 ) - + 22 ) < 12 - AVG ( DISTINCT col2 )
----
45
71

onlyif mysql # aggregate syntax: 
query I rowsort label-6865
SELECT ALL col0 * - col0 FROM tab0 GROUP BY col0 HAVING NOT 30 + 20 / COUNT( DISTINCT - col0 ) IS NULL
----
-1849
-676
-6889

skipif mysql # not compatible
query I rowsort label-6865
SELECT ALL col0 * - col0 FROM tab0 GROUP BY col0 HAVING NOT 30 + 20 / COUNT ( DISTINCT - col0 ) IS NULL
----
-1849
-676
-6889

query I rowsort
SELECT - 62 AS col1 FROM tab0 GROUP BY col0 HAVING NOT 19 * col0 IS NULL
----
-62
-62
-62

onlyif mysql # aggregate syntax: 
query I rowsort label-6867
SELECT - col1 FROM tab1 GROUP BY col1 HAVING COUNT( * ) * + col1 IS NOT NULL
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-6867
SELECT - col1 FROM tab1 GROUP BY col1 HAVING COUNT ( * ) * + col1 IS NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * col1 + col1 * - 95 FROM tab2 WHERE NOT NULL = col0 GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6871
SELECT ALL ( COUNT( * ) ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING 61 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6871
SELECT ALL ( COUNT ( * ) ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING 61 IS NULL
----

query I rowsort
SELECT - col1 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0

query I rowsort
SELECT - ( 74 ) - 72 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-146
-146
-146

onlyif mysql # aggregate syntax: 
query I rowsort label-6874
SELECT ALL COUNT( * ) * + col1 + 38 * - col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
-2163
-2943
-3245

skipif mysql # not compatible
query I rowsort label-6874
SELECT ALL COUNT ( * ) * + col1 + 38 * - col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
-2163
-2943
-3245

onlyif mysql # aggregate syntax: 
query I rowsort label-6875
SELECT MAX( DISTINCT col0 ) * 72 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1872
3096
5976

skipif mysql # not compatible
query I rowsort label-6875
SELECT MAX ( DISTINCT col0 ) * 72 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1872
3096
5976

onlyif mysql # DIV for integer division: 
query I rowsort label-6876
SELECT col0 DIV col0 + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + 45 IS NOT NULL
----
23
29
83

skipif mysql # not compatible
query I rowsort label-6876
SELECT col0 / col0 + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + 45 IS NOT NULL
----
23
29
83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6877
SELECT 67 FROM tab2 cor0 GROUP BY col1 HAVING - CAST( NULL AS SIGNED ) NOT BETWEEN ( - MAX( DISTINCT + 48 ) ) AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6877
SELECT 67 FROM tab2 cor0 GROUP BY col1 HAVING - CAST ( NULL AS INTEGER ) NOT BETWEEN ( - MAX ( DISTINCT + 48 ) ) AND ( NULL )
----

query I rowsort
SELECT - 72 + col2 FROM tab0 cor0 GROUP BY col2
----
-34
-48
7

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6879
SELECT 83 + - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NOT + CAST( NULL AS SIGNED ) BETWEEN NULL AND + col1
----

skipif mysql # not compatible
query I rowsort label-6879
SELECT 83 + - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NOT + CAST ( NULL AS INTEGER ) BETWEEN NULL AND + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 51 col2 FROM tab1 AS cor0 GROUP BY col2
----
-51

onlyif mysql # aggregate syntax: 
query I rowsort label-6882
SELECT - + SUM( DISTINCT - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6882
SELECT - + SUM ( DISTINCT - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT 0 + col2 * + 25 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 + + col2 IS NULL
----
1975
600
950

onlyif mysql # aggregate syntax: 
query I rowsort label-6884
SELECT SUM( + col1 ) * + COUNT( * ) + col1 FROM tab1 GROUP BY col1
----
114
12
88

skipif mysql # not compatible
query I rowsort label-6884
SELECT SUM ( + col1 ) * + COUNT ( * ) + col1 FROM tab1 GROUP BY col1
----
114
12
88

onlyif mysql # aggregate syntax: 
query I rowsort label-6885
SELECT + 81 + CASE ( + COUNT( DISTINCT 5 ) ) WHEN COUNT( * ) * col0 THEN 76 END AS col2 FROM tab0 GROUP BY col0 HAVING col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6885
SELECT + 81 + CASE ( + COUNT ( DISTINCT 5 ) ) WHEN COUNT ( * ) * col0 THEN 76 END AS col2 FROM tab0 GROUP BY col0 HAVING col0 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6886
SELECT - col2 * COUNT( * ) - ( col2 + - COUNT( * ) ) * col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) < ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6886
SELECT - col2 * COUNT ( * ) - ( col2 + - COUNT ( * ) ) * col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) < ( NULL )
----

query I rowsort
SELECT col0 AS col1 FROM tab2 WHERE NOT + 3 IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - + col1 + - col1 * 42 FROM tab0 AS cor0 GROUP BY col1
----
-3483
0

query I rowsort
SELECT ( + col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING - AVG ( col2 ) IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6890
SELECT ALL 92 * - 83 FROM tab2 AS cor0 WHERE NOT NULL <> - CAST( - col0 AS DECIMAL ) GROUP BY col2 HAVING - 7 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6890
SELECT ALL 92 * - 83 FROM tab2 AS cor0 WHERE NOT NULL <> - CAST ( - col0 AS REAL ) GROUP BY col2 HAVING - 7 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6891
SELECT + COUNT( DISTINCT + 9 ) + + col1 - col1 AS col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT + col1 IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6891
SELECT + COUNT ( DISTINCT + 9 ) + + col1 - col1 AS col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT + col1 IS NULL
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-6892
SELECT col0 AS col1 FROM tab0 AS cor0 WHERE + col2 * col2 IS NULL GROUP BY col0 HAVING - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6892
SELECT col0 AS col1 FROM tab0 AS cor0 WHERE + col2 * col2 IS NULL GROUP BY col0 HAVING - COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - ( col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL col2 - - ( - + 29 ) + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
129
145
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6895
SELECT + - ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING 80 / + 57 + 29 NOT BETWEEN - 36 AND ( CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-6895
SELECT + - ( + col0 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING 80 / + 57 + 29 NOT BETWEEN - 36 AND ( CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT + - 33 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-1914
-2607
-2871

query I rowsort
SELECT - col0 + - 91 AS col2 FROM tab0 cor0 GROUP BY col0, col2 HAVING NOT ( 21 ) NOT IN ( - ( 67 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6898
SELECT DISTINCT - CAST( NULL AS SIGNED ) * - - col1 FROM tab2 GROUP BY col1, col2, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-6898
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * - - col1 FROM tab2 GROUP BY col1, col2, col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6899
SELECT col1 * 21 col1 FROM tab0 GROUP BY col1 HAVING NOT ( + CAST( NULL AS SIGNED ) ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6899
SELECT col1 * 21 col1 FROM tab0 GROUP BY col1 HAVING NOT ( + CAST ( NULL AS INTEGER ) ) IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab2 WHERE NOT - col0 + + ( col1 ) * col0 IS NOT NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6901
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT COUNT( - col2 ) + + 97 * + col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6901
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT COUNT ( - col2 ) + + 97 * + col1 IS NOT NULL
----

query I rowsort
SELECT 87 AS col2 FROM tab0 GROUP BY col1
----
87
87

query I rowsort
SELECT DISTINCT + ( + 6 ) + + col2 FROM tab2 cor0 GROUP BY col1, col2
----
64
85
93

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + NULLIF ( 52, + col1 ) col1 FROM tab2 GROUP BY col1
----
2132
3068
3172

onlyif mysql # aggregate syntax: 
query I rowsort label-6906
SELECT COUNT( * ) FROM tab0 AS cor0 WHERE NOT - col2 - - col2 + + + col2 NOT IN ( + - 75 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6906
SELECT COUNT ( * ) FROM tab0 AS cor0 WHERE NOT - col2 - - col2 + + + col2 NOT IN ( + - 75 ) GROUP BY col2
----

query I rowsort
SELECT - 85 AS col2 FROM tab0 GROUP BY col1
----
-85
-85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 WHERE NOT - NULLIF ( + - 18, col1 ) - + col2 - + 27 IS NULL GROUP BY col2, col1
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-6909
SELECT DISTINCT + col0 col1 FROM tab1 GROUP BY col0 HAVING NOT ( + - COUNT( ALL - col2 ) * COUNT( * ) + - ( + 20 ) ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6909
SELECT DISTINCT + col0 col1 FROM tab1 GROUP BY col0 HAVING NOT ( + - COUNT ( ALL - col2 ) * COUNT ( * ) + - ( + 20 ) ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6910
SELECT + COUNT( * ) FROM tab2 cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6910
SELECT + COUNT ( * ) FROM tab2 cor0 GROUP BY col0
----
1
1
1

onlyif mysql # aggregate syntax: 
query II rowsort label-6911
SELECT ALL COUNT( * ) AS col2, - 31 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - 38 IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-6911
SELECT ALL COUNT ( * ) AS col2, - 31 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - 38 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 * col1 * col1 - - col1 * - 88 * col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL > 37
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6913
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST( + 47 AS SIGNED ) ) ) THEN - col1 * + col2 END DIV - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6913
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST ( + 47 AS INTEGER ) ) ) THEN - col1 * + col2 END / - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

query I rowsort
SELECT DISTINCT 59 FROM tab0 WHERE NULL BETWEEN - 65 AND 99 * col2 GROUP BY col2
----

query I rowsort
SELECT 10 / - 45 * - 99 + ( + col2 ) AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2 HAVING NULL NOT BETWEEN ( + col2 ) AND 64 + col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6916
SELECT ALL - + COUNT( * ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6916
SELECT ALL - + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT 46 + + 73 FROM tab0 AS cor0 GROUP BY col0, col0
----
119

onlyif mysql # aggregate syntax: 
query I rowsort label-6918
SELECT - - COUNT( * ) - - col1 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
163
2

skipif mysql # not compatible
query I rowsort label-6918
SELECT - - COUNT ( * ) - - col1 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
163
2

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6919
SELECT ALL - CAST( COUNT( * ) AS SIGNED ) DIV + + col0 - - NULLIF ( - 25, - - 25 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
-25
-25
-25

skipif mysql # not compatible
query I rowsort label-6919
SELECT ALL - CAST ( COUNT ( * ) AS INTEGER ) / + + col0 - - NULLIF ( - 25, - - 25 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
-25
-25
-25

query I rowsort
SELECT + col1 + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT ( 30 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6921
SELECT DISTINCT col0 * + ( + COALESCE ( - ( + + col0 ), - COUNT( * ) ) ) + col0 - 86 DIV col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-465
-6643
-759

skipif mysql # not compatible
query I rowsort label-6921
SELECT DISTINCT col0 * + ( + COALESCE ( - ( + + col0 ), - COUNT ( * ) ) ) + col0 - 86 / col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-465
-6643
-759

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6922
SELECT DISTINCT - 66 AS col1 FROM tab2 WHERE NULL IN ( CAST( NULL AS SIGNED ), 85 ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-6922
SELECT DISTINCT - 66 AS col1 FROM tab2 WHERE NULL IN ( CAST ( NULL AS INTEGER ), 85 ) GROUP BY col0
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6923
SELECT ALL + col1 DIV 78 * + COUNT( * ) + COUNT( * ) * + + ( - - 35 ) FROM tab0 GROUP BY col0, col0, col1
----
35
35
36

skipif mysql # not compatible
query I rowsort label-6923
SELECT ALL + col1 / 78 * + COUNT ( * ) + COUNT ( * ) * + + ( - - 35 ) FROM tab0 GROUP BY col0, col0, col1
----
35
35
36

query I rowsort
SELECT DISTINCT ( - + col1 ) FROM tab0 GROUP BY col1, col0 HAVING + ( col1 ) IN ( 92 )
----

query I rowsort
SELECT - 66 AS col0 FROM tab2 GROUP BY col2, col2
----
-66
-66
-66

onlyif mysql # aggregate syntax: 
query I rowsort label-6926
SELECT COUNT( * ) + - 96 FROM tab0 GROUP BY col0, col0
----
-95
-95
-95

skipif mysql # not compatible
query I rowsort label-6926
SELECT COUNT ( * ) + - 96 FROM tab0 GROUP BY col0, col0
----
-95
-95
-95

onlyif mysql # aggregate syntax: 
query I rowsort label-6927
SELECT DISTINCT - col2 - - COUNT( * ) FROM tab1 WHERE NULL BETWEEN col2 AND col1 * - 18 + - col1 + - + ( + + 56 ) + + col1 * ( ( + col0 ) * - col2 ) GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-6927
SELECT DISTINCT - col2 - - COUNT ( * ) FROM tab1 WHERE NULL BETWEEN col2 AND col1 * - 18 + - col1 + - + ( + + 56 ) + + col1 * ( ( + col0 ) * - col2 ) GROUP BY col1, col2
----

query II rowsort
SELECT DISTINCT + col1 * + 93 * + col1, col1 FROM tab2 GROUP BY col1
----
156333
41
323733
59
346053
61

onlyif mysql # aggregate syntax: 
query I rowsort label-6929
SELECT + col0 * - COUNT( * ) * - 96 FROM tab1 GROUP BY col0, col0
----
2112
2688
7872

skipif mysql # not compatible
query I rowsort label-6929
SELECT + col0 * - COUNT ( * ) * - 96 FROM tab1 GROUP BY col0, col0
----
2112
2688
7872

onlyif mysql # aggregate syntax: 
query I rowsort label-6930
SELECT DISTINCT - COUNT( - col0 ) AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL BETWEEN ( - + 94 + 83 + + - col0 - col0 * - 38 / ( 35 * - AVG ( col2 * col2 ) ) ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6930
SELECT DISTINCT - COUNT ( - col0 ) AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL BETWEEN ( - + 94 + 83 + + - col0 - col0 * - 38 / ( 35 * - AVG ( col2 * col2 ) ) ) AND NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6931
SELECT col2 AS col1, COUNT( col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
1
38
1
79
1

skipif mysql # not compatible
query II rowsort label-6931
SELECT col2 AS col1, COUNT ( col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
1
38
1
79
1

onlyif mysql # aggregate syntax: 
query I rowsort label-6932
SELECT DISTINCT - + ( - - COUNT( * ) ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-6932
SELECT DISTINCT - + ( - - COUNT ( * ) ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-1

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6933
SELECT + COALESCE ( 92, col2 + + 40 * MAX( DISTINCT + 95 ) ) DIV col0 FROM tab1 GROUP BY col0
----
1
3
4

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6933
SELECT + COALESCE ( 92, col2 + + 40 * MAX ( DISTINCT + 95 ) ) / col0 FROM tab1 GROUP BY col0
----
1
3
4

onlyif mysql # aggregate syntax: 
query I rowsort label-6934
SELECT DISTINCT + COUNT( * ) AS col2 FROM tab1 GROUP BY col0 HAVING NULL < 85
----

skipif mysql # not compatible
query I rowsort label-6934
SELECT DISTINCT + COUNT ( * ) AS col2 FROM tab1 GROUP BY col0 HAVING NULL < 85
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6935
SELECT - + ( + COUNT( * ) ) FROM tab1 AS cor0 GROUP BY col1 HAVING - + 61 <= + col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6935
SELECT - + ( + COUNT ( * ) ) FROM tab1 AS cor0 GROUP BY col1 HAVING - + 61 <= + col1
----
-1
-1
-1

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN ( - 90 ) AND NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6937
SELECT col0 AS col0, SUM( ALL - col0 ) FROM tab1 GROUP BY col0, col1
----
22
-22
28
-28
82
-82

skipif mysql # not compatible
query II rowsort label-6937
SELECT col0 AS col0, SUM ( ALL - col0 ) FROM tab1 GROUP BY col0, col1
----
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 20 col1, + 28 * + col0 + + col0 FROM tab2 GROUP BY col0, col0
----
-20
2639
-20
2668
-20
435

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6939
SELECT CAST( 6 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
6
6
6

skipif mysql # not compatible
query I rowsort label-6939
SELECT CAST ( 6 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
6
6
6

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2, col2
----
-44
-57
-6

query II rowsort
SELECT DISTINCT col2 AS col2, + 13 FROM tab0 GROUP BY col2, col1
----
24
13
38
13
79
13

query I rowsort
SELECT ALL col0 * - col1 * - 6 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
20898

query I rowsort
SELECT + col0 * ( + + col1 ) FROM tab1 AS cor0 GROUP BY col0, col1
----
132
1596
3608

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-6944
SELECT ALL - + COUNT( * ) - AVG ( + + col2 ) + + 94 + + - CAST( + - 72 AS SIGNED ), 93 / 80 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + 10 IN ( - 49 )
----

skipif mysql # not compatible
query II rowsort label-6944
SELECT ALL - + COUNT ( * ) - AVG ( + + col2 ) + + 94 + + - CAST ( + - 72 AS INTEGER ), 93 / 80 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + 10 IN ( - 49 )
----

query I rowsort
SELECT DISTINCT - COALESCE ( 52, + ( + - 74 ) ) + - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT + 33 IS NOT NULL )
----
-111
-113
-93

onlyif mysql # aggregate syntax: 
query I rowsort label-6946
SELECT COUNT( * ) * col0 FROM tab0 GROUP BY col0 HAVING MAX( - - ( col1 ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6946
SELECT COUNT ( * ) * col0 FROM tab0 GROUP BY col0 HAVING MAX ( - - ( col1 ) ) IS NULL
----

query I rowsort
SELECT 16 FROM tab2 GROUP BY col1, col0
----
16
16
16

query I rowsort
SELECT - + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + 70 FROM tab0 AS cor0 GROUP BY col2, col2
----
70

onlyif mysql # aggregate syntax: 
query I rowsort label-6950
SELECT col0 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( - COUNT( * ) ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6950
SELECT col0 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( - COUNT ( * ) ) IS NULL
----

query I rowsort
SELECT col0 * - col0 * - col0 AS col0 FROM tab0 GROUP BY col0
----
17576
571787
79507

onlyif mysql # aggregate syntax: 
query I rowsort label-6952
SELECT ( - - COUNT( * ) ) FROM tab1 AS cor0 WHERE NOT ( ( + col2 ) NOT IN ( - col0 ) ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6952
SELECT ( - - COUNT ( * ) ) FROM tab1 AS cor0 WHERE NOT ( ( + col2 ) NOT IN ( - col0 ) ) GROUP BY col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6953
SELECT 74 DIV + col2 + + col2 - + + ( col2 ) + - + COUNT( * ) * + 91 * - - col2 - - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
-4093
-6459
-718

skipif mysql # not compatible
query I rowsort label-6953
SELECT 74 / + col2 + + col2 - + + ( col2 ) + - + COUNT ( * ) * + 91 * - - col2 - - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
-4093
-6459
-718

onlyif mysql # aggregate syntax: 
query I rowsort label-6954
SELECT DISTINCT COUNT( * ) + + - col2 - COUNT( ALL col2 ) FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-6954
SELECT DISTINCT COUNT ( * ) + + - col2 - COUNT ( ALL col2 ) FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - 50 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-50

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6956
SELECT DISTINCT + col2 - - CAST( NULL AS SIGNED ) + + 81 - + col2 * + col2 * CAST( + + col2 AS SIGNED ) * - col2 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col2 HAVING - COUNT( * ) < ( NULL )
----

skipif mysql # not compatible
query I rowsort label-6956
SELECT DISTINCT + col2 - - CAST ( NULL AS INTEGER ) + + 81 - + col2 * + col2 * CAST ( + + col2 AS INTEGER ) * - col2 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col2 HAVING - COUNT ( * ) < ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6957
SELECT DISTINCT MAX( ALL - + 40 ) col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IN ( col0 + col0, col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6957
SELECT DISTINCT MAX ( ALL - + 40 ) col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IN ( col0 + col0, col0 )
----

query I rowsort
SELECT - - col0 FROM tab2 WHERE NOT + - col1 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + AVG ( ALL + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6960
SELECT ALL ( + col2 ) * - ( - col2 ) * + 45 + - COUNT( * ) * - col1 * + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6960
SELECT ALL ( + col2 ) * - ( - col2 ) * + 45 + - COUNT ( * ) * - col1 * + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - 95 FROM tab2 AS cor0 GROUP BY col1, col0
----
-95
-95
-95

onlyif mysql # aggregate syntax: 
query I rowsort label-6963
SELECT ALL - COUNT( * ) * + 26 FROM tab1 GROUP BY col1, col0, col1 HAVING COUNT( * ) = + ( - + col0 ) + - COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-6963
SELECT ALL - COUNT ( * ) * + 26 FROM tab1 GROUP BY col1, col0, col1 HAVING COUNT ( * ) = + ( - + col0 ) + - COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6964
SELECT - COUNT( ALL - col2 ) FROM tab1 GROUP BY col2, col1 HAVING + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6964
SELECT - COUNT ( ALL - col2 ) FROM tab1 GROUP BY col2, col1 HAVING + COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6965
SELECT 22, col2 + col2 + + + 67 * col2 * col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING + COUNT( * ) + col2 IS NOT NULL
----
22
225504
22
418305
22
507297

skipif mysql # not compatible
query II rowsort label-6965
SELECT 22, col2 + col2 + + + 67 * col2 * col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING + COUNT ( * ) + col2 IS NOT NULL
----
22
225504
22
418305
22
507297

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6966
SELECT ALL ( - - COUNT( - 77 ) ) * + col2 AS col1, + COUNT( * ) DIV col2 * + col2 AS col1 FROM tab0 GROUP BY col2
----
24
0
38
0
79
0

skipif mysql # not compatible
query II rowsort label-6966
SELECT ALL ( - - COUNT ( - 77 ) ) * + col2 AS col1, + COUNT ( * ) / col2 * + col2 AS col1 FROM tab0 GROUP BY col2
----
24
0
38
0
79
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT( * ), - NULLIF ( - SUM( DISTINCT - CAST( NULL AS SIGNED ) ), CASE - col0 WHEN COUNT( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT ( * ), - NULLIF ( - SUM ( DISTINCT - CAST ( NULL AS INTEGER ) ), CASE - col0 WHEN COUNT ( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6969
SELECT DISTINCT + col0 * + + col0 + - 15 FROM tab2 WHERE col1 * - col0 = - col2 GROUP BY col0 HAVING + + COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6969
SELECT DISTINCT + col0 * + + col0 + - 15 FROM tab2 WHERE col1 * - col0 = - col2 GROUP BY col0 HAVING + + COUNT ( * ) IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6970
SELECT ALL col0 * + MIN( ALL CAST( + 49 AS SIGNED ) ) + + + col0 + + col0 + + - col0 - - col0 * - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-2739
301
624

skipif mysql # not compatible
query I rowsort label-6970
SELECT ALL col0 * + MIN ( ALL CAST ( + 49 AS INTEGER ) ) + + + col0 + + col0 + + - col0 - - col0 * - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-2739
301
624

query I rowsort
SELECT - 14 FROM tab0 cor0 GROUP BY col2
----
-14
-14
-14

query III rowsort
SELECT col0 AS col1, + 14 - - - col0 - col0 * - col0 * + col0, - + col0 AS col0 FROM tab2 GROUP BY col0, col0
----
9 values hashing to 533d4984e3f2e9379f190b48f17c1215

query II rowsort
SELECT 48, col0 * - + col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NULL NOT IN ( 21 )
----

query I rowsort
SELECT - - col2 FROM tab0 WHERE NULL >= NULL GROUP BY col2 HAVING ( NULL IS NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST( col2 AS SIGNED ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST ( col2 AS INTEGER ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6976
SELECT + ( - + COUNT( * ) ) DIV - 83 * - 76 * - col2 - col2, col2 + - - 10 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-24
34
-38
48
-79
89

skipif mysql # not compatible
query II rowsort label-6976
SELECT + ( - + COUNT ( * ) ) / - 83 * - 76 * - col2 - col2, col2 + - - 10 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-24
34
-38
48
-79
89

query I rowsort
SELECT - 78 + + 15 FROM tab1 AS cor0 GROUP BY col0 HAVING - 34 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6978
SELECT + 90 * - ( COUNT( * ) ) AS col1 FROM tab1 GROUP BY col0, col2
----
-90
-90
-90

skipif mysql # not compatible
query I rowsort label-6978
SELECT + 90 * - ( COUNT ( * ) ) AS col1 FROM tab1 GROUP BY col0, col2
----
-90
-90
-90

query I rowsort
SELECT ALL 51 AS col2 FROM tab1 GROUP BY col1
----
51
51
51

onlyif mysql # aggregate syntax: 
query I rowsort label-6980
SELECT ALL + COUNT( * ) - - col1 * col1 * - col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
2
43046722

skipif mysql # not compatible
query I rowsort label-6980
SELECT ALL + COUNT ( * ) - - col1 * col1 * - col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
2
43046722

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6981
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT + - CAST( NULL AS DECIMAL ) IS NOT NULL
----
26
43
83

skipif mysql # not compatible
query I rowsort label-6981
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT + - CAST ( NULL AS REAL ) IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 6 * - ( 35 ) * + ( col2 ) * - - col0 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-1120560
-1509690
-274050

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col2, col0, col2
----
15
91
92

query I rowsort
SELECT 9 AS col2 FROM tab2 GROUP BY col1
----
9
9
9

onlyif mysql # aggregate syntax: 
query I rowsort label-6985
SELECT + MAX( DISTINCT - - col1 ) FROM tab1 GROUP BY col1 HAVING - 72 IS NOT NULL
----
44
57
6

skipif mysql # not compatible
query I rowsort label-6985
SELECT + MAX ( DISTINCT - - col1 ) FROM tab1 GROUP BY col1 HAVING - 72 IS NOT NULL
----
44
57
6

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6986
SELECT ALL col1 + - - 75 FROM tab2 GROUP BY col1 HAVING NULL > ( + + ( + COUNT( * ) ) / - CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-6986
SELECT ALL col1 + - - 75 FROM tab2 GROUP BY col1 HAVING NULL > ( + + ( + COUNT ( * ) ) / - CAST ( NULL AS INTEGER ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6987
SELECT DISTINCT 50 * col2 AS col2, - CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col0, col2, col2
----
2250
NULL
3550
NULL
400
NULL

skipif mysql # not compatible
query II rowsort label-6987
SELECT DISTINCT 50 * col2 AS col2, - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col0, col2, col2
----
2250
NULL
3550
NULL
400
NULL

query I rowsort
SELECT 20 FROM tab0 GROUP BY col2, col0, col2
----
20
20
20

query I rowsort
SELECT col1 + col1 AS col2 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT - col0 * - 19 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1558
418
532

onlyif mysql # aggregate syntax: 
query II rowsort label-6991
SELECT DISTINCT - COUNT( * ), + col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1
114
-1
12
-1
88

skipif mysql # not compatible
query II rowsort label-6991
SELECT DISTINCT - COUNT ( * ), + col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1
114
-1
12
-1
88

query II rowsort
SELECT ALL + col0 * - 56, + 86 AS col2 FROM tab2 GROUP BY col0, col0
----
-5096
86
-5152
86
-840
86

onlyif mysql # aggregate syntax: 
query I rowsort label-6993
SELECT + SUM( ALL 87 ) col1 FROM tab2 GROUP BY col2
----
87
87
87

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6993
SELECT + SUM ( ALL 87 ) col1 FROM tab2 GROUP BY col2
----
87
87
87

query I rowsort
SELECT ALL + col0 + + + 14 * col0 * 69 FROM tab2 GROUP BY col0, col0
----
14505
87997
88964

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT + 32 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6997
SELECT + col1 * 41 * + CAST( + 52 AS SIGNED ) + + + ( + col0 ) FROM tab2 AS cor0 GROUP BY col0, col0, col1 HAVING - CAST( NULL AS SIGNED ) + - COUNT( * ) NOT BETWEEN + - 0 AND NULL
----

skipif mysql # not compatible
query I rowsort label-6997
SELECT + col1 * 41 * + CAST ( + 52 AS INTEGER ) + + + ( + col0 ) FROM tab2 AS cor0 GROUP BY col0, col0, col1 HAVING - CAST ( NULL AS INTEGER ) + - COUNT ( * ) NOT BETWEEN + - 0 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + - 51 + - + col2 * col2, col2 * - 27 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-1495
-1026
-627
-648
-6292
-2133

query I rowsort
SELECT ALL 10 AS col0 FROM tab0 GROUP BY col2
----
10
10
10

onlyif mysql # aggregate syntax: 
query I rowsort label-7001
SELECT - SUM( - col1 ) FROM tab1 WHERE NOT NULL = NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7001
SELECT - SUM ( - col1 ) FROM tab1 WHERE NOT NULL = NULL GROUP BY col1
----

query I rowsort
SELECT 59 / - col0 AS col0 FROM tab2 WHERE NOT col1 > NULL GROUP BY col0
----

query I rowsort
SELECT + col0 + - ( - col0 ) * + + col0 AS col0 FROM tab0 GROUP BY col0
----
1892
6972
702

query II rowsort
SELECT DISTINCT - col2 + - col2 / col2, + 89 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL ( ( + col1 ) ) * - + 38 * + + ( col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-123462
-1368
-73568

query I rowsort
SELECT - col0 * + + col0 FROM tab1 GROUP BY col0 HAVING COALESCE ( + 78, + 26 ) IS NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col2, col1 HAVING - + 15 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT - - ( + 31 ) AS col1 FROM tab1 cor0 GROUP BY col0, col2
----
31
31
31

onlyif mysql # aggregate syntax: 
query I rowsort label-7009
SELECT ALL col2 + + ( + 90 ) * - MIN( + - col2 ) FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7009
SELECT ALL col2 + + ( + 90 ) * - MIN ( + - col2 ) FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 31 FROM tab0 GROUP BY col1, col0
----
31
31
31

onlyif mysql # aggregate syntax: 
query I rowsort label-7011
SELECT DISTINCT COUNT( * ) FROM tab0 GROUP BY col1, col0, col1
----
1

skipif mysql # not compatible
query I rowsort label-7011
SELECT DISTINCT COUNT ( * ) FROM tab0 GROUP BY col1, col0, col1
----
1

query I rowsort
SELECT ALL - 86 * + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-4988
-6794
-7482

onlyif mysql # aggregate syntax: 
query I rowsort label-7013
SELECT + + COUNT( DISTINCT + + col0 ) FROM tab0 cor0 GROUP BY col2, col0 HAVING NOT - col0 * + + col0 / 19 <= SUM( + col1 )
----

skipif mysql # not compatible
query I rowsort label-7013
SELECT + + COUNT ( DISTINCT + + col0 ) FROM tab0 cor0 GROUP BY col2, col0 HAVING NOT - col0 * + + col0 / 19 <= SUM ( + col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 87 * - + 9 + - - col1 - col2 + - col2 + + col2 * col2 col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
4072
6925
8239

onlyif mysql # aggregate syntax: 
query I rowsort label-7015
SELECT col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT 10 + col0 + + ( COUNT( + col0 ) ) IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-7015
SELECT col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT 10 + col0 + + ( COUNT ( + col0 ) ) IS NULL
----
41
59
61

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NOT + 28 * + - 32 IS NOT NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7017
SELECT COUNT( * ) AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT 30 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7017
SELECT COUNT ( * ) AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT 30 IS NOT NULL
----

query I rowsort
SELECT 76 * + 21 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1596
1596
1596

onlyif mysql # DIV for integer division: 
query I rowsort label-7019
SELECT - 63 DIV + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-10

skipif mysql # not compatible
query I rowsort label-7019
SELECT - 63 / + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-10

onlyif mysql # aggregate syntax: 
query I rowsort label-7020
SELECT DISTINCT - col1 * + 17 + 70 + - COUNT( * ) + - ( + col1 ) / - col1 * - + col1 * col1 / - col1 * + COUNT( * ) + col1 FROM tab2 WHERE NULL < NULL GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7020
SELECT DISTINCT - col1 * + 17 + 70 + - COUNT ( * ) + - ( + col1 ) / - col1 * - + col1 * col1 / - col1 * + COUNT ( * ) + col1 FROM tab2 WHERE NULL < NULL GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7021
SELECT CAST( NULL AS DECIMAL ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7021
SELECT CAST ( NULL AS REAL ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7022
SELECT ALL COUNT( * ) + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-43
-5
-56

skipif mysql # not compatible
query I rowsort label-7022
SELECT ALL COUNT ( * ) + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-43
-5
-56

query I rowsort
SELECT + + col0 - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 9 IS NULL
----
164
44
56

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query II rowsort label-7024
SELECT MAX( + 36 ) DIV col0 + col0, CAST( NULL AS SIGNED ) * - 32 AS col1 FROM tab2 GROUP BY col0, col1
----
17
NULL
91
NULL
92
NULL

skipif mysql # not compatible
query II rowsort label-7024
SELECT MAX ( + 36 ) / col0 + col0, CAST ( NULL AS INTEGER ) * - 32 AS col1 FROM tab2 GROUP BY col0, col1
----
17
NULL
91
NULL
92
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7025
SELECT - col0 * - 41 * CAST( NULL AS SIGNED ) + + + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( NULL ) AND + CAST( NULL AS SIGNED ) AND NOT - col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7025
SELECT - col0 * - 41 * CAST ( NULL AS INTEGER ) + + + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( NULL ) AND + CAST ( NULL AS INTEGER ) AND NOT - col0 IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-7026
SELECT ALL - 41 * col1 col1, 88 + col1 * CAST( NULL AS DECIMAL ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1804
NULL
-2337
NULL
-246
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7026
SELECT ALL - 41 * col1 col1, 88 + col1 * CAST ( NULL AS REAL ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1804
NULL
-2337
NULL
-246
NULL

query I rowsort
SELECT DISTINCT col0 * + col0 + + - ( ( - col0 ) ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
1892
6972
702

onlyif mysql # aggregate syntax: 
query I rowsort label-7028
SELECT + + ( - + COUNT( * ) ) FROM tab0 cor0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-7028
SELECT + + ( - + COUNT ( * ) ) FROM tab0 cor0 GROUP BY col1
----
-1
-2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7029
SELECT - - CAST( NULL AS SIGNED ) + + - col1 FROM tab2 cor0 WHERE ( NULL ) BETWEEN - col0 AND 37 GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-7029
SELECT - - CAST ( NULL AS INTEGER ) + + - col1 FROM tab2 cor0 WHERE ( NULL ) BETWEEN - col0 AND 37 GROUP BY col1, col2
----

query I rowsort
SELECT col1 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col1 * + col0 AS col2 FROM tab0 GROUP BY col1, col0 HAVING + - col1 IS NOT NULL
----
-3483
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-7032
SELECT DISTINCT + COUNT( * ) FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-7032
SELECT DISTINCT + COUNT ( * ) FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * + col2 col0 FROM tab0 GROUP BY col0, col2 HAVING NOT - col2 + 5 IS NULL
----
1444
576
6241

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0, col2, col2 HAVING - col2 IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL ( + - col0 ) col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT + col0 + - + 79 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-51
-57
3

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7037
SELECT - 61 * - - NULLIF ( - CAST( + 8 AS SIGNED ), - 49 ) + - col0 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
396
397
473

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7037
SELECT - 61 * - - NULLIF ( - CAST ( + 8 AS INTEGER ), - 49 ) + - col0 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
396
397
473

query II rowsort
SELECT col2, - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT col2 < NULL
----

query I rowsort
SELECT ( 5 ) + 28 FROM tab1 GROUP BY col0
----
33
33
33

onlyif mysql # aggregate syntax: 
query I rowsort label-7040
SELECT ALL + - 30 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN - - COUNT( * ) + - col1 AND AVG ( DISTINCT 94 )
----

skipif mysql # not compatible
query I rowsort label-7040
SELECT ALL + - 30 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN - - COUNT ( * ) + - col1 AND AVG ( DISTINCT 94 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7041
SELECT DISTINCT + col2 - 14 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( COUNT( * ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7041
SELECT DISTINCT + col2 - 14 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( COUNT ( * ) ) IS NULL
----

query I rowsort
SELECT - - ( + + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7043
SELECT - - CAST( NULL AS SIGNED ) * - + CAST( - 50 AS SIGNED ) AS col2 FROM tab0 WHERE NOT col2 NOT BETWEEN + 46 * col0 AND - 81 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-7043
SELECT - - CAST ( NULL AS INTEGER ) * - + CAST ( - 50 AS INTEGER ) AS col2 FROM tab0 WHERE NOT col2 NOT BETWEEN + 46 * col0 AND - 81 GROUP BY col2
----

query I rowsort
SELECT 40 FROM tab1 GROUP BY col0, col1
----
40
40
40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT col0 + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) = ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7047
SELECT DISTINCT - 34 DIV - col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NOT - ( - 98 ) IS NULL
----
0
5

skipif mysql # not compatible
query I rowsort label-7047
SELECT DISTINCT - 34 / - col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NOT - ( - 98 ) IS NULL
----
0
5

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 40 col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
-40
-40
-40

query I rowsort
SELECT ALL col0 * + 91 + + + col1 + - col0 - + - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
1426
8340
8413

onlyif mysql # aggregate syntax: 
query I rowsort label-7050
SELECT ALL + - SUM( ALL + - 20 ) - + + col1 * + col1 FROM tab0 cor0 GROUP BY col1
----
-6541
40

skipif mysql # not compatible
query I rowsort label-7050
SELECT ALL + - SUM ( ALL + - 20 ) - + + col1 * + col1 FROM tab0 cor0 GROUP BY col1
----
-6541
40

onlyif mysql # aggregate syntax: 
query I rowsort label-7051
SELECT + COUNT( * ) * 30 FROM tab2 AS cor0 GROUP BY col2, col2
----
30
30
30

skipif mysql # not compatible
query I rowsort label-7051
SELECT + COUNT ( * ) * 30 FROM tab2 AS cor0 GROUP BY col2, col2
----
30
30
30

query I rowsort
SELECT - - col1 AS col1 FROM tab2 WHERE - - col1 IS NULL GROUP BY col0, col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + 1 + + 57 + + 88 FROM tab2 GROUP BY col0
----
146
146
146

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0 HAVING + 67 IS NOT NULL
----
22
28
82

onlyif mysql # aggregate syntax: 
query I rowsort label-7055
SELECT DISTINCT - COUNT( * ) - - col2 FROM tab1 GROUP BY col2 HAVING 47 IN ( - 35, 97 )
----

skipif mysql # not compatible
query I rowsort label-7055
SELECT DISTINCT - COUNT ( * ) - - col2 FROM tab1 GROUP BY col2 HAVING 47 IN ( - 35, 97 )
----

query I rowsort
SELECT DISTINCT + 57 FROM tab2 AS cor0 WHERE NOT + 93 * - col0 - + CASE 88 WHEN + col0 THEN - col0 ELSE NULL END = 64 GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7057
SELECT ALL - ( + + COUNT( * ) ) AS col1 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7057
SELECT ALL - ( + + COUNT ( * ) ) AS col1 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT + 21 FROM tab0 AS cor0 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL = ( NULL ) GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7060
SELECT + + 68 * + - COUNT( * ) * - 49 + + - 7 FROM tab1 AS cor0 GROUP BY col2
----
3325
3325
3325

skipif mysql # not compatible
query I rowsort label-7060
SELECT + + 68 * + - COUNT ( * ) * - 49 + + - 7 FROM tab1 AS cor0 GROUP BY col2
----
3325
3325
3325

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL = ( NULL )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7062
SELECT DISTINCT COUNT( * ) DIV - 84 * 30 AS col0 FROM tab0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-7062
SELECT DISTINCT COUNT ( * ) / - 84 * 30 AS col0 FROM tab0 GROUP BY col2
----
0

onlyif mysql # aggregate syntax: 
query I rowsort label-7063
SELECT ALL ( - COUNT( * ) ) AS col1 FROM tab2 GROUP BY col2, col2 HAVING - - col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7063
SELECT ALL ( - COUNT ( * ) ) AS col1 FROM tab2 GROUP BY col2, col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT - 82 - - col1 AS col0 FROM tab0 GROUP BY col1
----
-1
-82

query I rowsort
SELECT DISTINCT + col1 + - 56 AS col1 FROM tab2 GROUP BY col1
----
-15
3
5

onlyif mysql # DIV for integer division: 
query I rowsort label-7066
SELECT + + 45 DIV + - col1 + - - col1 + 48 FROM tab2 AS cor0 GROUP BY col0, col1
----
107
109
88

skipif mysql # not compatible
query I rowsort label-7066
SELECT + + 45 / + - col1 + - - col1 + 48 FROM tab2 AS cor0 GROUP BY col0, col1
----
107
109
88

query I rowsort
SELECT DISTINCT + 34 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
34

query I rowsort
SELECT DISTINCT - - 75 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
75

onlyif mysql # aggregate syntax: 
query I rowsort label-7069
SELECT ( + - COUNT( * ) ) / CASE + SUM( ALL - 77 ) WHEN - col0 THEN - + COUNT( * ) / + col0 * + + ( 49 ) END FROM tab1 AS cor0 WHERE + col0 NOT IN ( - - col0 * col1 - col1, - col1 ) GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7069
SELECT ( + - COUNT ( * ) ) / CASE + SUM ( ALL - 77 ) WHEN - col0 THEN - + COUNT ( * ) / + col0 * + + ( 49 ) END FROM tab1 AS cor0 WHERE + col0 NOT IN ( - - col0 * col1 - col1, - col1 ) GROUP BY col1, col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query II rowsort label-7070
SELECT ALL + MAX( ALL col1 ) AS col0, + COUNT( * ) + + 76 + + col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
44
121
57
134
6
83

skipif mysql # not compatible
query II rowsort label-7070
SELECT ALL + MAX ( ALL col1 ) AS col0, + COUNT ( * ) + + 76 + + col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
44
121
57
134
6
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL NOT BETWEEN NULL AND - + col1 / col0
----

query I rowsort
SELECT + col2 + + ( + - 3 ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NULL <= 82 + + + col0
----

query II rowsort
SELECT - col2 + - 23 * - 98 AS col2, + col2 * + + ( + ( - col2 ) ) FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
2175
-6241
2216
-1444
2230
-576

onlyif mysql # aggregate syntax: 
query I rowsort label-7074
SELECT ALL - col1 * COUNT( ALL - col1 ) + - col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1640
3422
3660

skipif mysql # not compatible
query I rowsort label-7074
SELECT ALL - col1 * COUNT ( ALL - col1 ) + - col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1640
3422
3660

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col0 HAVING col0 * + + ( - - 97 ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7076
SELECT + 13 + - - MAX( DISTINCT - 63 ) FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7076
SELECT + 13 + - - MAX ( DISTINCT - 63 ) FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col1 AS col2, + col1 FROM tab2 GROUP BY col1, col1 HAVING ( NULL ) NOT BETWEEN 0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7078
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7078
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + + 92 * 61 FROM tab2 AS cor0 GROUP BY col1
----
5612
5612
5612

query I rowsort
SELECT - + ( - + col2 ) + + 26 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
105
50
64

onlyif mysql # aggregate syntax: 
query I rowsort label-7081
SELECT DISTINCT - 5 / + COUNT( * ) + + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + MAX( DISTINCT col2 ) > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7081
SELECT DISTINCT - 5 / + COUNT ( * ) + + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + MAX ( DISTINCT col2 ) > NULL
----

query I rowsort
SELECT ALL + col1 + + 33 + + - col2 + - col2 * - 63 FROM tab1 GROUP BY col2, col1
----
2880
4479
535

query I rowsort
SELECT DISTINCT ( col2 ) AS col1 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col0, col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7086
SELECT DISTINCT CAST( NULL AS SIGNED ) + - 66 FROM tab2 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-7086
SELECT DISTINCT CAST ( NULL AS INTEGER ) + - 66 FROM tab2 GROUP BY col1
----
NULL

query I rowsort
SELECT ALL + COALESCE ( + + col2, - - col2 + - - col0, col2 * col0 * - + col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-7088
SELECT COUNT( * ) / ( - 12 ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING + 42 - + - 69 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7088
SELECT COUNT ( * ) / ( - 12 ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING + 42 - + - 69 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7089
SELECT DISTINCT 41 * + COUNT( * ) FROM tab1 GROUP BY col2, col0
----
41

skipif mysql # not compatible
query I rowsort label-7089
SELECT DISTINCT 41 * + COUNT ( * ) FROM tab1 GROUP BY col2, col0
----
41

query I rowsort
SELECT + col2 / + ( + + 84 ) FROM tab2 WHERE NULL = NULL GROUP BY col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7091
SELECT DISTINCT + COUNT( * ) * - COUNT( * ) col1 FROM tab0 WHERE NOT NULL NOT IN ( - - col0, - CAST( - col1 AS SIGNED ), col1 - 83 ) GROUP BY col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7091
SELECT DISTINCT + COUNT ( * ) * - COUNT ( * ) col1 FROM tab0 WHERE NOT NULL NOT IN ( - - col0, - CAST ( - col1 AS INTEGER ), col1 - 83 ) GROUP BY col0
----

query I rowsort
SELECT + + 60 * + col0 + col0 * + 62 + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
10004
2684
3416

onlyif mysql # aggregate syntax: 
query I rowsort label-7093
SELECT + 81 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7093
SELECT + 81 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT ( * ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7094
SELECT ALL + ( - - col0 ) * - col2 + + 91 + + - 18 * - col0 + col1 + - col2 + + col0 AS col2 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT + + ( - CAST( - 47 AS SIGNED ) ) <= ( - 73 )
----
-3514
-5389
-955

skipif mysql # not compatible
query I rowsort label-7094
SELECT ALL + ( - - col0 ) * - col2 + + 91 + + - 18 * - col0 + col1 + - col2 + + col0 AS col2 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT + + ( - CAST ( - 47 AS INTEGER ) ) <= ( - 73 )
----
-3514
-5389
-955

onlyif mysql # aggregate syntax: 
query I rowsort label-7095
SELECT col0 + + + col0 + + col0 * - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT IN ( - - MAX( 36 ), - 66 )
----

skipif mysql # not compatible
query I rowsort label-7095
SELECT col0 + + + col0 + + col0 * - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT IN ( - - MAX ( 36 ), - 66 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7096
SELECT DISTINCT + 70 DIV - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1
-8
0

skipif mysql # not compatible
query I rowsort label-7096
SELECT DISTINCT + 70 / - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1
-8
0

query I rowsort
SELECT - - 6 - + - col2 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING - 15 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7098
SELECT ALL COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7098
SELECT ALL COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7099
SELECT ALL - CAST( NULL AS DECIMAL ) * - - 36 - - 47 FROM tab2 AS cor0 GROUP BY col0 HAVING - ( - col0 ) = + + 85
----

skipif mysql # not compatible
query I rowsort label-7099
SELECT ALL - CAST ( NULL AS REAL ) * - - 36 - - 47 FROM tab2 AS cor0 GROUP BY col0 HAVING - ( - col0 ) = + + 85
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + 57 * + ( col0 ) + col2 * - col2 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col0 + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NULL = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7103
SELECT ALL COUNT( * ) + col1 * - col0 * col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + - 93 NOT IN ( - 81 )
----

skipif mysql # not compatible
query I rowsort label-7103
SELECT ALL COUNT ( * ) + col1 * - col0 * col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + - 93 NOT IN ( - 81 )
----

query I rowsort
SELECT ALL 79 FROM tab2 GROUP BY col1
----
79
79
79

query I rowsort
SELECT ALL - col2 - - col2 FROM tab0 GROUP BY col1, col0, col2
----
0
0
0

query I rowsort
SELECT ALL - col1 + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
17
20
26

onlyif mysql # DIV for integer division: 
query I rowsort label-7107
SELECT + + col2 DIV - - 31 col0 FROM tab2 cor0 GROUP BY col0, col1, col2
----
1
2
2

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7107
SELECT + + col2 / - - 31 col0 FROM tab2 cor0 GROUP BY col0, col1, col2
----
1
2
2

onlyif mysql # aggregate syntax: 
query I rowsort label-7108
SELECT DISTINCT - col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + MIN( ( + 87 ) ) IS NULL
----
-58
-79
-87

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7108
SELECT DISTINCT - col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + MIN ( ( + 87 ) ) IS NULL
----
-58
-79
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-7109
SELECT ( + ( + col2 ) ) + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + - COUNT( * ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-7109
SELECT ( + ( + col2 ) ) + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + - COUNT ( * ) <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7110
SELECT ALL 32 * + ( - CAST( + 19 AS SIGNED ) ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-608
-608
-608

skipif mysql # not compatible
query I rowsort label-7110
SELECT ALL 32 * + ( - CAST ( + 19 AS INTEGER ) ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-608
-608
-608

onlyif mysql # aggregate syntax: 
query I rowsort label-7111
SELECT DISTINCT + COUNT( * ) AS col1 FROM tab0 GROUP BY col0 HAVING NULL >= - 39 - 22
----

skipif mysql # not compatible
query I rowsort label-7111
SELECT DISTINCT + COUNT ( * ) AS col1 FROM tab0 GROUP BY col0 HAVING NULL >= - 39 - 22
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7112
SELECT ALL NULLIF ( + MIN( ALL + col2 ), - - 71 - + 13 * - 97 ) - ( + 22 ) AS col1 FROM tab2 GROUP BY col0
----
36
57
65

skipif mysql # not compatible
query I rowsort label-7112
SELECT ALL NULLIF ( + MIN ( ALL + col2 ), - - 71 - + 13 * - 97 ) - ( + 22 ) AS col1 FROM tab2 GROUP BY col0
----
36
57
65

query I rowsort
SELECT - col0 * + col0 + + col0 FROM tab0 GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT 93 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7115
SELECT + - 60 + + + COUNT( * ) * 51 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN - + col2 AND CAST( NULL AS SIGNED ) * 80
----

skipif mysql # not compatible
query I rowsort label-7115
SELECT + - 60 + + + COUNT ( * ) * 51 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN - + col2 AND CAST ( NULL AS INTEGER ) * 80
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7116
SELECT ALL MIN( ALL - 3 ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-3
-3
-3

skipif mysql # not compatible
query I rowsort label-7116
SELECT ALL MIN ( ALL - 3 ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-3
-3
-3

query I rowsort
SELECT - 7 FROM tab0 GROUP BY col0, col2
----
-7
-7
-7

query I rowsort
SELECT DISTINCT 34 * + - col2 AS col0 FROM tab1 GROUP BY col0, col2
----
-1530
-2414
-272

query I rowsort
SELECT DISTINCT - - 87 * col1 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
168432
282663
3132

query I rowsort
SELECT ALL + 32 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
32
32
32

query I rowsort
SELECT ALL + ( - ( col0 ) ) AS col0 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7122
SELECT COUNT( * ) * AVG ( CAST( NULL AS SIGNED ) ) + col1 FROM tab0 GROUP BY col1 HAVING 7 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7122
SELECT COUNT ( * ) * AVG ( CAST ( NULL AS INTEGER ) ) + col1 FROM tab0 GROUP BY col1 HAVING 7 IS NULL
----

query I rowsort
SELECT ( + 60 ) - col2 FROM tab0 GROUP BY col0, col2 HAVING + col2 * + 78 + - col2 IS NULL
----

query I rowsort
SELECT DISTINCT col1 * + 72 FROM tab1 GROUP BY col1, col2 HAVING NOT 89 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7125
SELECT ALL MIN( DISTINCT 84 ) * col2 - col2 FROM tab0 GROUP BY col2
----
1992
3154
6557

skipif mysql # not compatible
query I rowsort label-7125
SELECT ALL MIN ( DISTINCT 84 ) * col2 - col2 FROM tab0 GROUP BY col2
----
1992
3154
6557

onlyif mysql # aggregate syntax: 
query I rowsort label-7126
SELECT - COUNT( * ) FROM tab0 GROUP BY col2, col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7126
SELECT - COUNT ( * ) FROM tab0 GROUP BY col2, col1, col0
----
-1
-1
-1

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT ( col1 * col0 ) = - ( + 16 ) GROUP BY col2
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-7128
SELECT + col2 AS col2 FROM tab0 WHERE NOT col1 * - col1 = ( col2 * 10 ) GROUP BY col1, col2, col2 HAVING NOT ( COUNT( * ) * col1 ) = ( col1 )
----

skipif mysql # not compatible
query I rowsort label-7128
SELECT + col2 AS col2 FROM tab0 WHERE NOT col1 * - col1 = ( col2 * 10 ) GROUP BY col1, col2, col2 HAVING NOT ( COUNT ( * ) * col1 ) = ( col1 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7129
SELECT col2 * + col2 + + 67 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN + MIN( ALL - CAST( NULL AS SIGNED ) ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-7129
SELECT col2 * + col2 + + 67 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN + MIN ( ALL - CAST ( NULL AS INTEGER ) ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7130
SELECT ALL + SUM( - col0 ) FROM tab1 GROUP BY col2, col0, col2 HAVING NOT + col0 IS NULL
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-7130
SELECT ALL + SUM ( - col0 ) FROM tab1 GROUP BY col2, col0, col2 HAVING NOT + col0 IS NULL
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-7131
SELECT 43 + - COUNT( * ) FROM tab2 GROUP BY col2
----
42
42
42

skipif mysql # not compatible
query I rowsort label-7131
SELECT 43 + - COUNT ( * ) FROM tab2 GROUP BY col2
----
42
42
42

query I rowsort
SELECT DISTINCT col2 * col0 FROM tab2 WHERE NULL < NULL GROUP BY col2, col0 HAVING ( NULL ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7133
SELECT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) NOT IN ( + SUM( 84 ) )
----

skipif mysql # not compatible
query I rowsort label-7133
SELECT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) NOT IN ( + SUM ( 84 ) )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7134
SELECT ALL col0 + CAST( NULL AS DECIMAL ) * COUNT( - CAST( NULL AS SIGNED ) ) FROM tab2 GROUP BY col2, col0 HAVING NOT ( - col0 + - col2 ) IN ( col0 + - 88 )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7134
SELECT ALL col0 + CAST ( NULL AS REAL ) * COUNT ( - CAST ( NULL AS INTEGER ) ) FROM tab2 GROUP BY col2, col0 HAVING NOT ( - col0 + - col2 ) IN ( col0 + - 88 )
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 44 AS col0 FROM tab2 WHERE + col1 IS NOT NULL GROUP BY col0
----
44

query I rowsort
SELECT ALL - ( - col0 ) AS col1 FROM tab1 GROUP BY col0
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7137
SELECT ALL - col2 * 15 FROM tab0 GROUP BY col2, col0 HAVING NOT - CAST( NULL AS SIGNED ) IS NOT NULL
----
-1185
-360
-570

skipif mysql # not compatible
query I rowsort label-7137
SELECT ALL - col2 * 15 FROM tab0 GROUP BY col2, col0 HAVING NOT - CAST ( NULL AS INTEGER ) IS NOT NULL
----
-1185
-360
-570

onlyif mysql # aggregate syntax: 
query I rowsort label-7138
SELECT col1 / col1 + 99 AS col1 FROM tab0 WHERE NOT ( - col1 ) IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL BETWEEN ( col1 + 16 ) AND + CASE 31 WHEN col1 THEN NULLIF ( + COUNT( * ), col1 ) * - 44 WHEN col0 THEN NULL END
----

skipif mysql # not compatible
query I rowsort label-7138
SELECT col1 / col1 + 99 AS col1 FROM tab0 WHERE NOT ( - col1 ) IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL BETWEEN ( col1 + 16 ) AND + CASE 31 WHEN col1 THEN NULLIF ( + COUNT ( * ), col1 ) * - 44 WHEN col0 THEN NULL END
----

query I rowsort
SELECT 2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT COALESCE ( + 70, - ( - 25 ) ) IS NULL
----
2
2
2

onlyif mysql # aggregate syntax: 
query I rowsort label-7140
SELECT - COUNT( * ) FROM tab0 GROUP BY col1, col1 HAVING NOT 37 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7140
SELECT - COUNT ( * ) FROM tab0 GROUP BY col1, col1 HAVING NOT 37 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - 65 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( col2 * + col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 7 col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1 HAVING NOT + 51 IS NOT NULL
----

query I rowsort
SELECT ALL col1 * col0 + 52 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING 38 IS NOT NULL
----
3535
52
52

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( col2 ) IS NOT NULL
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-7146
SELECT + COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7146
SELECT + COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7147
SELECT + + COUNT( * ) * ( + 92 + col1 * + 85 ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7147
SELECT + + COUNT ( * ) * ( + 92 + col1 * + 85 ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 68 * - 39 FROM tab0 AS cor0 GROUP BY col0
----
2652
2652
2652

query I rowsort
SELECT 83 * - col0 AS col1 FROM tab1 WHERE ( COALESCE ( col0, - 94 ) + + 93 / 41 ) IS NOT NULL GROUP BY col0, col0, col2
----
-1826
-2324
-6806

onlyif mysql # DIV for integer division: 
query I rowsort label-7150
SELECT + COALESCE ( - - 72, col0 DIV 26 ) AS col0 FROM tab0 GROUP BY col2, col0
----
72
72
72

skipif mysql # not compatible
query I rowsort label-7150
SELECT + COALESCE ( - - 72, col0 / 26 ) AS col0 FROM tab0 GROUP BY col2, col0
----
72
72
72

onlyif mysql # aggregate syntax: 
query I rowsort label-7151
SELECT 61 AS col0 FROM tab1 GROUP BY col2, col0, col2 HAVING ( - COUNT( col0 ) ) IS NOT NULL
----
61
61
61

skipif mysql # not compatible
query I rowsort label-7151
SELECT 61 AS col0 FROM tab1 GROUP BY col2, col0, col2 HAVING ( - COUNT ( col0 ) ) IS NOT NULL
----
61
61
61

onlyif mysql # aggregate syntax: 
query I rowsort label-7152
SELECT DISTINCT + - COUNT( + 49 ) FROM tab2 AS cor0 GROUP BY col2, col0
----
-1

skipif mysql # not compatible
query I rowsort label-7152
SELECT DISTINCT + - COUNT ( + 49 ) FROM tab2 AS cor0 GROUP BY col2, col0
----
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-7153
SELECT DISTINCT + SUM( DISTINCT + col0 ) * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

skipif mysql # not compatible
query I rowsort label-7153
SELECT DISTINCT + SUM ( DISTINCT + col0 ) * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) <= ( NULL )
----

query I rowsort
SELECT col0 * - col0 AS col2 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + - ( - 46 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
46
46
46

onlyif mysql # aggregate syntax: 
query I rowsort label-7157
SELECT ALL + col2 + + COUNT( * ) col0 FROM tab0 AS cor0 GROUP BY col2
----
25
39
80

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7157
SELECT ALL + col2 + + COUNT ( * ) col0 FROM tab0 AS cor0 GROUP BY col2
----
25
39
80

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7158
SELECT ALL - + 78 * + CAST( NULL AS SIGNED ) * + MAX( 24 ) * + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7158
SELECT ALL - + 78 * + CAST ( NULL AS INTEGER ) * + MAX ( 24 ) * + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7160
SELECT - MIN( - 21 ) FROM tab1 GROUP BY col0
----
21
21
21

skipif mysql # not compatible
query I rowsort label-7160
SELECT - MIN ( - 21 ) FROM tab1 GROUP BY col0
----
21
21
21

query I rowsort
SELECT + 30 AS col0 FROM tab1 GROUP BY col2 HAVING + 36 IS NOT NULL
----
30
30
30

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING 13 IS NOT NULL
----
-58
-79
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-7163
SELECT DISTINCT + 94 FROM tab2 GROUP BY col1 HAVING ( SUM( ALL + col1 ) ) < + col1
----

skipif mysql # not compatible
query I rowsort label-7163
SELECT DISTINCT + 94 FROM tab2 GROUP BY col1 HAVING ( SUM ( ALL + col1 ) ) < + col1
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT 38 > ( - col1 + 51 * - col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7165
SELECT - CAST( NULL AS SIGNED ) AS col2 FROM tab1 cor0 GROUP BY col0 HAVING ( NULL ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-7165
SELECT - CAST ( NULL AS INTEGER ) AS col2 FROM tab1 cor0 GROUP BY col0 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( ( + 79 ) IS NULL )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7167
SELECT + ( col2 ) * + COUNT( * ) * + CAST( NULL AS SIGNED ) / - COUNT( * ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7167
SELECT + ( col2 ) * + COUNT ( * ) * + CAST ( NULL AS INTEGER ) / - COUNT ( * ) AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 72 / + col0 col1 FROM tab0 GROUP BY col0, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT col1 + + col1 AS col0 FROM tab1 cor0 WHERE ( NULL ) <= + col2 / col1 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7170
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2 HAVING ( - ( col2 ) + + CASE - 45 WHEN + CAST( COUNT( * ) AS DECIMAL ) * 99 THEN + COUNT( * ) END * + 26 ) NOT BETWEEN + col2 * COUNT( + col1 ) - + col2 / ( + 64 ) AND ( COUNT( col2 ) ) AND NOT - col1 = 88 + - col2
----

skipif mysql # not compatible
query I rowsort label-7170
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2 HAVING ( - ( col2 ) + + CASE - 45 WHEN + CAST ( COUNT ( * ) AS REAL ) * 99 THEN + COUNT ( * ) END * + 26 ) NOT BETWEEN + col2 * COUNT ( + col1 ) - + col2 / ( + 64 ) AND ( COUNT ( col2 ) ) AND NOT - col1 = 88 + - col2
----

query I rowsort
SELECT - col0 + - - col0 AS col0 FROM tab0 AS cor0 WHERE ( 99 ) NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT - col0 + - col1 AS col1 FROM tab2 cor0 GROUP BY col0, col2, col1 HAVING - col2 IS NOT NULL
----
-133
-150
-76

onlyif mysql # aggregate syntax: 
query I rowsort label-7173
SELECT DISTINCT - col0 * - + COUNT( * ) FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-7173
SELECT DISTINCT - col0 * - + COUNT ( * ) FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-7174
SELECT ALL col0 * col2 * 96 DIV + + col0 col0 FROM tab1 GROUP BY col2, col0, col2 HAVING ( NULL ) IS NULL
----
4320
6816
768

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7174
SELECT ALL col0 * col2 * 96 / + + col0 col0 FROM tab1 GROUP BY col2, col0, col2 HAVING ( NULL ) IS NULL
----
4320
6816
768

query I rowsort
SELECT DISTINCT col1 * 40 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
3240

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 96, + - col2 * - 1 ) FROM tab2 GROUP BY col1
----
96
96
96

onlyif mysql # aggregate syntax: 
query I rowsort label-7177
SELECT DISTINCT ( + MIN( DISTINCT col0 ) ) FROM tab2 GROUP BY col0, col1 HAVING - - 45 * ( - COUNT( * ) * - 38 ) NOT BETWEEN NULL AND - col1 - - 3
----
15
91
92

skipif mysql # not compatible
query I rowsort label-7177
SELECT DISTINCT ( + MIN ( DISTINCT col0 ) ) FROM tab2 GROUP BY col0, col1 HAVING - - 45 * ( - COUNT ( * ) * - 38 ) NOT BETWEEN NULL AND - col1 - - 3
----
15
91
92

query I rowsort
SELECT ALL col0 + + 66 FROM tab2 GROUP BY col1, col0
----
157
158
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2 HAVING ( + col2 IS NULL )
----

query I rowsort
SELECT ALL + + 24 + col1 + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( + + 71 ) NOT BETWEEN 23 AND + 31
----

query I rowsort
SELECT + col1 * 85 * - + 93 + + - 98 + + - 79 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7182
SELECT COUNT( * ) * - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING COUNT( - 78 ) IS NOT NULL
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-7182
SELECT COUNT ( * ) * - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING COUNT ( - 78 ) IS NOT NULL
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query II rowsort label-7183
SELECT DISTINCT - col1 AS col0, col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1 HAVING NULL >= + 22 * - COUNT( * )
----

skipif mysql # not compatible
query II rowsort label-7183
SELECT DISTINCT - col1 AS col0, col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1 HAVING NULL >= + 22 * - COUNT ( * )
----

query I rowsort
SELECT 53 * - col1 + - col1 AS col1 FROM tab1 GROUP BY col1
----
-2376
-3078
-324

query I rowsort
SELECT 56 AS col1 FROM tab1 GROUP BY col2
----
56
56
56

onlyif mysql # aggregate syntax: 
query I rowsort label-7186
SELECT - COUNT( * ) + - col0 FROM tab1 GROUP BY col0
----
-23
-29
-83

skipif mysql # not compatible
query I rowsort label-7186
SELECT - COUNT ( * ) + - col0 FROM tab1 GROUP BY col0
----
-23
-29
-83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7187
SELECT DISTINCT CAST( - + 12 AS SIGNED ) * - COUNT( * ) AS col1 FROM tab0 WHERE - 58 IS NULL GROUP BY col0, col2, col0
----

skipif mysql # not compatible
query I rowsort label-7187
SELECT DISTINCT CAST ( - + 12 AS INTEGER ) * - COUNT ( * ) AS col1 FROM tab0 WHERE - 58 IS NULL GROUP BY col0, col2, col0
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7188
SELECT ALL - COUNT( * ) * + CAST( NULL AS SIGNED ) + - + 18 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7188
SELECT ALL - COUNT ( * ) * + CAST ( NULL AS INTEGER ) + - + 18 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT 66 * - col1 + col1, + col1 FROM tab1 GROUP BY col1
----
-2860
44
-3705
57
-390
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7190
SELECT + CAST( NULL AS SIGNED ) / + col1 AS col0 FROM tab1 AS cor0 WHERE NOT + 56 BETWEEN - - 14 + col2 * - + col1 / - col1 * + - col1 AND - ( + col1 ) + + col2 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7190
SELECT + CAST ( NULL AS INTEGER ) / + col1 AS col0 FROM tab1 AS cor0 WHERE NOT + 56 BETWEEN - - 14 + col2 * - + col1 / - col1 * + - col1 AND - ( + col1 ) + + col2 GROUP BY col1, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7191
SELECT ALL - col2 * 66 FROM tab2 WHERE ( NOT ( NULL ) IS NOT NULL ) GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN ( NULL ) AND COALESCE ( col2, - CAST( 37 AS SIGNED ) ) + + col2
----

skipif mysql # not compatible
query I rowsort label-7191
SELECT ALL - col2 * 66 FROM tab2 WHERE ( NOT ( NULL ) IS NOT NULL ) GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN ( NULL ) AND COALESCE ( col2, - CAST ( 37 AS INTEGER ) ) + + col2
----

query I rowsort
SELECT - 88 FROM tab1 GROUP BY col1, col0
----
-88
-88
-88

query II rowsort
SELECT ALL + ( - col0 ), col0 + - - 85 + col0 AS col0 FROM tab2 GROUP BY col0
----
-15
115
-91
267
-92
269

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7194
SELECT - + col0 - + COUNT( * ) + + 96 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( NULL ) BETWEEN + COUNT( * ) + + col0 + - ( 59 ) AND ( col0 * + CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-7194
SELECT - + col0 - + COUNT ( * ) + + 96 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( NULL ) BETWEEN + COUNT ( * ) + + col0 + - ( 59 ) AND ( col0 * + CAST ( NULL AS INTEGER ) )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7195
SELECT + COUNT( * ) FROM tab0 AS cor0 WHERE col0 * - - col0 IN ( + CAST( NULL AS SIGNED ), + col1 + ( + 12 ) + + + col1 / col0 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-7195
SELECT + COUNT ( * ) FROM tab0 AS cor0 WHERE col0 * - - col0 IN ( + CAST ( NULL AS INTEGER ), + col1 + ( + 12 ) + + + col1 / col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT col1 + - col1 AS col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
0

query I rowsort
SELECT - 24 AS col1 FROM tab1 cor0 GROUP BY col0
----
-24
-24
-24

onlyif mysql # aggregate syntax: 
query I rowsort label-7198
SELECT + - ( - COUNT( * ) ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7198
SELECT + - ( - COUNT ( * ) ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
1
1
1

query I rowsort
SELECT col1 + - - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
133
150
76

query I rowsort
SELECT ALL + 93 FROM tab0 AS cor0 GROUP BY col0, col0
----
93
93
93

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 54 col2 FROM tab1 GROUP BY col1, col1
----
54
54
54

onlyif mysql # aggregate syntax: 
query I rowsort label-7202
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING COUNT( * ) > - col1
----
45
71
8

skipif mysql # not compatible
query I rowsort label-7202
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING COUNT ( * ) > - col1
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-7203
SELECT DISTINCT - 1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT( * ) IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-7203
SELECT DISTINCT - 1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT ( * ) IS NOT NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT - 81 * - - col2 < NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7205
SELECT ALL COUNT( * ) + + col2 * + 93 + + + col2 * + col2 + CAST( NULL AS SIGNED ) + + MIN( - col2 ) / + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7205
SELECT ALL COUNT ( * ) + + col2 * + 93 + + + col2 * + col2 + CAST ( NULL AS INTEGER ) + + MIN ( - col2 ) / + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col2 AS col1, col1 col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
57
-71
44
-8
6

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7208
SELECT COUNT( * ) FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7208
SELECT COUNT ( * ) FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7209
SELECT ALL col2 + CAST( NULL AS SIGNED ) col1, + 22 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7209
SELECT ALL col2 + CAST ( NULL AS INTEGER ) col1, + 22 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - ( + 66 ) * col2 + + col2 * + ( col2 ) - + 26 AS col0 FROM tab0 GROUP BY col2
----
-1034
-1090
1001

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-7211
SELECT DISTINCT + col2 AS col0, col2 + - 4 + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT 52 * + CAST( NULL AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-7211
SELECT DISTINCT + col2 AS col0, col2 + - 4 + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT 52 * + CAST ( NULL AS REAL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col1, col1 col0 FROM tab1 cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + + 38 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
38

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7214
SELECT col1 / + col1 * + 80 * - col1 + + - col1 / + CAST( NULL AS SIGNED ) * - + col1 * - 31 * + SUM( - - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING 94 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7214
SELECT col1 / + col1 * + 80 * - col1 + + - col1 / + CAST ( NULL AS INTEGER ) * - + col1 * - 31 * + SUM ( - - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING 94 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - 7 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
19
36
76

onlyif mysql # aggregate syntax: 
query I rowsort label-7216
SELECT - col1 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1, col0 HAVING NOT COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7216
SELECT - col1 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1, col0 HAVING NOT COUNT ( * ) IS NULL
----

query I rowsort
SELECT DISTINCT - 1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-7218
SELECT MIN( ALL - col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NOT + - col2 IS NULL
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-7218
SELECT MIN ( ALL - col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NOT + - col2 IS NULL
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-7219
SELECT + + COUNT( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - COUNT( * ) IS NULL
----
1
2

skipif mysql # not compatible
query I rowsort label-7219
SELECT + + COUNT ( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - COUNT ( * ) IS NULL
----
1
2

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7220
SELECT DISTINCT 11 + + CAST( NULL AS SIGNED ) * - COUNT( * ) FROM tab2 GROUP BY col0, col1 HAVING NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-7220
SELECT DISTINCT 11 + + CAST ( NULL AS INTEGER ) * - COUNT ( * ) FROM tab2 GROUP BY col0, col1 HAVING NULL >= NULL
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST( 96 AS DECIMAL ) ) AND - 45 * CASE COUNT( - 11 ) / - SUM( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX ( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST ( 96 AS REAL ) ) AND - 45 * CASE COUNT ( - 11 ) / - SUM ( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7222
SELECT DISTINCT CAST( NULL AS SIGNED ) * CAST( NULL AS SIGNED ) + + 13 - col0 * + col0 - - ( - 64 ) * col2 + 95 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1, col0 HAVING NULL NOT BETWEEN - col1 AND NULL
----

skipif mysql # not compatible
query I rowsort label-7222
SELECT DISTINCT CAST ( NULL AS INTEGER ) * CAST ( NULL AS INTEGER ) + + 13 - col0 * + col0 - - ( - 64 ) * col2 + 95 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1, col0 HAVING NULL NOT BETWEEN - col1 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7223
SELECT ALL COUNT( * ) AS col1 FROM tab0 GROUP BY col2, col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7223
SELECT ALL COUNT ( * ) AS col1 FROM tab0 GROUP BY col2, col0, col0
----
1
1
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7224
SELECT ALL - CAST( NULL AS SIGNED ) / - COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7224
SELECT ALL - CAST ( NULL AS INTEGER ) / - COUNT ( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 58 FROM tab1 AS cor0 GROUP BY col2 HAVING 45 IS NOT NULL
----
58
58
58

query I rowsort
SELECT + col1 * - + col1 * + + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-185193
-216
-85184

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7227
SELECT COUNT( * ) * - - CAST( - CASE + + col2 WHEN + col2 THEN NULL ELSE col2 END AS SIGNED ) * - col2 + - - col2 AS col1 FROM tab2 cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7227
SELECT COUNT ( * ) * - - CAST ( - CASE + + col2 WHEN + col2 THEN NULL ELSE col2 END AS INTEGER ) * - col2 + - - col2 AS col1 FROM tab2 cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7228
SELECT MIN( + col0 ) FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-7228
SELECT MIN ( + col0 ) FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - col2 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT - - 13 FROM tab0 AS cor0 WHERE NULL BETWEEN - 26 * - col0 + 40 * + col2 AND NULL GROUP BY col1, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7231
SELECT COUNT( * ) AS col2 FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7231
SELECT COUNT ( * ) AS col2 FROM tab2 GROUP BY col0
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7232
SELECT DISTINCT SUM( ALL + + ( + + col1 ) ) * - col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

skipif mysql # not compatible
query I rowsort label-7232
SELECT DISTINCT SUM ( ALL + + ( + + col1 ) ) * - col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

onlyif mysql # DIV for integer division: 
query I rowsort label-7233
SELECT col0 DIV - 38 AS col2 FROM tab1 GROUP BY col0
----
-2
0
0

skipif mysql # not compatible
query I rowsort label-7233
SELECT col0 / - 38 AS col2 FROM tab1 GROUP BY col0
----
-2
0
0

query I rowsort
SELECT DISTINCT + 13 - + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + 57 * - col0 - - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
5096
5152
840

query II rowsort
SELECT DISTINCT + col1 AS col2, 67 FROM tab1 GROUP BY col1
----
44
67
57
67
6
67

onlyif mysql # aggregate syntax: 
query I rowsort label-7237
SELECT col1 FROM tab1 GROUP BY col1 HAVING - - COUNT( * ) + + col1 + + 13 < + 12
----

skipif mysql # not compatible
query I rowsort label-7237
SELECT col1 FROM tab1 GROUP BY col1 HAVING - - COUNT ( * ) + + col1 + + 13 < + 12
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 59, + 39 * + col2 * - 15 ) + + - col0 + + 91 * + - 10 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1013
-1025
-1133

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7239
SELECT - 65 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT - ( - COUNT( * ) ) BETWEEN - - CAST( NULL AS SIGNED ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-7239
SELECT - 65 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT - ( - COUNT ( * ) ) BETWEEN - - CAST ( NULL AS INTEGER ) AND NULL
----

query I rowsort
SELECT DISTINCT - - ( col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
41
59
61

onlyif mysql # aggregate syntax: 
query II rowsort label-7241
SELECT col1, + COUNT( * ) FROM tab1 GROUP BY col1
----
44
1
57
1
6
1

skipif mysql # not compatible
query II rowsort label-7241
SELECT col1, + COUNT ( * ) FROM tab1 GROUP BY col1
----
44
1
57
1
6
1

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7242
SELECT CAST( + col1 AS SIGNED ), 47 AS col2 FROM tab1 GROUP BY col1
----
44
47
57
47
6
47

skipif mysql # not compatible
query II rowsort label-7242
SELECT CAST ( + col1 AS INTEGER ), 47 AS col2 FROM tab1 GROUP BY col1
----
44
47
57
47
6
47

query II rowsort
SELECT DISTINCT + COALESCE ( - ( 97 ), + col0 ) AS col0, col0 AS col1 FROM tab2 GROUP BY col2, col0
----
-97
15
-97
91
-97
92

onlyif mysql # aggregate syntax: 
query I rowsort label-7244
SELECT + COUNT( * ) - - - col2 FROM tab1 GROUP BY col2
----
-44
-7
-70

skipif mysql # not compatible
query I rowsort label-7244
SELECT + COUNT ( * ) - - - col2 FROM tab1 GROUP BY col2
----
-44
-7
-70

query I rowsort
SELECT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-7246
SELECT ALL - 37 * + col2 + - col0 + - ( - ( COUNT( ALL + - col2 ) ) ) + + + col2 + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) < + col2
----

skipif mysql # not compatible
query I rowsort label-7246
SELECT ALL - 37 * + col2 + - col0 + - ( - ( COUNT ( ALL + - col2 ) ) ) + + + col2 + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) < + col2
----

query I rowsort
SELECT ALL 51 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
51
51
51

query I rowsort
SELECT + NULLIF ( 39, + col1 * col1 * - 97 ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
39
39
39

query I rowsort
SELECT 51 AS col0 FROM tab1 GROUP BY col2, col1 HAVING - col2 * + col2 IS NOT NULL
----
51
51
51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + + col2 col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7251
SELECT DISTINCT + SUM( ALL - 9 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7251
SELECT DISTINCT + SUM ( ALL - 9 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 - - 33 * - - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
3003
3036
495

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7253
SELECT ALL COUNT( * ) - 4 AS col0 FROM tab0 WHERE NOT - + 10 > + CAST( NULL AS SIGNED ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7253
SELECT ALL COUNT ( * ) - 4 AS col0 FROM tab0 WHERE NOT - + 10 > + CAST ( NULL AS INTEGER ) GROUP BY col1
----

query I rowsort
SELECT 27 * col1 FROM tab2 cor0 GROUP BY col1, col2
----
1107
1593
1647

query I rowsort
SELECT ALL - ( - 90 ) * + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7256
SELECT col2 + - col2 + - + col2 * + - CAST( NULL AS SIGNED ) * + col2 * col2 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7256
SELECT col2 + - col2 + - + col2 * + - CAST ( NULL AS INTEGER ) * + col2 * col2 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7258
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2, col0 HAVING - CAST( NULL AS SIGNED ) * 14 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7258
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2, col0 HAVING - CAST ( NULL AS INTEGER ) * 14 IS NOT NULL
----

query I rowsort
SELECT ALL 18 * - col2 AS col0 FROM tab0 GROUP BY col2, col0
----
-1422
-432
-684

onlyif mysql # DIV for integer division: 
query I rowsort label-7260
SELECT - col0 * + col0 DIV col0 + 30 FROM tab1 GROUP BY col0
----
-52
2
8

skipif mysql # not compatible
query I rowsort label-7260
SELECT - col0 * + col0 / col0 + 30 FROM tab1 GROUP BY col0
----
-52
2
8

query I rowsort
SELECT ALL 52 FROM tab2 GROUP BY col2, col0
----
52
52
52

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + 12 FROM tab0 AS cor0 GROUP BY col0
----
12

onlyif mysql # aggregate syntax: 
query I rowsort label-7264
SELECT + - MAX( ALL + col2 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-7264
SELECT + - MAX ( ALL + col2 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col1, col0 HAVING col0 = col1
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7266
SELECT + 48 DIV 54 * COUNT( * ) * + + COUNT( * ) + - COUNT( * ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7266
SELECT + 48 / 54 * COUNT ( * ) * + + COUNT ( * ) + - COUNT ( * ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

query I rowsort
SELECT + ( col1 ) + - col1 AS col0 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL - 92 + + col0 + - col0 FROM tab1 GROUP BY col0
----
-92
-92
-92

query I rowsort
SELECT ALL ( col1 ) * + - 69 AS col2 FROM tab1 GROUP BY col1 HAVING - - 74 * + - 21 > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7270
SELECT DISTINCT - COUNT( * ) + col0 * - - 32 AS col2 FROM tab0 GROUP BY col0
----
1375
2655
831

skipif mysql # not compatible
query I rowsort label-7270
SELECT DISTINCT - COUNT ( * ) + col0 * - - 32 AS col2 FROM tab0 GROUP BY col0
----
1375
2655
831

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING - 86 IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7273
SELECT + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7273
SELECT + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT + col0 + - col0, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
0
22
0
28
0
82

onlyif mysql # aggregate syntax: 
query I rowsort label-7275
SELECT ALL MIN( ALL + - col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING - 91 <= 9
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-7275
SELECT ALL MIN ( ALL + - col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING - 91 <= 9
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-7276
SELECT - 64 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - COUNT( * ) IS NOT NULL
----
-64
-64
-64

skipif mysql # not compatible
query I rowsort label-7276
SELECT - 64 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - COUNT ( * ) IS NOT NULL
----
-64
-64
-64

onlyif mysql # DIV for integer division: 
query I rowsort label-7277
SELECT DISTINCT + 10 DIV col2 FROM tab0 AS cor0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-7277
SELECT DISTINCT + 10 / col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1 HAVING col1 IS NOT NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 AS col0, col2 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
58
59
79
61
87

query II rowsort
SELECT - - col0 AS col0, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
22
28
28
82
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7281
SELECT DISTINCT + NULLIF ( + CAST( NULL AS SIGNED ), + 26 - + col2 ) * NULLIF ( col0, + 41 ) FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING ( NOT ( NULL ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-7281
SELECT DISTINCT + NULLIF ( + CAST ( NULL AS INTEGER ), + 26 - + col2 ) * NULLIF ( col0, + 41 ) FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING ( NOT ( NULL ) IS NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7282
SELECT ALL - + 57 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - SUM( ALL - col2 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7282
SELECT ALL - + 57 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - SUM ( ALL - col2 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7283
SELECT DISTINCT - col0 - + COUNT( * ) DIV - + ( - 78 ) col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7283
SELECT DISTINCT - col0 - + COUNT ( * ) / - + ( - 78 ) col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING + 41 > NULL
----

query I rowsort
SELECT DISTINCT 27 * - 86 FROM tab0 GROUP BY col1
----
-2322

query I rowsort
SELECT ALL 41 + col0 AS col1 FROM tab0 GROUP BY col0
----
124
67
84

query I rowsort
SELECT + - 89 * - - col0 AS col2 FROM tab1 cor0 WHERE NOT col2 * - col1 * + 84 IS NULL GROUP BY col0, col1
----
-1958
-2492
-7298

query I rowsort
SELECT + ( - col2 ) + + col2 + + - col2 AS col1 FROM tab2 GROUP BY col2
----
-58
-79
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-7289
SELECT COUNT( * ) FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7289
SELECT COUNT ( * ) FROM tab2 GROUP BY col0
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 70 col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-70
-70

query I rowsort
SELECT ALL 86 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
86
86
86

query I rowsort
SELECT DISTINCT + + 74 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
74

onlyif mysql # aggregate syntax: 
query I rowsort label-7293
SELECT + - 27 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL NOT BETWEEN col2 + - ( - + COUNT( * ) ) / col2 * - col2 * + col1 AND COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-7293
SELECT + - 27 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL NOT BETWEEN col2 + - ( - + COUNT ( * ) ) / col2 * - col2 * + col1 AND COUNT ( * )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7294
SELECT DISTINCT col1 + 74 + 43 + + + col1 + - - CAST( col1 AS SIGNED ) / + col1 * 55, ( 24 ) AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-7294
SELECT DISTINCT col1 + 74 + 43 + + + col1 + - - CAST ( col1 AS INTEGER ) / + col1 * 55, ( 24 ) AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7295
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7295
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 4 * + + ( - col2 ) * 73 FROM tab0 GROUP BY col0, col2
----
-11096
-23068
-7008

onlyif mysql # aggregate syntax: 
query I rowsort label-7297
SELECT ALL - 27 * - col1 FROM tab1 GROUP BY col1 HAVING + 6 + COUNT( * ) IS NOT NULL
----
1188
1539
162

skipif mysql # not compatible
query I rowsort label-7297
SELECT ALL - 27 * - col1 FROM tab1 GROUP BY col1 HAVING + 6 + COUNT ( * ) IS NOT NULL
----
1188
1539
162

onlyif mysql # aggregate syntax: 
query I rowsort label-7298
SELECT ALL - + 29 / + - COUNT( * ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( ( - 65 ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7298
SELECT ALL - + 29 / + - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( ( - 65 ) ) IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING + 80 IS NOT NULL
----
15
91
92

query I rowsort
SELECT + col2 - + + 58 FROM tab1 AS cor0 GROUP BY col2
----
-13
-50
13

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - 15 * + - col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7302
SELECT DISTINCT - ( - 32 ) + CAST( SUM( ALL - + 23 ) AS SIGNED ), col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <= COUNT( * )
----

skipif mysql # not compatible
query II rowsort label-7302
SELECT DISTINCT - ( - 32 ) + CAST ( SUM ( ALL - + 23 ) AS INTEGER ), col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <= COUNT ( * )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7303
SELECT 60 DIV col0 FROM tab0 GROUP BY col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-7303
SELECT 60 / col0 FROM tab0 GROUP BY col0
----
0
1
2

onlyif mysql # aggregate syntax: 
query I rowsort label-7304
SELECT MAX( DISTINCT + - 71 ) * + + SUM( ALL - NULLIF ( col2, ( col1 ) ) ) * - COUNT( * ) + + + COUNT( * ) AS col0 FROM tab0 GROUP BY col2
----
-1703
-2697
-5608

skipif mysql # not compatible
query I rowsort label-7304
SELECT MAX ( DISTINCT + - 71 ) * + + SUM ( ALL - NULLIF ( col2, ( col1 ) ) ) * - COUNT ( * ) + + + COUNT ( * ) AS col0 FROM tab0 GROUP BY col2
----
-1703
-2697
-5608

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT + + 99 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7306
SELECT + MIN( + 14 ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
14
14
14

skipif mysql # not compatible
query I rowsort label-7306
SELECT + MIN ( + 14 ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
14
14
14

query I rowsort
SELECT ( col2 ) AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 * + 43 - col0 * - col2 col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING + col2 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7309
SELECT + COUNT( * ), + col0 * col0 * + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
1
10648
1
21952
1
551368

skipif mysql # not compatible
query II rowsort label-7309
SELECT + COUNT ( * ), + col0 * col0 * + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
1
10648
1
21952
1
551368

query II rowsort
SELECT + col0 + + - col0, - col0 * + COALESCE ( + - 86, + - 98 ) AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING 92 + + + 40 * + 25 > col0
----
0
2236
0
3698
0
7138

onlyif mysql # DIV for integer division: 
query I rowsort label-7311
SELECT ALL - - col0 + col1 + + col0 * + - ( - - col1 ) - 8 DIV + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT 5 = ( ( - col0 ) + 2 )
----
-104
-1511
-3482

skipif mysql # not compatible
query I rowsort label-7311
SELECT ALL - - col0 + col1 + + col0 * + - ( - - col1 ) - 8 / + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT 5 = ( ( - col0 ) + 2 )
----
-104
-1511
-3482

query I rowsort
SELECT - 23 AS col1 FROM tab0 GROUP BY col1, col2
----
-23
-23
-23

onlyif mysql # aggregate syntax: 
query I rowsort label-7313
SELECT + col2 * + 38 * + COUNT( * ) * 83 FROM tab0 GROUP BY col2, col0
----
119852
249166
75696

skipif mysql # not compatible
query I rowsort label-7313
SELECT + col2 * + 38 * + COUNT ( * ) * 83 FROM tab0 GROUP BY col2, col0
----
119852
249166
75696

onlyif mysql # DIV for integer division: 
query I rowsort label-7314
SELECT + 66 DIV 65 + + col2 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
46
72
9

skipif mysql # not compatible
query I rowsort label-7314
SELECT + 66 / 65 + + col2 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
46
72
9

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT 5 AS col1, 15 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7317
SELECT ( + COUNT( * ) ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7317
SELECT ( + COUNT ( * ) ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1
1
1

query I rowsort
SELECT ALL col2 * + 22 FROM tab0 GROUP BY col2 HAVING - 5 BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7319
SELECT ALL - + col0 * - COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL < + COUNT( - col1 ) * - 7
----

skipif mysql # not compatible
query I rowsort label-7319
SELECT ALL - + col0 * - COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL < + COUNT ( - col1 ) * - 7
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7320
SELECT - 79 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT col0 * ( SUM( DISTINCT + col2 ) ) IN ( - COUNT( ALL + - col0 ) ) OR NOT NULL IS NOT NULL
----
-79
-79
-79

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7320
SELECT - 79 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT col0 * ( SUM ( DISTINCT + col2 ) ) IN ( - COUNT ( ALL + - col0 ) ) OR NOT NULL IS NOT NULL
----
-79
-79
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-7321
SELECT ALL + + 51 + - + 36 + - COUNT( * ) - + 32 FROM tab0 AS cor0 GROUP BY col1
----
-18
-19

skipif mysql # not compatible
query I rowsort label-7321
SELECT ALL + + 51 + - + 36 + - COUNT ( * ) - + 32 FROM tab0 AS cor0 GROUP BY col1
----
-18
-19

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 col1, ( + - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
-81
0
0

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NULL > - - col1
----

query I rowsort
SELECT 79 * - ( col0 ) FROM tab0 GROUP BY col0, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 * col2 FROM tab1 GROUP BY col2, col1
----
2565
3124
48

onlyif mysql # aggregate syntax: 
query I rowsort label-7326
SELECT + col2 + - 87 + - 37 FROM tab1 WHERE NOT - col0 / + col0 - + - col0 IS NULL GROUP BY col2, col1 HAVING NOT NULL NOT IN ( COUNT( * ), - col1 + + col2 )
----

skipif mysql # not compatible
query I rowsort label-7326
SELECT + col2 + - 87 + - 37 FROM tab1 WHERE NOT - col0 / + col0 - + - col0 IS NULL GROUP BY col2, col1 HAVING NOT NULL NOT IN ( COUNT ( * ), - col1 + + col2 )
----

query I rowsort
SELECT 50 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL - 34 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-34
-34
-34

onlyif mysql # aggregate syntax: 
query I rowsort label-7329
SELECT ALL + COUNT( DISTINCT - - 68 ) AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7329
SELECT ALL + COUNT ( DISTINCT - - 68 ) AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
1
1
1

query I rowsort
SELECT 70 + + 5 FROM tab1 AS cor0 GROUP BY col1, col1
----
75
75
75

onlyif mysql # aggregate syntax: 
query I rowsort label-7331
SELECT - - col2 + - ( - + col1 ) FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - ( + 78 ) * + - 98 + + - col2 + col2 * - MAX( col0 ) - - - col1 + - + SUM( DISTINCT + + ( + col2 ) ) * AVG ( - col1 ) IS NULL
----
102
115
14

skipif mysql # not compatible
query I rowsort label-7331
SELECT - - col2 + - ( - + col1 ) FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - ( + 78 ) * + - 98 + + - col2 + col2 * - MAX ( col0 ) - - - col1 + - + SUM ( DISTINCT + + ( + col2 ) ) * AVG ( - col1 ) IS NULL
----
102
115
14

query I rowsort
SELECT 8 / + col2 AS col0 FROM tab0 AS cor0 WHERE col2 IS NULL GROUP BY col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7333
SELECT ALL + + CAST( NULL AS SIGNED ) + - col0 - + 77 * + col0 + col0 + COUNT( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7333
SELECT ALL + + CAST ( NULL AS INTEGER ) + - col0 - + 77 * + col0 + col0 + COUNT ( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7334
SELECT CAST( NULL AS SIGNED ) * + col0 + - 85 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7334
SELECT CAST ( NULL AS INTEGER ) * + col0 + - 85 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT col1, 27 + + col1 * 29 * + 24 + - col0 FROM tab0 GROUP BY col1, col0
----
0
-56
0
1
81
56360

query I rowsort
SELECT - - col2 FROM tab1 cor0 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7337
SELECT ALL + col1 DIV - COUNT( * ) FROM tab1 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-7337
SELECT ALL + col1 / - COUNT ( * ) FROM tab1 GROUP BY col1
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7338
SELECT CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN - 99 AND - 6
----

skipif mysql # not compatible
query I rowsort label-7338
SELECT CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN - 99 AND - 6
----

query I rowsort
SELECT ALL + + 88 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
88
88
88

query I rowsort
SELECT ALL ( + 80 ) AS col1 FROM tab1 AS cor0 WHERE NOT + col0 + + col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col2 * + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query II rowsort
SELECT col1, 32 + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
32
81
-49

onlyif mysql # aggregate syntax: 
query I rowsort label-7343
SELECT ALL MAX( - - col1 ) AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-7343
SELECT ALL MAX ( - - col1 ) AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 FROM tab2 cor0 WHERE NULL < ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-7346
SELECT + COUNT( * ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7346
SELECT + COUNT ( * ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7347
SELECT DISTINCT - col2 * + - SUM( ALL - CASE - 33 WHEN + 30 THEN 17 ELSE NULL END ) FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7347
SELECT DISTINCT - col2 * + - SUM ( ALL - CASE - 33 WHEN + 30 THEN 17 ELSE NULL END ) FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7348
SELECT + col2 * COALESCE ( + CAST( + col1 AS SIGNED ), MIN( + col2 ) * - - 21 + + - 54 ), - col1 col0 FROM tab2 GROUP BY col1, col2 HAVING ( NULL ) NOT IN ( + col2 + + col0 + - col0 * + col0 + + + col2, - 97, - - col0 - - col2 + - 44 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7348
SELECT + col2 * COALESCE ( + CAST ( + col1 AS INTEGER ), MIN ( + col2 ) * - - 21 + + - 54 ), - col1 col0 FROM tab2 GROUP BY col1, col2 HAVING ( NULL ) NOT IN ( + col2 + + col0 + - col0 * + col0 + + + col2, - 97, - - col0 - - col2 + - 44 )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7349
SELECT DISTINCT COUNT( * ), col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <= col2 * 26 + 4
----

skipif mysql # not compatible
query II rowsort label-7349
SELECT DISTINCT COUNT ( * ), col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <= col2 * 26 + 4
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7350
SELECT ALL col1 DIV + col1 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NOT - - ( + 29 ) * + col1 + - 50 + col1 < col2
----
1

skipif mysql # not compatible
query I rowsort label-7350
SELECT ALL col1 / + col1 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NOT - - ( + 29 ) * + col1 + - 50 + col1 < col2
----
1

query I rowsort
SELECT DISTINCT - 44 AS col2 FROM tab0 GROUP BY col2
----
-44

query I rowsort
SELECT - - col0 * - col0 + + col0 AS col2 FROM tab0 AS cor0 WHERE ( - + col1 * col0 - - col0 NOT BETWEEN + - col0 AND + - 82 ) GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT 5 FROM tab1 AS cor0 GROUP BY col0
----
5
5
5

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7354
SELECT col2 DIV - COUNT( * ) AS col1 FROM tab2 GROUP BY col2
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-7354
SELECT col2 / - COUNT ( * ) AS col1 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - 77 * + + 12 FROM tab2 AS cor0 GROUP BY col0
----
-924
-924
-924

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-7356
SELECT + COALESCE ( - 31, + - col0 DIV - col1 + + col1, - 64, CAST( NULL AS SIGNED ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7356
SELECT + COALESCE ( - 31, + - col0 / - col1 + + col1, - 64, CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

query I rowsort
SELECT DISTINCT + 58 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 86 col1 FROM tab1 GROUP BY col2
----
86
86
86

query I rowsort
SELECT + 54 AS col1 FROM tab1 GROUP BY col0, col0, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7360
SELECT col0 * col0 * + - MIN( ALL - col0 ) * - col0 + - col0 + - - col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-234256
-45212176
-614656

skipif mysql # not compatible
query I rowsort label-7360
SELECT col0 * col0 * + - MIN ( ALL - col0 ) * - col0 + - col0 + - - col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-234256
-45212176
-614656

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT - 25 + 62 + col2 FROM tab1 AS cor0 WHERE col0 IS NOT NULL GROUP BY col2, col1
----
108
45
82

query I rowsort
SELECT - 16 FROM tab0 GROUP BY col0, col0, col0
----
-16
-16
-16

onlyif mysql # aggregate syntax: 
query I rowsort label-7364
SELECT 96 * + 6 * + COUNT( * ) AS col0 FROM tab1 GROUP BY col1, col1
----
576
576
576

skipif mysql # not compatible
query I rowsort label-7364
SELECT 96 * + 6 * + COUNT ( * ) AS col0 FROM tab1 GROUP BY col1, col1
----
576
576
576

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-7366
SELECT - COUNT( * ) + 0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7366
SELECT - COUNT ( * ) + 0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query II rowsort
SELECT - col2, - col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

onlyif mysql # aggregate syntax: 
query II rowsort label-7368
SELECT col0 AS col1, NULLIF ( + COUNT( * ), col0 ) FROM tab0 GROUP BY col0
----
26
1
43
1
83
1

skipif mysql # not compatible
query II rowsort label-7368
SELECT col0 AS col1, NULLIF ( + COUNT ( * ), col0 ) FROM tab0 GROUP BY col0
----
26
1
43
1
83
1

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7369
SELECT ALL + 34 + - - col1 + 84 DIV + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1, col0
----
124
162
175

skipif mysql # not compatible
query I rowsort label-7369
SELECT ALL + 34 + - - col1 + 84 / + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1, col0
----
124
162
175

query II rowsort
SELECT - col1, - 28 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING 31 IS NULL
----

query I rowsort
SELECT DISTINCT col2 * + col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
2070
5112
72

onlyif mysql # aggregate syntax: 
query I rowsort label-7372
SELECT - 1 + - col1 + COUNT( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT 55 BETWEEN NULL AND - 42 * 27
----
-81
1

skipif mysql # not compatible
query I rowsort label-7372
SELECT - 1 + - col1 + COUNT ( * ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT 55 BETWEEN NULL AND - 42 * 27
----
-81
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7373
SELECT - CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7373
SELECT - CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

query I rowsort
SELECT ALL + col0 FROM tab2 WHERE NOT NULL NOT BETWEEN col0 / - + col1 AND NULL GROUP BY col1, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7375
SELECT ALL + MIN( + + col0 ) * - 52 * - col0 * + - col0 AS col1 FROM tab2 GROUP BY col0
----
-175500
-39185692
-40491776

skipif mysql # not compatible
query I rowsort label-7375
SELECT ALL + MIN ( + + col0 ) * - 52 * - col0 * + - col0 AS col1 FROM tab2 GROUP BY col0
----
-175500
-39185692
-40491776

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-7376
SELECT + col1 + - + SUM( - 98 ) + + + 96 AS col0, col1 * col1 DIV + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
235
41
253
59
255
61

skipif mysql # not compatible
query II rowsort label-7376
SELECT + col1 + - + SUM ( - 98 ) + + + 96 AS col0, col1 * col1 / + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
235
41
253
59
255
61

onlyif mysql # aggregate syntax: 
query I rowsort label-7377
SELECT COUNT( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7377
SELECT COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7378
SELECT ( - col0 ) FROM tab0 GROUP BY col0 HAVING NOT COUNT( * ) * + 19 BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7378
SELECT ( - col0 ) FROM tab0 GROUP BY col0 HAVING NOT COUNT ( * ) * + 19 BETWEEN NULL AND NULL
----

query I rowsort
SELECT 25 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7380
SELECT col2 FROM tab0 WHERE + 1 + col1 * NULLIF ( col2, - 94 + - col0 ) BETWEEN + col1 + col1 * col2 AND + col1 GROUP BY col2, col1 HAVING NOT - COUNT( * ) * col1 + - CASE + 1 WHEN col2 * ( col1 ) THEN COUNT( * ) END IN ( + ( - NULLIF ( + MIN( DISTINCT col1 ), - AVG ( - 46 ) / 2 ) ) )
----

skipif mysql # not compatible
query I rowsort label-7380
SELECT col2 FROM tab0 WHERE + 1 + col1 * NULLIF ( col2, - 94 + - col0 ) BETWEEN + col1 + col1 * col2 AND + col1 GROUP BY col2, col1 HAVING NOT - COUNT ( * ) * col1 + - CASE + 1 WHEN col2 * ( col1 ) THEN COUNT ( * ) END IN ( + ( - NULLIF ( + MIN ( DISTINCT col1 ), - AVG ( - 46 ) / 2 ) ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7381
SELECT DISTINCT COUNT( * ) FROM tab0 WHERE NOT ( ( col1 ) ) * - col1 IN ( - col0 ) GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-7381
SELECT DISTINCT COUNT ( * ) FROM tab0 WHERE NOT ( ( col1 ) ) * - col1 IN ( - col0 ) GROUP BY col2
----
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7382
SELECT + ( col1 ) + + COUNT( * ) FROM tab0 GROUP BY col1
----
2
82

skipif mysql # not compatible
query I rowsort label-7382
SELECT + ( col1 ) + + COUNT ( * ) FROM tab0 GROUP BY col1
----
2
82

query I rowsort
SELECT col0 + - 39 AS col0 FROM tab1 GROUP BY col0 HAVING 38 IS NULL
----

query I rowsort
SELECT ALL col2 * - col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT 97 * + col0 AS col0 FROM tab2 GROUP BY col0, col1
----
1455
8827
8924

query I rowsort
SELECT ALL + col2 + 41 FROM tab2 GROUP BY col2
----
120
128
99

query I rowsort
SELECT col2 AS col2 FROM tab1 WHERE 76 <= + col1 / - col1 GROUP BY col2, col2
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col0, col1 HAVING NOT ( NULL ) > ( NULL )
----

query I rowsort
SELECT + 1 * + col2 FROM tab2 AS cor0 WHERE - col0 <> NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7390
SELECT + col1 + col1 DIV - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
78

skipif mysql # not compatible
query I rowsort label-7390
SELECT + col1 + col1 / - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
78

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7391
SELECT DISTINCT + - CAST( NULL AS SIGNED ) AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7391
SELECT DISTINCT + - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
NULL

query I rowsort
SELECT - col2 + - 82 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-127
-153
-90

onlyif mysql # aggregate syntax: 
query I rowsort label-7393
SELECT ALL COUNT( * ) + + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT 98 / + col0 - + 35 * + col1 <= NULL
----

skipif mysql # not compatible
query I rowsort label-7393
SELECT ALL COUNT ( * ) + + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT 98 / + col0 - + 35 * + col1 <= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7394
SELECT DISTINCT ( col1 ) * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - AVG ( ALL col1 ) NOT BETWEEN + COUNT( * ) + 85 AND ( COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-7394
SELECT DISTINCT ( col1 ) * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - AVG ( ALL col1 ) NOT BETWEEN + COUNT ( * ) + 85 AND ( COUNT ( * ) )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7395
SELECT ALL + col2 + COUNT( * ) - col2 DIV - col2 FROM tab1 GROUP BY col2
----
10
47
73

skipif mysql # not compatible
query I rowsort label-7395
SELECT ALL + col2 + COUNT ( * ) - col2 / - col2 FROM tab1 GROUP BY col2
----
10
47
73

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL >= col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7397
SELECT col0 DIV - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7397
SELECT col0 / - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7398
SELECT + MAX( CAST( NULL AS SIGNED ) ) - - COUNT( * ) col2 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN 4 AND ( 31 + - COUNT( * ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7398
SELECT + MAX ( CAST ( NULL AS INTEGER ) ) - - COUNT ( * ) col2 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN 4 AND ( 31 + - COUNT ( * ) )
----

query I rowsort
SELECT DISTINCT - col1 * + 91 FROM tab2 WHERE NOT col0 IS NULL GROUP BY col1
----
-3731
-5369
-5551

onlyif mysql # aggregate syntax: 
query I rowsort label-7400
SELECT col1 + - COUNT( * ) AS col2 FROM tab0 GROUP BY col1
----
-2
80

skipif mysql # not compatible
query I rowsort label-7400
SELECT col1 + - COUNT ( * ) AS col2 FROM tab0 GROUP BY col1
----
-2
80

query I rowsort
SELECT DISTINCT ( col0 ) AS col0 FROM tab1 GROUP BY col0 HAVING col0 + - 20 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - 91 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( + 46 / + col0 ) IS NULL
----

query I rowsort
SELECT ALL 19 + col0 FROM tab0 AS cor0 GROUP BY col0
----
102
45
62

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 WHERE NOT 14 IS NOT NULL GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + - ( + - ( - 13 ) ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-13
-13
-13

query I rowsort
SELECT ALL col2 + + col2 - + col2 * ( + col2 - - 30 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-288
-3285
-7029

onlyif mysql # aggregate syntax: 
query I rowsort label-7407
SELECT COUNT( ALL + 49 ) + + col2 AS col1 FROM tab1 GROUP BY col2
----
46
72
9

skipif mysql # not compatible
query I rowsort label-7407
SELECT COUNT ( ALL + 49 ) + + col2 AS col1 FROM tab1 GROUP BY col2
----
46
72
9

query I rowsort
SELECT col2 AS col1 FROM tab1 WHERE NOT + col1 / + ( col0 ) + - 89 < NULL GROUP BY col1, col2, col0
----

query I rowsort
SELECT + 72 * col2 AS col0 FROM tab1 GROUP BY col2
----
3240
5112
576

onlyif mysql # aggregate syntax: 
query I rowsort label-7410
SELECT + + ( - ( - CASE col2 WHEN 53 + - 43 THEN + COUNT( * ) WHEN + COUNT( * ) THEN NULL END ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN col2 / ( col2 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-7410
SELECT + + ( - ( - CASE col2 WHEN 53 + - 43 THEN + COUNT ( * ) WHEN + COUNT ( * ) THEN NULL END ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN col2 / ( col2 ) AND NULL
----

query I rowsort
SELECT ALL - 56 AS col1 FROM tab1 AS cor0 WHERE ( NOT ( + 47 ) IS NOT NULL ) OR ( NULL ) >= NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 92 AS col2, - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT - col0 * col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-225
-8281
-8464

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7414
SELECT + ( + CAST( col1 AS DECIMAL ) ) AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7414
SELECT + ( + CAST ( col1 AS REAL ) ) AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + ( col1 ) AS col1 FROM tab0 AS cor0 WHERE col0 + 17 IS NULL GROUP BY col1, col0 HAVING col0 IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7417
SELECT DISTINCT - CASE + COUNT( * ) WHEN - - 35 THEN NULL WHEN 44 / 56 THEN NULL ELSE + AVG ( DISTINCT 43 ) + CAST( NULL AS SIGNED ) END + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING + col1 >= NULL
----

skipif mysql # not compatible
query I rowsort label-7417
SELECT DISTINCT - CASE + COUNT ( * ) WHEN - - 35 THEN NULL WHEN 44 / 56 THEN NULL ELSE + AVG ( DISTINCT 43 ) + CAST ( NULL AS INTEGER ) END + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING + col1 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 61 + - + 17 col0 FROM tab1 GROUP BY col0
----
44

query I rowsort
SELECT + 19 + - 2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7420
SELECT DISTINCT - col1 + col1 FROM tab0 WHERE NOT 79 NOT IN ( + - 84 ) AND ( - col2 + + 74 ) IS NOT NULL GROUP BY col1 HAVING - MAX( - 17 ) - + col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7420
SELECT DISTINCT - col1 + col1 FROM tab0 WHERE NOT 79 NOT IN ( + - 84 ) AND ( - col2 + + 74 ) IS NOT NULL GROUP BY col1 HAVING - MAX ( - 17 ) - + col1 IS NULL
----

query I rowsort
SELECT 56 - + 21 * - 73 FROM tab2 GROUP BY col2, col2, col1
----
1589
1589
1589

onlyif mysql # aggregate syntax: 
query I rowsort label-7422
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col2 HAVING NULL NOT IN ( COUNT( * ) + col2 )
----

skipif mysql # not compatible
query I rowsort label-7422
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col2 HAVING NULL NOT IN ( COUNT ( * ) + col2 )
----

query I rowsort
SELECT ALL col1 + 27 AS col1 FROM tab1 GROUP BY col1, col0
----
33
71
84

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7424
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - + CAST( 99 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7424
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - + CAST ( 99 AS INTEGER ) IS NULL
----

query I rowsort
SELECT ALL + col2 + 25 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
104
112
83

onlyif mysql # aggregate syntax: 
query I rowsort label-7426
SELECT COUNT( * ) * + col0 * + col0 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( 60 + + COUNT( * ) ) NOT IN ( 26 )
----

skipif mysql # not compatible
query I rowsort label-7426
SELECT COUNT ( * ) * + col0 * + col0 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( 60 + + COUNT ( * ) ) NOT IN ( 26 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7427
SELECT DISTINCT COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - - 66 IS NULL
----
1

skipif mysql # not compatible
query I rowsort label-7427
SELECT DISTINCT COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - - 66 IS NULL
----
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7428
SELECT ALL - col0 col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING COUNT( * ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7428
SELECT ALL - col0 col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7429
SELECT 12 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( + 70 - ( 98 + col0 ) <> - 64 + COUNT( * ) )
----
12
12
12

skipif mysql # not compatible
query I rowsort label-7429
SELECT 12 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( + 70 - ( 98 + col0 ) <> - 64 + COUNT ( * ) )
----
12
12
12

query I rowsort
SELECT 82 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
82
82
82

query I rowsort
SELECT 90 + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
114
128
169

query I rowsort
SELECT ALL - 9 FROM tab1 AS cor0 GROUP BY col2
----
-9
-9
-9

query I rowsort
SELECT + 7 FROM tab0 AS cor0 GROUP BY col1
----
7
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + - col1, - col1 col0 FROM tab2 cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT DISTINCT 0 FROM tab1 GROUP BY col2 HAVING NOT + + 90 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-7436
SELECT DISTINCT + ( + - col0 ) DIV - col0 + - + col0 AS col2, + 27 * col0 FROM tab1 GROUP BY col0
----
-21
594
-27
756
-81
2214

skipif mysql # not compatible
query II rowsort label-7436
SELECT DISTINCT + ( + - col0 ) / - col0 + - + col0 AS col2, + 27 * col0 FROM tab1 GROUP BY col0
----
-21
594
-27
756
-81
2214

query I rowsort
SELECT + col1 * + - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL 36 * - ( col2 ) + + 39 FROM tab0 WHERE NOT NULL IN ( NULLIF ( - 40, + - col1 ), + col1 * + col0 ) GROUP BY col2, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7439
SELECT ALL + COUNT( * ) AS col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING - col1 IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7439
SELECT ALL + COUNT ( * ) AS col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING - col1 IS NOT NULL
----
1
1
1

query I rowsort
SELECT ALL - 41 AS col0 FROM tab0 AS cor0 WHERE NOT + col0 BETWEEN NULL AND NULL GROUP BY col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7441
SELECT DISTINCT + COUNT( * ) * SUM( DISTINCT - - CAST( NULL AS SIGNED ) ), col1 + - 62 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-7441
SELECT DISTINCT + COUNT ( * ) * SUM ( DISTINCT - - CAST ( NULL AS INTEGER ) ), col1 + - 62 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - ( + col0 ) AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-7443
SELECT DISTINCT - MIN( + col1 ) FROM tab0 GROUP BY col1, col2 HAVING ( + col1 <= NULL )
----

skipif mysql # not compatible
query I rowsort label-7443
SELECT DISTINCT - MIN ( + col1 ) FROM tab0 GROUP BY col1, col2 HAVING ( + col1 <= NULL )
----

query I rowsort
SELECT DISTINCT - - 7 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
7

query I rowsort
SELECT ALL - col2 + - + ( + - ( ( - col0 ) ) ) * - col0 + - + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
51
8123
8348

query I rowsort
SELECT 78 FROM tab0 AS cor0 WHERE NOT NULL NOT IN ( + 83 * - ( + - col0 ), col1 * - + 38 * + - 66 * + col0 * - 17 / col1 ) GROUP BY col0
----

query I rowsort
SELECT ALL - + col0 + - col0 + 9 * 0 * - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND ( col0 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7448
SELECT + COUNT( * ) * - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + CAST( AVG ( DISTINCT col2 ) AS SIGNED ) <= - col2
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-7448
SELECT + COUNT ( * ) * - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + CAST ( AVG ( DISTINCT col2 ) AS INTEGER ) <= - col2
----
-45
-71
-8

query I rowsort
SELECT + 84 FROM tab2 AS cor0 GROUP BY col2
----
84
84
84

query I rowsort
SELECT DISTINCT + - 13 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-13

onlyif mysql # aggregate syntax: 
query II rowsort label-7451
SELECT DISTINCT + 0 AS col0, + col1 * + - MIN( DISTINCT + col1 ) + ( + col1 ) FROM tab0 GROUP BY col1
----
0
-6480
0
0

skipif mysql # not compatible
query II rowsort label-7451
SELECT DISTINCT + 0 AS col0, + col1 * + - MIN ( DISTINCT + col1 ) + ( + col1 ) FROM tab0 GROUP BY col1
----
0
-6480
0
0

query II rowsort
SELECT + 9, + 53 + - + col1 AS col1 FROM tab2 GROUP BY col1
----
9
-6
9
-8
9
12

onlyif mysql # aggregate syntax: 
query I rowsort label-7453
SELECT COUNT( * ) * + + COUNT( * ) - 14 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL >= ( + col1 )
----

skipif mysql # not compatible
query I rowsort label-7453
SELECT COUNT ( * ) * + + COUNT ( * ) - 14 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL >= ( + col1 )
----

query I rowsort
SELECT col2 - - + 97 FROM tab1 GROUP BY col2, col2
----
105
142
168

query I rowsort
SELECT 16 FROM tab2 GROUP BY col2, col2
----
16
16
16

onlyif mysql # aggregate syntax: 
query I rowsort label-7456
SELECT DISTINCT + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL <> + col1 * + - col1 * + + COUNT( * ) + - col1
----

skipif mysql # not compatible
query I rowsort label-7456
SELECT DISTINCT + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL <> + col1 * + - col1 * + + COUNT ( * ) + - col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7457
SELECT ALL COUNT( * ) FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7457
SELECT ALL COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7458
SELECT + - ( + col1 ) * SUM( DISTINCT - col1 ) FROM tab0 AS cor0 WHERE NOT NULL <= 21 + + ( - 83 ) GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-7458
SELECT + - ( + col1 ) * SUM ( DISTINCT - col1 ) FROM tab0 AS cor0 WHERE NOT NULL <= 21 + + ( - 83 ) GROUP BY col1, col1
----

query I rowsort
SELECT - + col1 * col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7460
SELECT + + SUM( + + 49 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= + col1
----

skipif mysql # not compatible
query I rowsort label-7460
SELECT + + SUM ( + + 49 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= + col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7461
SELECT + + col1 + COUNT( * ) FROM tab2 cor0 GROUP BY col1 HAVING NOT - ( col1 ) IS NULL
----
42
60
62

skipif mysql # not compatible
query I rowsort label-7461
SELECT + + col1 + COUNT ( * ) FROM tab2 cor0 GROUP BY col1 HAVING NOT - ( col1 ) IS NULL
----
42
60
62

query I rowsort
SELECT DISTINCT + 60 + - col0 AS col1 FROM tab2 GROUP BY col0, col1, col1 HAVING NULL <= + - 34 * col0 + + - col1 - - ( - - col1 )
----

query I rowsort
SELECT ALL 98 FROM tab2 GROUP BY col0
----
98
98
98

query I rowsort
SELECT - ( - + col1 ) * + COALESCE ( - col1, col0 * - 86 ) - + col1 * - col0 * col0 * + col0 FROM tab0 GROUP BY col0, col1
----
0
0
6433506

query I rowsort
SELECT ALL + 52 AS col2 FROM tab1 GROUP BY col0, col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-7467
SELECT DISTINCT col2 DIV col1 col0 FROM tab2 GROUP BY col2, col1
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7467
SELECT DISTINCT col2 / col1 col0 FROM tab2 GROUP BY col2, col1
----
1

query I rowsort
SELECT DISTINCT + + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2 HAVING - 10 * col2 IS NULL
----

query I rowsort
SELECT - - 26 AS col0 FROM tab2 WHERE + - 89 / col2 + - col1 - + 93 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 56 + 65 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
121
121
121

query I rowsort
SELECT - - ( + + col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7473
SELECT ALL + - col1 * - - 86 + + - 39 - col1 + - ( + col1 ) DIV + 87 * - + 24 * - COUNT( * ) * - 7 - - 61 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-3545
-5111
-5285

skipif mysql # not compatible
query I rowsort label-7473
SELECT ALL + - col1 * - - 86 + + - 39 - col1 + - ( + col1 ) / + 87 * - + 24 * - COUNT ( * ) * - 7 - - 61 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-3545
-5111
-5285

query I rowsort
SELECT DISTINCT + col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

onlyif mysql # aggregate syntax: 
query III rowsort label-7475
SELECT + 85, ( - col2 ), - ( + - COUNT( ALL - - COALESCE ( - col0, - + col2 ) ) ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

skipif mysql # not compatible
query III rowsort label-7475
SELECT + 85, ( - col2 ), - ( + - COUNT ( ALL - - COALESCE ( - col0, - + col2 ) ) ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7476
SELECT 43 AS col2, COUNT( * ) * - 91 + + 87 AS col2 FROM tab2 GROUP BY col2 HAVING NOT + 16 IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-7476
SELECT 43 AS col2, COUNT ( * ) * - 91 + + 87 AS col2 FROM tab2 GROUP BY col2 HAVING NOT + 16 IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST( - - 33 AS SIGNED ) * - col0 * - col2 + - - 55 - - 27 + MAX( - col0 ) + + - CAST( NULL AS SIGNED ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT( * ) ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST ( - - 33 AS INTEGER ) * - col0 * - col2 + - - 55 - - 27 + MAX ( - col0 ) + + - CAST ( NULL AS INTEGER ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN ( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT ( * ) ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7478
SELECT - col2 + - COUNT( ( 65 ) ) + + col0 + col2 * - + col0 FROM tab2 GROUP BY col0, col2
----
-1378
-5303
-7178

skipif mysql # not compatible
query I rowsort label-7478
SELECT - col2 + - COUNT ( ( 65 ) ) + + col0 + col2 * - + col0 FROM tab2 GROUP BY col0, col2
----
-1378
-5303
-7178

query I rowsort
SELECT - col0 * - col0 + + - 7 AS col2 FROM tab2 GROUP BY col0, col2
----
218
8274
8457

query I rowsort
SELECT DISTINCT - col0 * + - 20 FROM tab0 AS cor0 GROUP BY col0
----
1660
520
860

query I rowsort
SELECT DISTINCT + 34 AS col1 FROM tab1 GROUP BY col1
----
34

query I rowsort
SELECT - + col1 AS col1 FROM tab1 WHERE NOT - ( - col0 ) IS NULL GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT - 72 FROM tab1 AS cor0 GROUP BY col0
----
-72
-72
-72

query II rowsort
SELECT + col1, col1 / - + col1 AS col0 FROM tab0 cor0 WHERE NOT NULL < NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7485
SELECT - + CAST( NULL AS SIGNED ) * - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7485
SELECT - + CAST ( NULL AS INTEGER ) * - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 67 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
67
67
67

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7487
SELECT ALL - - col0 - - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + COALESCE ( - col0, ( col1 ) - + col1 + + + col1 + + - CASE + COUNT( * ) WHEN - 42 THEN NULL WHEN + + COUNT( * ) THEN - MAX( ALL + + ( - col1 ) ) + - col0 * - 88 WHEN col0 THEN CAST( NULL AS SIGNED ) / - 16 END, - COUNT( * ) ) < - col1 * 28 + + 66
----
124

skipif mysql # not compatible
query I rowsort label-7487
SELECT ALL - - col0 - - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + COALESCE ( - col0, ( col1 ) - + col1 + + + col1 + + - CASE + COUNT ( * ) WHEN - 42 THEN NULL WHEN + + COUNT ( * ) THEN - MAX ( ALL + + ( - col1 ) ) + - col0 * - 88 WHEN col0 THEN CAST ( NULL AS INTEGER ) / - 16 END, - COUNT ( * ) ) < - col1 * 28 + + 66
----
124

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 27 col1 FROM tab2 WHERE col1 IS NULL GROUP BY col2, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT - AVG ( DISTINCT col2 ) - + col2 FROM tab0 GROUP BY col2 HAVING + - 9 IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7491
SELECT col1 FROM tab0 AS cor0 WHERE NULL BETWEEN NULL AND ( CAST( - col0 AS SIGNED ) ) GROUP BY col2, col1 HAVING NOT col1 / - - col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7491
SELECT col1 FROM tab0 AS cor0 WHERE NULL BETWEEN NULL AND ( CAST ( - col0 AS INTEGER ) ) GROUP BY col2, col1 HAVING NOT col1 / - - col1 IS NULL
----

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT - col0 = NULL
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 GROUP BY col2 HAVING NOT NULL > + col0
----

query I rowsort
SELECT ALL - col2 + + col2 FROM tab1 GROUP BY col2
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-7497
SELECT COUNT( * ) + + + COUNT( ALL col1 ) + + - col1 * + col1 * - ( + - col1 ) * + col1 + + 67 + - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
-10552683
-1191
-3746091

skipif mysql # not compatible
query I rowsort label-7497
SELECT COUNT ( * ) + + + COUNT ( ALL col1 ) + + - col1 * + col1 * - ( + - col1 ) * + col1 + + 67 + - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
-10552683
-1191
-3746091

query I rowsort
SELECT DISTINCT - ( + - col2 ) AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col2 + + - 50 - - + col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-106
-2030
-5020

onlyif mysql # aggregate syntax: 
query I rowsort label-7500
SELECT - COUNT( * ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + 84 < ( - col1 )
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7500
SELECT - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + 84 < ( - col1 )
----
-1
-1
-1

query II rowsort
SELECT DISTINCT + col2, + 21 * - col2 FROM tab2 cor0 GROUP BY col2
----
58
-1218
79
-1659
87
-1827

query I rowsort
SELECT + 87 FROM tab1 AS cor0 GROUP BY col1, col2
----
87
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 23 * col1 col2 FROM tab1 cor0 GROUP BY col1
----
1012
1311
138

query I rowsort
SELECT DISTINCT - + col2 + col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
0

query I rowsort
SELECT + col2 * col2 * - 19 + + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
-10920
-118500
-27398

query I rowsort
SELECT + + col1 + - col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-16
-38
29

onlyif mysql # aggregate syntax: 
query I rowsort label-7507
SELECT ALL - col2 col1 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL BETWEEN NULL AND 68 + col0 * + ( SUM( ALL - col1 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7507
SELECT ALL - col2 col1 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL BETWEEN NULL AND 68 + col0 * + ( SUM ( ALL - col1 ) )
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT - 89 IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 FROM tab0 WHERE NULL NOT IN ( + col1 / 88 + + COALESCE ( + + col1, 92, + + col2 ), + col1, - + 45 + - 13 * - col2 ) GROUP BY col2 HAVING ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 48 col1 FROM tab0 GROUP BY col0, col1
----
48

onlyif mysql # aggregate syntax: 
query I rowsort label-7511
SELECT ALL MIN( + 64 ) * + col0 AS col2 FROM tab2 GROUP BY col0, col1
----
5824
5888
960

skipif mysql # not compatible
query I rowsort label-7511
SELECT ALL MIN ( + 64 ) * + col0 AS col2 FROM tab2 GROUP BY col0, col1
----
5824
5888
960

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING ( NOT ( NOT NULL IS NULL ) )
----
-44
-57
-6

query II rowsort
SELECT - col1 + + col1, + 45 FROM tab0 GROUP BY col1 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT + 96 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
96
96
96

onlyif mysql # aggregate syntax: 
query I rowsort label-7515
SELECT + col1 * - - 86 FROM tab1 AS cor0 GROUP BY col1 HAVING + + COUNT( * ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-7515
SELECT + col1 * - - 86 FROM tab1 AS cor0 GROUP BY col1 HAVING + + COUNT ( * ) <> NULL
----

query I rowsort
SELECT ALL + + COALESCE ( - col0, + 57 * - + col1 ) * - + col0 * col0 * - col0 * - col0 * - + col1 - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7517
SELECT ALL + CAST( + col0 AS SIGNED ) + + 42, col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < - col0
----

skipif mysql # not compatible
query II rowsort label-7517
SELECT ALL + CAST ( + col0 AS INTEGER ) + + 42, col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < - col0
----

query I rowsort
SELECT + 44 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
44
44
44

onlyif mysql # aggregate syntax: 
query I rowsort label-7519
SELECT - col1 * + MIN( 20 ) AS col2 FROM tab0 GROUP BY col1
----
-1620
0

skipif mysql # not compatible
query I rowsort label-7519
SELECT - col1 * + MIN ( 20 ) AS col2 FROM tab0 GROUP BY col1
----
-1620
0

query I rowsort
SELECT ALL + col0 + + col0 * - 39 AS col0 FROM tab0 GROUP BY col0
----
-1634
-3154
-988

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7521
SELECT 76 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT 3 * + + CAST( + + 67 AS SIGNED ) + 94 > NULL
----

skipif mysql # not compatible
query I rowsort label-7521
SELECT 76 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT 3 * + + CAST ( + + 67 AS INTEGER ) + 94 > NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7522
SELECT DISTINCT + - 63 * + col1 / + + 71 - + - CAST( NULL AS SIGNED ) + ( col1 ) + + COUNT( * ) / + + 8 - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7522
SELECT DISTINCT + - 63 * + col1 / + + 71 - + - CAST ( NULL AS INTEGER ) + ( col1 ) + + COUNT ( * ) / + + 8 - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT 41 + ( col2 ) * - 64 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-2839
-4503
-471

onlyif mysql # aggregate syntax: 
query I rowsort label-7524
SELECT DISTINCT + + 73 FROM tab0 AS cor0 GROUP BY col1 HAVING - COUNT( * ) > NULL
----

skipif mysql # not compatible
query I rowsort label-7524
SELECT DISTINCT + + 73 FROM tab0 AS cor0 GROUP BY col1 HAVING - COUNT ( * ) > NULL
----

query II rowsort
SELECT + 85, + 29 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7526
SELECT ALL - 82 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IN ( 35, AVG ( ALL - col0 ), CASE - 83 WHEN - 49 + COUNT( * ) THEN + COUNT( * ) WHEN + COUNT( * ) + col2 * - + col0 / CAST( + 2 AS DECIMAL ) THEN NULL END * + 64 * + - COUNT( * ), - col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7526
SELECT ALL - 82 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IN ( 35, AVG ( ALL - col0 ), CASE - 83 WHEN - 49 + COUNT ( * ) THEN + COUNT ( * ) WHEN + COUNT ( * ) + col2 * - + col0 / CAST ( + 2 AS REAL ) THEN NULL END * + 64 * + - COUNT ( * ), - col0 )
----

query I rowsort
SELECT DISTINCT - col2 + - + 3 FROM tab0 GROUP BY col2, col0
----
-27
-41
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-7528
SELECT DISTINCT - COUNT( * ) FROM tab2 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-7528
SELECT DISTINCT - COUNT ( * ) FROM tab2 GROUP BY col1
----
-1

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col1, col0, col2 HAVING + col2 IS NOT NULL
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * - col2 col0 FROM tab0 GROUP BY col2, col2, col2 HAVING NULL NOT BETWEEN + - col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7531
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7531
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7532
SELECT - col0 col2, - col0 * - NULLIF ( - COALESCE ( 77, 7 ), col0 + - CAST( NULL AS SIGNED ) ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-1694
-28
-2156
-82
-6314

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7532
SELECT - col0 col2, - col0 * - NULLIF ( - COALESCE ( 77, 7 ), col0 + - CAST ( NULL AS INTEGER ) ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-1694
-28
-2156
-82
-6314

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7533
SELECT + COUNT( * ) + - COUNT( * ) * + col0 + COUNT( col0 ) DIV - - COUNT( 58 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-13
-89
-90

skipif mysql # not compatible
query I rowsort label-7533
SELECT + COUNT ( * ) + - COUNT ( * ) * + col0 + COUNT ( col0 ) / - - COUNT ( 58 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-13
-89
-90

query I rowsort
SELECT - + 3 / - - col1 - col1 - - AVG ( DISTINCT col1 ) * - 71 + + NULLIF ( + + col1, + col1 + - col0 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT 83 NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7535
SELECT DISTINCT + - 30 * + col0 - - col2 + COUNT( * ) + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1 HAVING NOT 70 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7535
SELECT DISTINCT + - 30 * + col0 - - col2 + COUNT ( * ) + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1 HAVING NOT 70 IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col1 + + AVG ( + 55 ) AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( col2 * + 67 <> NULL )
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
-24
-38
-79

query II rowsort
SELECT - 24 * - ( - col1 ) + + 82 + + col1 AS col2, col1 FROM tab1 AS cor0 GROUP BY col1
----
-1229
57
-56
6
-930
44

query I rowsort
SELECT ALL - - col1 FROM tab2 WHERE NOT + + col2 IS NOT NULL GROUP BY col1, col2, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7541
SELECT COUNT( * ) * - COUNT( + col2 ) AS col0 FROM tab2 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7541
SELECT COUNT ( * ) * - COUNT ( + col2 ) AS col0 FROM tab2 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL + col0 * 39 AS col2 FROM tab2 GROUP BY col0 HAVING - ( 27 ) IS NOT NULL
----
3549
3588
585

onlyif mysql # DIV for integer division: 
query II rowsort label-7543
SELECT ALL + col2 DIV + 3 + + col2 AS col1, 23 + - - 58 FROM tab1 AS cor0 GROUP BY col2
----
10
81
60
81
94
81

skipif mysql # not compatible
query II rowsort label-7543
SELECT ALL + col2 / + 3 + + col2 AS col1, 23 + - - 58 FROM tab1 AS cor0 GROUP BY col2
----
10
81
60
81
94
81

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7544
SELECT DISTINCT + + 78, CAST( NULL AS SIGNED ) AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
78
NULL

skipif mysql # not compatible
query II rowsort label-7544
SELECT DISTINCT + + 78, CAST ( NULL AS INTEGER ) AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
78
NULL

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2 HAVING NULL NOT BETWEEN + NULLIF ( + + ( - - 73 ), col0 ) + - col2 AND - + 95 + + - 46
----

query I rowsort
SELECT - - 90 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
90
90
90

query I rowsort
SELECT + - col1 FROM tab2 cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT 95 FROM tab0 AS cor0 GROUP BY col1, col2
----
95
95
95

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-7550
SELECT - CAST( + - col0 AS SIGNED ) DIV 34 * + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
0
0
164

skipif mysql # not compatible
query I rowsort label-7550
SELECT - CAST ( + - col0 AS INTEGER ) / 34 * + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
0
0
164

query I rowsort
SELECT DISTINCT col2 + + - col0 FROM tab2 GROUP BY col0, col0, col2
----
-12
-34
72

query I rowsort
SELECT DISTINCT + 84 AS col1 FROM tab0 GROUP BY col0 HAVING - + col0 IS NOT NULL
----
84

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7553
SELECT + col1 FROM tab0 WHERE + + col1 IN ( - COALESCE ( 94, + 53, - CAST( + col1 AS SIGNED ) - 70 / + col2 + ( 40 ) ) ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7553
SELECT + col1 FROM tab0 WHERE + + col1 IN ( - COALESCE ( 94, + 53, - CAST ( + col1 AS INTEGER ) - 70 / + col2 + ( 40 ) ) ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT + - 20 + + 64 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING + col1 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7555
SELECT ALL COUNT( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7555
SELECT ALL COUNT ( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT + col1 * ( - + 0 ) FROM tab2 GROUP BY col1 HAVING NULL >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7557
SELECT ALL + COALESCE ( col2, + + COUNT( * ) ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-7557
SELECT ALL + COALESCE ( col2, + + COUNT ( * ) ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query II rowsort label-7559
SELECT - CAST( NULL AS SIGNED ) - + - 58 AS col1, - 43 + + + 39 + COUNT( * ) + - + 60 + col2 DIV col2 FROM tab1 AS cor0 GROUP BY col2
----
NULL
-62
NULL
-62
NULL
-62

skipif mysql # not compatible
query II rowsort label-7559
SELECT - CAST ( NULL AS INTEGER ) - + - 58 AS col1, - 43 + + + 39 + COUNT ( * ) + - + 60 + col2 / col2 FROM tab1 AS cor0 GROUP BY col2
----
NULL
-62
NULL
-62
NULL
-62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + 8 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT - 0 * + col2 * col2 * col2 AS col2 FROM tab2 GROUP BY col2
----
0

onlyif mysql # aggregate syntax: 
query II rowsort label-7563
SELECT DISTINCT col2 - COALESCE ( COUNT( * ), 15, - 41 ), + col2 + col2 - - - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
44
45
7
8
70
71

skipif mysql # not compatible
query II rowsort label-7563
SELECT DISTINCT col2 - COALESCE ( COUNT ( * ), 15, - 41 ), + col2 + col2 - - - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
44
45
7
8
70
71

query I rowsort
SELECT 6 AS col1 FROM tab1 GROUP BY col2
----
6
6
6

query I rowsort
SELECT + 2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
2
2
2

query I rowsort
SELECT 24 FROM tab0 GROUP BY col1
----
24
24

query II rowsort
SELECT + - col1, 50 * - col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1, col1
----
-41
-2050
-59
-2950
-61
-3050

onlyif mysql # aggregate syntax: 
query I rowsort label-7568
SELECT DISTINCT - ( - - 21 ) + - - MAX( ALL + 7 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN MAX( - 91 ) AND - COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-7568
SELECT DISTINCT - ( - - 21 ) + - - MAX ( ALL + 7 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN MAX ( - 91 ) AND - COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7569
SELECT - col0 - - 12 * - 69 AS col0, - COUNT( * ) FROM tab2 AS cor0 GROUP BY col0, col2
----
-843
-1
-919
-1
-920
-1

skipif mysql # not compatible
query II rowsort label-7569
SELECT - col0 - - 12 * - 69 AS col0, - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0, col2
----
-843
-1
-919
-1
-920
-1

query I rowsort
SELECT CASE + col1 WHEN 15 THEN NULL ELSE - - col1 * - + col1 END + col1 + + - col2 + - + col2 FROM tab2 GROUP BY col1, col2
----
-1756
-3580
-3834

query I rowsort
SELECT DISTINCT col0 * + ( + + col2 ) FROM tab2 GROUP BY col0, col2 HAVING NOT + - 58 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7572
SELECT + COUNT( * ) FROM tab0 WHERE + col2 IS NULL GROUP BY col1, col2
----

skipif mysql # not compatible
query I rowsort label-7572
SELECT + COUNT ( * ) FROM tab0 WHERE + col2 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT + - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 + - - col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

onlyif mysql # aggregate syntax: 
query I rowsort label-7575
SELECT DISTINCT + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 BETWEEN + 82 AND NULL
----
1

skipif mysql # not compatible
query I rowsort label-7575
SELECT DISTINCT + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 BETWEEN + 82 AND NULL
----
1

query I rowsort
SELECT ( - - 34 ) * col0 + col0 + + col0 * 15 AS col2 FROM tab0 WHERE NOT col0 IS NULL GROUP BY col0
----
1300
2150
4150

query I rowsort
SELECT ALL - 18 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-18
-18
-18

onlyif mysql # aggregate syntax: 
query I rowsort label-7578
SELECT - ( col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <= - - MIN( + + 71 )
----

skipif mysql # not compatible
query I rowsort label-7578
SELECT - ( col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <= - - MIN ( + + 71 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7579
SELECT DISTINCT + + col0 + col0 + - 68 + - COUNT( * ) / - + col0 * col0 - + 45 AS col1 FROM tab0 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col0 HAVING + - 16 + - COUNT( * ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-7579
SELECT DISTINCT + + col0 + col0 + - 68 + - COUNT ( * ) / - + col0 * col0 - + 45 AS col1 FROM tab0 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col0 HAVING + - 16 + - COUNT ( * ) <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7580
SELECT DISTINCT - col0 * - - COUNT( * ) * + ( + COUNT( * ) ) - + + ( - col0 ) * - 9 * - col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7580
SELECT DISTINCT - col0 * - - COUNT ( * ) * + ( + COUNT ( * ) ) - + + ( - col0 ) * - 9 * - col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7581
SELECT DISTINCT + 9 - - COUNT( * ) FROM tab2 GROUP BY col2, col0
----
10

skipif mysql # not compatible
query I rowsort label-7581
SELECT DISTINCT + 9 - - COUNT ( * ) FROM tab2 GROUP BY col2, col0
----
10

query I rowsort
SELECT 72 * ( ( - col0 ) ) FROM tab1 GROUP BY col0 HAVING col0 IS NOT NULL
----
-1584
-2016
-5904

onlyif mysql # DIV for integer division: 
query I rowsort label-7583
SELECT ALL col0 * + - col2 + + + col2 DIV + + col2 FROM tab0 GROUP BY col0, col2
----
-1031
-2053
-3153

skipif mysql # not compatible
query I rowsort label-7583
SELECT ALL col0 * + - col2 + + + col2 / + + col2 FROM tab0 GROUP BY col0, col2
----
-1031
-2053
-3153

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7584
SELECT - - CAST( NULL AS SIGNED ) + - COUNT( * ) FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7584
SELECT - - CAST ( NULL AS INTEGER ) + - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7585
SELECT - + col0 * + COUNT( DISTINCT + col0 ) FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-7585
SELECT - + col0 * + COUNT ( DISTINCT + col0 ) FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - ( + col0 ) FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 - + - 49 AS col1 FROM tab0 GROUP BY col1
----
130
49

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

onlyif mysql # aggregate syntax: 
query I rowsort label-7589
SELECT - COUNT( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7589
SELECT - COUNT ( * ) AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1
-1
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-7590
SELECT - 34 FROM tab0 GROUP BY col1 HAVING NOT - - 18 / + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7590
SELECT - 34 FROM tab0 GROUP BY col1 HAVING NOT - - 18 / + COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT ALL - + col1 - 66 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-147
-66

onlyif mysql # aggregate syntax: 
query I rowsort label-7592
SELECT + SUM( ALL + col0 ) FROM tab2 cor0 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-7592
SELECT + SUM ( ALL + col0 ) FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + ( - + col2 ) * + 74 AS col2 FROM tab1 GROUP BY col2, col0
----
-3330
-5254
-592

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7594
SELECT ALL CAST( NULL AS SIGNED ) * - col0 * - - col0 * + - col0 * 28 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7594
SELECT ALL CAST ( NULL AS INTEGER ) * - col0 * - - col0 * + - col0 * 28 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query II rowsort label-7595
SELECT - col1 + ( - col1 ) * col1 DIV + col1, - col1 AS col0 FROM tab1 GROUP BY col1
----
-114
-57
-12
-6
-88
-44

skipif mysql # not compatible
query II rowsort label-7595
SELECT - col1 + ( - col1 ) * col1 / + col1, - col1 AS col0 FROM tab1 GROUP BY col1
----
-114
-57
-12
-6
-88
-44

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7596
SELECT - 7 + + col2 + - - 45 + col2 * - + col2 * - + ( - COUNT( * ) ) * 5 * + 84 * - 63 FROM tab2 GROUP BY col2, col1 HAVING - CAST( + col2 AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7596
SELECT - 7 + + col2 + - - 45 + col2 * - + col2 * - + ( - COUNT ( * ) ) * 5 * + 84 * - 63 FROM tab2 GROUP BY col2, col1 HAVING - CAST ( + col2 AS REAL ) IS NULL
----

query I rowsort
SELECT - 98 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-98
-98
-98

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7598
SELECT DISTINCT CAST( + 81 AS SIGNED ) FROM tab0 AS cor0 WHERE col2 / + - 56 IS NULL GROUP BY col1 HAVING NOT + 35 + - COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7598
SELECT DISTINCT CAST ( + 81 AS INTEGER ) FROM tab0 AS cor0 WHERE col2 / + - 56 IS NULL GROUP BY col1 HAVING NOT + 35 + - COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT - - col0 * + col2 + + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
1218
5278
7110

query I rowsort
SELECT DISTINCT col2 * col2 * - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7601
SELECT - col0 * + COUNT( * ) FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-7601
SELECT - col0 * + COUNT ( * ) FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-7602
SELECT - col0 + + 42 - NULLIF ( - col2, col0 + 74 + + - 63 + AVG ( 73 ) * + COUNT( * ) * + 20 * + COUNT( * ) ) * ( - + col2 ) + + - col2 * - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-751
132
741

skipif mysql # not compatible
query I rowsort label-7602
SELECT - col0 + + 42 - NULLIF ( - col2, col0 + 74 + + - 63 + AVG ( 73 ) * + COUNT ( * ) * + 20 * + COUNT ( * ) ) * ( - + col2 ) + + - col2 * - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-751
132
741

query I rowsort
SELECT - + ( ( 92 ) ) FROM tab0 AS cor0 GROUP BY col1, col1
----
-92
-92

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7604
SELECT ALL col0, - col2 col0 FROM tab0 AS cor0 GROUP BY col0, col2, col2 HAVING NOT ( CAST( NULL AS SIGNED ) ) IS NOT NULL
----
26
-79
43
-24
83
-38

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7604
SELECT ALL col0, - col2 col0 FROM tab0 AS cor0 GROUP BY col0, col2, col2 HAVING NOT ( CAST ( NULL AS INTEGER ) ) IS NOT NULL
----
26
-79
43
-24
83
-38

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7605
SELECT ALL - CAST( 17 AS DECIMAL ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING - CAST( + col1 AS SIGNED ) > NULL
----

skipif mysql # not compatible
query I rowsort label-7605
SELECT ALL - CAST ( 17 AS REAL ) AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING - CAST ( + col1 AS INTEGER ) > NULL
----

query I rowsort
SELECT ALL 99 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT + - 35 * + + 14 * col2 + - 6 IS NULL
----
180
99
99

onlyif mysql # aggregate syntax: 
query I rowsort label-7607
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING - SUM( + - col2 ) * + ( - 55 ) IS NOT NULL
----
44
57
6

skipif mysql # not compatible
query I rowsort label-7607
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING - SUM ( + - col2 ) * + ( - 55 ) IS NOT NULL
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-7608
SELECT ALL col1 - MAX( + col1 ) AS col2 FROM tab0 GROUP BY col1
----
0
0

skipif mysql # not compatible
query I rowsort label-7608
SELECT ALL col1 - MAX ( + col1 ) AS col2 FROM tab0 GROUP BY col1
----
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-7609
SELECT 1 DIV col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7609
SELECT 1 / col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT - 88 AS col2 FROM tab2 GROUP BY col0
----
-88
-88
-88

query II rowsort
SELECT - COALESCE ( - 70, - 14 ), col1 FROM tab2 cor0 GROUP BY col1
----
70
41
70
59
70
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 col2, 55 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
55
38
55
79
55

query II rowsort
SELECT - + 11 + AVG ( + - 41 ) - 45 AS col0, - 69 + + 44 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-97
-25
-97
-25
-97
-25

query I rowsort
SELECT ALL - 67 + col2 * + 20 FROM tab1 AS cor0 GROUP BY col2, col2
----
1353
833
93

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col0, col2, col2
----
-24
-38
-79

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col2, col0, col2 HAVING col2 IS NULL
----

query II rowsort
SELECT 92 * 20 AS col0, - 54 * - - col2 AS col0 FROM tab0 GROUP BY col2, col0
----
1840
-1296
1840
-2052
1840
-4266

query I rowsort
SELECT + col1 * - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT 42 - - ( - - 91 ) * col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
153013
316813
338653

query I rowsort
SELECT + col0 + 83 AS col2 FROM tab0 GROUP BY col2, col1, col0
----
109
126
166

query I rowsort
SELECT + 84 + + col1 + + 97 * + 3 FROM tab2 GROUP BY col1, col0
----
416
434
436

query I rowsort
SELECT + - 65 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7623
SELECT + col0 DIV - 16 DIV COUNT( + col0 ) - COUNT( * ) + + 12 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
10
6
9

skipif mysql # not compatible
query I rowsort label-7623
SELECT + col0 / - 16 / COUNT ( + col0 ) - COUNT ( * ) + + 12 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
10
6
9

query I rowsort
SELECT - 25 FROM tab2 AS cor0 GROUP BY col0, col2
----
-25
-25
-25

query I rowsort
SELECT 22 FROM tab0 GROUP BY col0, col1, col1 HAVING NOT + ( col1 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT ( * ) IS NOT NULL
----

query II rowsort
SELECT col2 AS col2, + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
45
71
71
8
8

onlyif mysql # aggregate syntax: 
query I rowsort label-7628
SELECT - COUNT( ALL - col1 ) + + COUNT( * ) + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif mysql # not compatible
query I rowsort label-7628
SELECT - COUNT ( ALL - col1 ) + + COUNT ( * ) + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 74 + 19 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= + - ( - + col2 )
----

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( + + col0 ) IS NOT NULL
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-7631
SELECT ALL COUNT( * ) + - col1 * - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-6560
2

skipif mysql # not compatible
query I rowsort label-7631
SELECT ALL COUNT ( * ) + - col1 * - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-6560
2

query I rowsort
SELECT DISTINCT ( col0 ) AS col2 FROM tab1 GROUP BY col2, col1, col0
----
22
28
82

query II rowsort
SELECT - 0, - col1 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + CASE - 95 WHEN - 98 * + - 58 - + 19 THEN - col1 ELSE NULL END AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 36 IS NOT NULL
----

query I rowsort
SELECT + col1 * + + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT ALL + - 15 + + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-39
-53
-94

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 49 col2 FROM tab2 WHERE ( NULL ) = NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 - - col0 AS col2 FROM tab0 WHERE col2 * + col2 < NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7639
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0 HAVING NOT - CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7639
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0 HAVING NOT - CAST ( NULL AS INTEGER ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7640
SELECT - COUNT( * ) + - COUNT( col2 ) * - 40 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
39
39
39

skipif mysql # not compatible
query I rowsort label-7640
SELECT - COUNT ( * ) + - COUNT ( col2 ) * - 40 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
39
39
39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7641
SELECT ALL col2 + col0 * + col0 FROM tab1 GROUP BY col0, col2, col0 HAVING ( 21 ) / col0 + - CAST( NULL AS SIGNED ) IN ( + 41 )
----

skipif mysql # not compatible
query I rowsort label-7641
SELECT ALL col2 + col0 * + col0 FROM tab1 GROUP BY col0, col2, col0 HAVING ( 21 ) / col0 + - CAST ( NULL AS INTEGER ) IN ( + 41 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7642
SELECT - 39 AS col1 FROM tab1 WHERE - col2 NOT BETWEEN ( CAST( NULL AS SIGNED ) ) AND + col2 * + col1 + 3 * col1 GROUP BY col0 HAVING + 80 + - 52 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7642
SELECT - 39 AS col1 FROM tab1 WHERE - col2 NOT BETWEEN ( CAST ( NULL AS INTEGER ) ) AND + col2 * + col1 + 3 * col1 GROUP BY col0 HAVING + 80 + - 52 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 55 * - 36 col1 FROM tab1 GROUP BY col1, col1 HAVING ( - col1 ) NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 12 col1 FROM tab0 GROUP BY col0
----
12
12
12

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7646
SELECT ALL col1 FROM tab2 WHERE NOT ( + col1 ) > 39 * + 69 + - col2 / col1 GROUP BY col1 HAVING ( - NULLIF ( col1, CAST( NULL AS SIGNED ) / + COUNT( * ) + - CAST( NULL AS SIGNED ) ) ) <> ( + col1 )
----
41
59
61

skipif mysql # not compatible
query I rowsort label-7646
SELECT ALL col1 FROM tab2 WHERE NOT ( + col1 ) > 39 * + 69 + - col2 / col1 GROUP BY col1 HAVING ( - NULLIF ( col1, CAST ( NULL AS INTEGER ) / + COUNT ( * ) + - CAST ( NULL AS INTEGER ) ) ) <> ( + col1 )
----
41
59
61

query I rowsort
SELECT ALL col1 * + 56 AS col1 FROM tab0 GROUP BY col1
----
0
4536

onlyif mysql # aggregate syntax: 
query I rowsort label-7648
SELECT - SUM( col2 ) FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-7648
SELECT - SUM ( col2 ) FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

onlyif mysql # aggregate syntax: 
query I rowsort label-7649
SELECT 4 + + COUNT( * ) FROM tab0 GROUP BY col0, col2
----
5
5
5

skipif mysql # not compatible
query I rowsort label-7649
SELECT 4 + + COUNT ( * ) FROM tab0 GROUP BY col0, col2
----
5
5
5

query I rowsort
SELECT 43 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
43
43
43

query I rowsort
SELECT DISTINCT - 46 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-46

onlyif mysql # aggregate syntax: 
query I rowsort label-7652
SELECT DISTINCT - COUNT( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-7652
SELECT DISTINCT - COUNT ( * ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-7653
SELECT COUNT( * ) * + SUM( ALL - col2 ) FROM tab0 GROUP BY col2 HAVING NULL IN ( 31 )
----

skipif mysql # not compatible
query I rowsort label-7653
SELECT COUNT ( * ) * + SUM ( ALL - col2 ) FROM tab0 GROUP BY col2 HAVING NULL IN ( 31 )
----

query I rowsort
SELECT + 78 + col1 FROM tab0 cor0 GROUP BY col0, col1, col0
----
159
78
78

onlyif mysql # aggregate syntax: 
query I rowsort label-7655
SELECT - col2 * COUNT( * ) FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-7655
SELECT - col2 * COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
-24
-38
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-7656
SELECT ALL + 28 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + CASE col0 WHEN 53 THEN NULL ELSE col1 END / + 9 NOT BETWEEN + NULLIF ( + col1, + col0 + COUNT( * ) * col0 ) + + col0 AND ( + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-7656
SELECT ALL + 28 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + CASE col0 WHEN 53 THEN NULL ELSE col1 END / + 9 NOT BETWEEN + NULLIF ( + col1, + col0 + COUNT ( * ) * col0 ) + + col0 AND ( + COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7657
SELECT ALL + - col1 + SUM( ALL col1 ) FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7657
SELECT ALL + - col1 + SUM ( ALL col1 ) FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-7658
SELECT + + MAX( ALL 0 ) FROM tab1 AS cor0 GROUP BY col2, col2 HAVING 67 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7658
SELECT + + MAX ( ALL 0 ) FROM tab1 AS cor0 GROUP BY col2, col2 HAVING 67 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

onlyif mysql # aggregate syntax: 
query I rowsort label-7660
SELECT + col0 * 2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING + MAX( + col0 ) IS NOT NULL
----
166
52
86

skipif mysql # not compatible
query I rowsort label-7660
SELECT + col0 * 2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING + MAX ( + col0 ) IS NOT NULL
----
166
52
86

query I rowsort
SELECT 28 FROM tab2 WHERE - col2 <> NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7662
SELECT ALL + col2 * 93 + COUNT( * ) * col0 FROM tab2 GROUP BY col2, col1, col0 HAVING col2 * col2 + SUM( DISTINCT 28 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7662
SELECT ALL + col2 * 93 + COUNT ( * ) * col0 FROM tab2 GROUP BY col2, col1, col0 HAVING col2 * col2 + SUM ( DISTINCT 28 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 50 col1 FROM tab0 GROUP BY col2
----
50

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7664
SELECT col0 * CAST( + 82 AS SIGNED ) FROM tab1 GROUP BY col0 HAVING + col0 > NULL
----

skipif mysql # not compatible
query I rowsort label-7664
SELECT col0 * CAST ( + 82 AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + col0 > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7665
SELECT ( - ( 88 ) ) * ( - COUNT( * ) ) FROM tab1 GROUP BY col0
----
88
88
88

skipif mysql # not compatible
query I rowsort label-7665
SELECT ( - ( 88 ) ) * ( - COUNT ( * ) ) FROM tab1 GROUP BY col0
----
88
88
88

query I rowsort
SELECT ALL - 59 * + 13 FROM tab0 GROUP BY col0, col2
----
-767
-767
-767

onlyif mysql # aggregate syntax: 
query I rowsort label-7667
SELECT col0 + + 51 / COUNT( * ) FROM tab0 GROUP BY col0 HAVING 23 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7667
SELECT col0 + + 51 / COUNT ( * ) FROM tab0 GROUP BY col0 HAVING 23 IS NULL
----

query I rowsort
SELECT DISTINCT + 4 FROM tab0 GROUP BY col0, col2
----
4

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7669
SELECT DISTINCT col0 + - NULLIF ( col2, - 42 * + CAST( + col2 AS DECIMAL ) ) AS col0 FROM tab2 GROUP BY col0, col2
----
-72
12
34

skipif mysql # not compatible
query I rowsort label-7669
SELECT DISTINCT col0 + - NULLIF ( col2, - 42 * + CAST ( + col2 AS REAL ) ) AS col0 FROM tab2 GROUP BY col0, col2
----
-72
12
34

onlyif mysql # aggregate syntax: 
query I rowsort label-7670
SELECT COUNT( * ) FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7670
SELECT COUNT ( * ) FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT + 99 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL BETWEEN 7 AND NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

onlyif mysql # aggregate syntax: 
query I rowsort label-7673
SELECT - COUNT( DISTINCT - col1 ) / - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7673
SELECT - COUNT ( DISTINCT - col1 ) / - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 * 48 + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1222
-2021
-3901

query I rowsort
SELECT + - ( col0 ) * col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT 29 * + col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + + col1 col0 FROM tab2 GROUP BY col1
----
1681
3481
3721

onlyif mysql # aggregate syntax: 
query I rowsort label-7678
SELECT ALL - 53 - - 56 FROM tab0 WHERE NOT - col2 > NULL GROUP BY col2 HAVING NOT - COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7678
SELECT ALL - 53 - - 56 FROM tab0 WHERE NOT - col2 > NULL GROUP BY col2 HAVING NOT - COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7679
SELECT col1 + - COUNT( * ) AS col2 FROM tab1 GROUP BY col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-7679
SELECT col1 + - COUNT ( * ) AS col2 FROM tab1 GROUP BY col1
----
43
5
56

query I rowsort
SELECT ALL 39 * + 20 + - col1 + - col1 * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1200
-2526
738

query I rowsort
SELECT - 57 FROM tab2 cor0 WHERE NOT NULL <> ( - col1 ) GROUP BY col0 HAVING col0 * + 25 IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 WHERE NULL BETWEEN ( NULL ) AND NULL GROUP BY col1, col2 HAVING NOT col2 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7683
SELECT DISTINCT + + COUNT( * ) * col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7683
SELECT DISTINCT + + COUNT ( * ) * col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7684
SELECT DISTINCT CAST( NULL AS SIGNED ) + - 75 + - CAST( NULL AS SIGNED ) * 27 * col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7684
SELECT DISTINCT CAST ( NULL AS INTEGER ) + - 75 + - CAST ( NULL AS INTEGER ) * 27 * col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - + col2 ) FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT 45 * + + col1 + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= - 98 + - 30 * 48
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 + - + col1 col0, col1 - - col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
-118
3540
-122
3782
-82
1722

query I rowsort
SELECT 87 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - ( 83 ) BETWEEN NULL AND + 57
----

query I rowsort
SELECT DISTINCT 18 * + + 75 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT col1 > col1
----
1350

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = ( - + NULLIF ( + col0, + 90 / 74 ) + - col0 )
----

query I rowsort
SELECT ALL col1 + - AVG ( col0 ) + - - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT + 13 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7693
SELECT col1 * COALESCE ( - - CAST( NULL AS SIGNED ), 85 ) AS col0 FROM tab2 GROUP BY col1
----
3485
5015
5185

skipif mysql # not compatible
query I rowsort label-7693
SELECT col1 * COALESCE ( - - CAST ( NULL AS INTEGER ), 85 ) AS col0 FROM tab2 GROUP BY col1
----
3485
5015
5185

onlyif mysql # aggregate syntax: 
query I rowsort label-7694
SELECT ALL col2 - 54 FROM tab0 GROUP BY col1, col2 HAVING NOT ( - COUNT( * ) + - col1 ) BETWEEN - ( 42 ) * col2 - 79 AND NULL
----

skipif mysql # not compatible
query I rowsort label-7694
SELECT ALL col2 - 54 FROM tab0 GROUP BY col1, col2 HAVING NOT ( - COUNT ( * ) + - col1 ) BETWEEN - ( 42 ) * col2 - 79 AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7696
SELECT ALL + MAX( - col2 ) + + - COUNT( * ) + col1 + + col1 * NULLIF ( + 54 + - CAST( NULL AS SIGNED ), + 96 ) * col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT ( col1 / + COUNT( * ) ) NOT IN ( - col1 / col1 - - 22 )
----

skipif mysql # not compatible
query I rowsort label-7696
SELECT ALL + MAX ( - col2 ) + + - COUNT ( * ) + col1 + + col1 * NULLIF ( + 54 + - CAST ( NULL AS INTEGER ), + 96 ) * col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT ( col1 / + COUNT ( * ) ) NOT IN ( - col1 / col1 - - 22 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7697
SELECT ALL - col2 * - - 88 * + col2 * ( col2 ) AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT + CAST( NULL AS SIGNED ) / 92 NOT IN ( COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-7697
SELECT ALL - col2 * - - 88 * + col2 * ( col2 ) AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT + CAST ( NULL AS INTEGER ) / 92 NOT IN ( COUNT ( * ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 37 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-37

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * - ( + 47 ) * col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
158108
293327
355743

query I rowsort
SELECT - 52 * - - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING + col0 + col0 NOT IN ( + ( 38 ) - - col2 / col0 )
----
-3016
-4108
-4524

query I rowsort
SELECT + - col2 / - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING 83 BETWEEN ( NULL ) AND + col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7702
SELECT MAX( + 40 ) - + col1 FROM tab1 GROUP BY col1, col2
----
-17
-4
34

skipif mysql # not compatible
query I rowsort label-7702
SELECT MAX ( + 40 ) - + col1 FROM tab1 GROUP BY col1, col2
----
-17
-4
34

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7703
SELECT DISTINCT COUNT( * ), + AVG ( NULLIF ( + + col2, 55 ) ) * - - 50 * - 22 + - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col1 HAVING + col2 * + 42 IS NULL
----

skipif mysql # not compatible
query II rowsort label-7703
SELECT DISTINCT COUNT ( * ), + AVG ( NULLIF ( + + col2, 55 ) ) * - - 50 * - 22 + - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1 HAVING + col2 * + 42 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7704
SELECT MIN( 90 ) * + + 4 FROM tab0 GROUP BY col1, col2 HAVING NOT + 12 IS NULL
----
360
360
360

skipif mysql # not compatible
query I rowsort label-7704
SELECT MIN ( 90 ) * + + 4 FROM tab0 GROUP BY col1, col2 HAVING NOT + 12 IS NULL
----
360
360
360

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7706
SELECT CAST( NULL AS DECIMAL ) + + col1 FROM tab1 AS cor0 WHERE NOT ( NOT ( NULL IS NULL ) ) GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7706
SELECT CAST ( NULL AS REAL ) + + col1 FROM tab1 AS cor0 WHERE NOT ( NOT ( NULL IS NULL ) ) GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7707
SELECT ALL - col0 * - col0 * + 52 + - col0 * + - col0 * - col0 + ( + MAX( 53 ) ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IN ( + 24 * 50 )
----

skipif mysql # not compatible
query I rowsort label-7707
SELECT ALL - col0 * - col0 * + 52 + - col0 * + - col0 * - col0 + ( + MAX ( 53 ) ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IN ( + 24 * 50 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7708
SELECT DISTINCT - col0 - MIN( ALL - CAST( NULLIF ( ( col0 ), - col0 * - 5 ) AS SIGNED ) ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-7708
SELECT DISTINCT - col0 - MIN ( ALL - CAST ( NULLIF ( ( col0 ), - col0 * - 5 ) AS INTEGER ) ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT - + col1 + 20 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-21
-39
-41

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7710
SELECT ALL CAST( 8 AS SIGNED ) + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7710
SELECT ALL CAST ( 8 AS INTEGER ) + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7711
SELECT - 91 FROM tab1 cor0 GROUP BY col1 HAVING NOT - ( COUNT( * ) ) <> - - col1
----

skipif mysql # not compatible
query I rowsort label-7711
SELECT - 91 FROM tab1 cor0 GROUP BY col1 HAVING NOT - ( COUNT ( * ) ) <> - - col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7712
SELECT col0 * + col0 FROM tab2 GROUP BY col0 HAVING NOT - + CAST( NULL AS SIGNED ) IS NOT NULL
----
225
8281
8464

skipif mysql # not compatible
query I rowsort label-7712
SELECT col0 * + col0 FROM tab2 GROUP BY col0 HAVING NOT - + CAST ( NULL AS INTEGER ) IS NOT NULL
----
225
8281
8464

query I rowsort
SELECT DISTINCT - col0 FROM tab2 WHERE + col1 IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7715
SELECT ALL 66 * + CAST( - ( col0 ) AS SIGNED ) col0 FROM tab2 GROUP BY col0
----
-6006
-6072
-990

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7715
SELECT ALL 66 * + CAST ( - ( col0 ) AS INTEGER ) col0 FROM tab2 GROUP BY col0
----
-6006
-6072
-990

query I rowsort
SELECT 65 FROM tab0 AS cor0 GROUP BY col0
----
65
65
65

onlyif mysql # aggregate syntax: 
query I rowsort label-7717
SELECT ALL - COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7717
SELECT ALL - COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT 98 AS col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7720
SELECT + 87 + - col1 FROM tab1 GROUP BY col1, col0, col0, col1 HAVING NOT + 67 + COUNT( * ) <= col1
----
30
43
81

skipif mysql # not compatible
query I rowsort label-7720
SELECT + 87 + - col1 FROM tab1 GROUP BY col1, col0, col0, col1 HAVING NOT + 67 + COUNT ( * ) <= col1
----
30
43
81

onlyif mysql # aggregate syntax: 
query I rowsort label-7721
SELECT - - col1 * - + COUNT( * ) + - COUNT( * ) FROM tab0 AS cor0 GROUP BY col0, col1
----
-1
-1
-82

skipif mysql # not compatible
query I rowsort label-7721
SELECT - - col1 * - + COUNT ( * ) + - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0, col1
----
-1
-1
-82

query I rowsort
SELECT DISTINCT - col2 / + col2 * - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <> ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7723
SELECT CAST( + ( - ( - col1 ) ) AS SIGNED ) FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col2, col1, col0 HAVING ( NOT ( - col2 / col2 ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-7723
SELECT CAST ( + ( - ( - col1 ) ) AS INTEGER ) FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col2, col1, col0 HAVING ( NOT ( - col2 / col2 ) IS NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7724
SELECT + COUNT( * ) AS col1 FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7724
SELECT + COUNT ( * ) AS col1 FROM tab2 GROUP BY col0
----
1
1
1

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7725
SELECT DISTINCT - col1 * - - CAST( NULL AS DECIMAL ) FROM tab0 GROUP BY col1, col0 HAVING + NULLIF ( - - COUNT( * ), 88 + - SUM( - + NULLIF ( col1, + col1 ) ) * COUNT( * ) ) + 11 IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-7725
SELECT DISTINCT - col1 * - - CAST ( NULL AS REAL ) FROM tab0 GROUP BY col1, col0 HAVING + NULLIF ( - - COUNT ( * ), 88 + - SUM ( - + NULLIF ( col1, + col1 ) ) * COUNT ( * ) ) + 11 IS NOT NULL
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7726
SELECT 95 * CAST( 63 AS SIGNED ) FROM tab0 WHERE NULL < + 46 + - - 11 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-7726
SELECT 95 * CAST ( 63 AS INTEGER ) FROM tab0 WHERE NULL < + 46 + - - 11 GROUP BY col2
----

query I rowsort
SELECT DISTINCT - 65 FROM tab0 GROUP BY col2, col0 HAVING + col0 < + 42
----
-65

query I rowsort
SELECT DISTINCT + 95 FROM tab2 GROUP BY col2, col0 HAVING NOT ( + ( + + ( col0 ) ) ) < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7729
SELECT MIN( DISTINCT + - NULLIF ( col1, 54 ) ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= - col1
----

skipif mysql # not compatible
query I rowsort label-7729
SELECT MIN ( DISTINCT + - NULLIF ( col1, 54 ) ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= - col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7730
SELECT - SUM( ALL - + col1 ) + + 48 * - COUNT( * ) + + COUNT( * ) FROM tab2 WHERE NOT ( NULL ) BETWEEN NULL AND NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7730
SELECT - SUM ( ALL - + col1 ) + + 48 * - COUNT ( * ) + + COUNT ( * ) FROM tab2 WHERE NOT ( NULL ) BETWEEN NULL AND NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7731
SELECT DISTINCT - col1, CASE COUNT( * ) WHEN + ( - - col1 ) THEN NULL ELSE - + 82 * - - col1 END * col1 + - 45 * col1 FROM tab0 cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col0, col1
----

skipif mysql # not compatible
query II rowsort label-7731
SELECT DISTINCT - col1, CASE COUNT ( * ) WHEN + ( - - col1 ) THEN NULL ELSE - + 82 * - - col1 END * col1 + - 45 * col1 FROM tab0 cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7732
SELECT ALL - col2, + CASE col2 WHEN + NULLIF ( 40, 63 ) * - 19 + col1 THEN 81 * + NULLIF ( + ( col2 ), 48 ) END FROM tab0 AS cor0 WHERE NOT ( col0 ) <> + CAST( - ( col1 ) AS SIGNED ) + - col2 GROUP BY col1, col2 HAVING 21 NOT IN ( - CAST( COUNT( col0 ) AS SIGNED ) )
----

skipif mysql # not compatible
query II rowsort label-7732
SELECT ALL - col2, + CASE col2 WHEN + NULLIF ( 40, 63 ) * - 19 + col1 THEN 81 * + NULLIF ( + ( col2 ), 48 ) END FROM tab0 AS cor0 WHERE NOT ( col0 ) <> + CAST ( - ( col1 ) AS INTEGER ) + - col2 GROUP BY col1, col2 HAVING 21 NOT IN ( - CAST ( COUNT ( col0 ) AS INTEGER ) )
----

query I rowsort
SELECT DISTINCT + 15 FROM tab2 GROUP BY col1, col0
----
15

onlyif mysql # aggregate syntax: 
query I rowsort label-7734
SELECT DISTINCT + + 7 + SUM( + col2 ) + + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
165
55
83

skipif mysql # not compatible
query I rowsort label-7734
SELECT DISTINCT + + 7 + SUM ( + col2 ) + + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
165
55
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7735
SELECT DISTINCT + CAST( NULL AS SIGNED ) + + col2 + - + col2 + col2 / - 48 * - - ( - col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7735
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + + col2 + - + col2 + col2 / - 48 * - - ( - col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7736
SELECT DISTINCT ( + - SUM( DISTINCT - + 34 ) ) * + col0 / - + col1 * + COUNT( - 53 ) + - COUNT( ( - col1 ) + col1 ) FROM tab1 AS cor0 WHERE NOT - col2 + + - 16 + + col2 + - col0 >= col0 GROUP BY col0, col1 HAVING NOT + 56 - - SUM( + col2 ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-7736
SELECT DISTINCT ( + - SUM ( DISTINCT - + 34 ) ) * + col0 / - + col1 * + COUNT ( - 53 ) + - COUNT ( ( - col1 ) + col1 ) FROM tab1 AS cor0 WHERE NOT - col2 + + - 16 + + col2 + - col0 >= col0 GROUP BY col0, col1 HAVING NOT + 56 - - SUM ( + col2 ) <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col2, - 18 * + + col0 - - 77 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
-193
-91
-1561
-92
-1579

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

onlyif mysql # aggregate syntax: 
query I rowsort label-7739
SELECT ALL - COUNT( * ) FROM tab0 WHERE NOT - + col1 > + col1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-2

skipif mysql # not compatible
query I rowsort label-7739
SELECT ALL - COUNT ( * ) FROM tab0 WHERE NOT - + col1 > + col1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-2

query I rowsort
SELECT - 83 + ( + 8 ) FROM tab1 GROUP BY col1, col1
----
-75
-75
-75

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7741
SELECT + CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7741
SELECT + CAST ( NULL AS REAL ) FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7742
SELECT + SUM( - col2 ) + - col2 + - 38 - 16 FROM tab0 GROUP BY col2 HAVING NOT + col2 * + CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7742
SELECT + SUM ( - col2 ) + - col2 + - 38 - 16 FROM tab0 GROUP BY col2 HAVING NOT + col2 * + CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT ALL 48 FROM tab2 AS cor0 GROUP BY col1, col2
----
48
48
48

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7745
SELECT DISTINCT + + MAX( ALL - + 26 ) + COUNT( + ( - col0 ) ) DIV COUNT( ALL + 66 ) DIV - - 48 - - + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
17
57

skipif mysql # not compatible
query I rowsort label-7745
SELECT DISTINCT + + MAX ( ALL - + 26 ) + COUNT ( + ( - col0 ) ) / COUNT ( ALL + 66 ) / - - 48 - - + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
17
57

query I rowsort
SELECT - ( - col0 ) + - + 95 * 42 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL = 6 + col0 - - + col0
----

query I rowsort
SELECT + + col1 - + + col1 - - + col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING 12 < + - col1
----

query II rowsort
SELECT - col0, col0 AS col2 FROM tab0 GROUP BY col2, col0 HAVING ( NULL ) <= NULL
----

query I rowsort
SELECT col0 - + - col2 AS col0 FROM tab2 GROUP BY col2, col0
----
102
150
170

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-7751
SELECT ALL COUNT( * ) * col0 + - + ( + col2 ) DIV ( + 88 ), + ( + - col0 ) + - col2 AS col1 FROM tab0 GROUP BY col2, col1, col0 HAVING ( ( SUM( - + 3 ) - - 62 ) IS NOT NULL )
----
26
-105
43
-67
83
-121

skipif mysql # not compatible
query II rowsort label-7751
SELECT ALL COUNT ( * ) * col0 + - + ( + col2 ) / ( + 88 ), + ( + - col0 ) + - col2 AS col1 FROM tab0 GROUP BY col2, col1, col0 HAVING ( ( SUM ( - + 3 ) - - 62 ) IS NOT NULL )
----
26
-105
43
-67
83
-121

query I rowsort
SELECT 48 * - col0 AS col2 FROM tab1 GROUP BY col0
----
-1056
-1344
-3936

query I rowsort
SELECT ALL - col2 + + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7754
SELECT DISTINCT 18 * - - 60 AS col2 FROM tab2 GROUP BY col0, col2 HAVING MIN( - + col2 ) + 57 IS NOT NULL
----
1080

skipif mysql # not compatible
query I rowsort label-7754
SELECT DISTINCT 18 * - - 60 AS col2 FROM tab2 GROUP BY col0, col2 HAVING MIN ( - + col2 ) + 57 IS NOT NULL
----
1080

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-7755
SELECT - 15 + COUNT( * ), col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING - col1 BETWEEN NULL AND ( - CAST( col2 AS SIGNED ) )
----

skipif mysql # not compatible
query II rowsort label-7755
SELECT - 15 + COUNT ( * ), col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING - col1 BETWEEN NULL AND ( - CAST ( col2 AS INTEGER ) )
----

query I rowsort
SELECT + - col2 + + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + ( + ( - - 63 ) ) - + - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT + 63 + col0 <= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7758
SELECT - col1 * - SUM( ALL + ( + + col1 ) ) AS col2 FROM tab2 AS cor0 WHERE NULL BETWEEN ( NULL ) AND NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7758
SELECT - col1 * - SUM ( ALL + ( + + col1 ) ) AS col2 FROM tab2 AS cor0 WHERE NULL BETWEEN ( NULL ) AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 + + 79 * AVG ( + col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + 70 + + - 19 IS NOT NULL
----

query I rowsort
SELECT ALL + - 49 + - col0 / col2 FROM tab0 WHERE NOT NULL < NULL GROUP BY col0, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7761
SELECT - col1 - - SUM( DISTINCT - 33 ) - - col1 * + 62 * + col2 FROM tab1 GROUP BY col1, col2
----
158940
193611
2937

skipif mysql # not compatible
query I rowsort label-7761
SELECT - col1 - - SUM ( DISTINCT - 33 ) - - col1 * + 62 * + col2 FROM tab1 GROUP BY col1, col2
----
158940
193611
2937

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7762
SELECT - - col2 AS col0 FROM tab2 WHERE NOT ( col2 < NULL ) GROUP BY col0, col2 HAVING - CAST( NULL AS SIGNED ) * - col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7762
SELECT - - col2 AS col0 FROM tab2 WHERE NOT ( col2 < NULL ) GROUP BY col0, col2 HAVING - CAST ( NULL AS INTEGER ) * - col2 IS NOT NULL
----

query I rowsort
SELECT ALL - 86 FROM tab1 cor0 GROUP BY col2
----
-86
-86
-86

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NULL <= col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7765
SELECT - - COALESCE ( + col2, - COUNT( * ), col2 ) + COUNT( * ) + - - 35 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
36
36
36

skipif mysql # not compatible
query I rowsort label-7765
SELECT - - COALESCE ( + col2, - COUNT ( * ), col2 ) + COUNT ( * ) + - - 35 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
36
36
36

query I rowsort
SELECT - + 57 FROM tab0 AS cor0 WHERE NOT + 50 IS NOT NULL GROUP BY col0, col0, col2 HAVING NOT + 49 > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7767
SELECT + SUM( + - col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7767
SELECT + SUM ( + - col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7768
SELECT ALL + col0 * + 22 - - + 1 + + - SUM( DISTINCT + col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7768
SELECT ALL + col0 * + 22 - - + 1 + + - SUM ( DISTINCT + col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7769
SELECT DISTINCT + + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 WHERE ( - col1 IS NULL ) GROUP BY col0, col1 HAVING NOT col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7769
SELECT DISTINCT + + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 WHERE ( - col1 IS NULL ) GROUP BY col0, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT - col1 * + - col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 * - + 94 col2 FROM tab0 WHERE NOT + 95 - + col1 >= - - col1 * - col2 GROUP BY col1, col0
----

query I rowsort
SELECT ALL 78 / col1 FROM tab2 GROUP BY col2, col1, col1 HAVING NOT ( NULL IS NULL )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT( * ) * - ( - + CAST( NULL AS SIGNED ) ) * + col2 + + CAST( NULL AS SIGNED ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT ( * ) * - ( - + CAST ( NULL AS INTEGER ) ) * + col2 + + CAST ( NULL AS INTEGER ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

onlyif mysql # DIV for integer division: 
query II rowsort label-7774
SELECT DISTINCT - col2 AS col2, + col1 DIV - 31 FROM tab1 GROUP BY col1, col2
----
-45
-1
-71
-1
-8
0

skipif mysql # not compatible
query II rowsort label-7774
SELECT DISTINCT - col2 AS col2, + col1 / - 31 FROM tab1 GROUP BY col1, col2
----
-45
-1
-71
-1
-8
0

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col1, col2, col2, col0
----
-58
-79
-87

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7776
SELECT COUNT( * ) / - - col0 * CAST( NULL AS SIGNED ) * - + col2 * - + col2 * - - 69 + - + 53 - + + col0 + - 95 * - col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7776
SELECT COUNT ( * ) / - - col0 * CAST ( NULL AS INTEGER ) * - + col2 * - + col2 * - - 69 + - + 53 - + + col0 + - 95 * - col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE + + ( + col0 ) IS NULL GROUP BY col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7778
SELECT + 84 * - MIN( ALL + ( col1 ) ) + + + COUNT( - col0 ) + - COUNT( * ) + - + 73 / col1 + + + col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + - col0 * col0 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7778
SELECT + 84 * - MIN ( ALL + ( col1 ) ) + + + COUNT ( - col0 ) + - COUNT ( * ) + - + 73 / col1 + + + col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + - col0 * col0 = NULL
----

query II rowsort
SELECT - col2, col2 AS col1 FROM tab1 GROUP BY col2, col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 * + - 81 IS NULL
----

query I rowsort
SELECT 16 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
16
16
16

query II rowsort
SELECT - - col0, col0 * + col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7783
SELECT - NULLIF ( - COUNT( * ), - + 17 ) * + 46 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT COUNT( * ) = ( + ( col1 ) * CAST( NULL AS SIGNED ) - + 56 ) OR NOT - col1 + - - NULLIF ( - COUNT( * ), col0 ) IN ( + - col0 + + col0 )
----
46
46
46

skipif mysql # not compatible
query I rowsort label-7783
SELECT - NULLIF ( - COUNT ( * ), - + 17 ) * + 46 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT COUNT ( * ) = ( + ( col1 ) * CAST ( NULL AS INTEGER ) - + 56 ) OR NOT - col1 + - - NULLIF ( - COUNT ( * ), col0 ) IN ( + - col0 + + col0 )
----
46
46
46

query II rowsort
SELECT DISTINCT + - col2 * - ( col2 ) * - + ( - - col2 ) + - - col2 AS col1, - 29 FROM tab0 AS cor0 GROUP BY col2, col2
----
-13800
-29
-492960
-29
-54834
-29

onlyif mysql # aggregate syntax: 
query II rowsort label-7785
SELECT DISTINCT MIN( DISTINCT - + 41 ) + - + col2, col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-120
79
-128
87
-99
58

skipif mysql # not compatible
query II rowsort label-7785
SELECT DISTINCT MIN ( DISTINCT - + 41 ) + - + col2, col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-120
79
-128
87
-99
58

onlyif mysql # aggregate syntax: 
query II rowsort label-7786
SELECT + COUNT( * ) + - col2 AS col1, - col2 AS col0 FROM tab2 GROUP BY col2
----
-57
-58
-78
-79
-86
-87

skipif mysql # not compatible
query II rowsort label-7786
SELECT + COUNT ( * ) + - col2 AS col1, - col2 AS col0 FROM tab2 GROUP BY col2
----
-57
-58
-78
-79
-86
-87

query I rowsort
SELECT ALL + col2 * + - col2 + - col2 FROM tab2 WHERE NOT 29 IS NULL GROUP BY col2 HAVING NULL IS NULL
----
-3422
-6320
-7656

onlyif mysql # aggregate syntax: 
query I rowsort label-7788
SELECT DISTINCT - COUNT( * ) * col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-7788
SELECT DISTINCT - COUNT ( * ) * col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL col1 + + 66 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
2747
3953
4087

query II rowsort
SELECT ALL + 2, - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
2
-58
2
-79
2
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-7791
SELECT DISTINCT col2 + - MIN( + ( + + 42 ) ) + + COUNT( * ) FROM tab0 AS cor0 GROUP BY col2
----
-17
-3
38

skipif mysql # not compatible
query I rowsort label-7791
SELECT DISTINCT col2 + - MIN ( + ( + + 42 ) ) + + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2
----
-17
-3
38

onlyif mysql # aggregate syntax: 
query I rowsort label-7792
SELECT DISTINCT MIN( ALL - col2 ) FROM tab1 cor0 GROUP BY col2, col0
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-7792
SELECT DISTINCT MIN ( ALL - col2 ) FROM tab1 cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL - ( - col1 ) FROM tab1 AS cor0 WHERE 51 <> col2 GROUP BY col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-7794
SELECT - COUNT( * ) FROM tab0 GROUP BY col2, col2 HAVING NULL < col2
----

skipif mysql # not compatible
query I rowsort label-7794
SELECT - COUNT ( * ) FROM tab0 GROUP BY col2, col2 HAVING NULL < col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7795
SELECT 57 + - COUNT( * ) + + col0 AS col2 FROM tab1 GROUP BY col0
----
138
78
84

skipif mysql # not compatible
query I rowsort label-7795
SELECT 57 + - COUNT ( * ) + + col0 AS col2 FROM tab1 GROUP BY col0
----
138
78
84

query I rowsort
SELECT ALL - 29 AS col2 FROM tab2 GROUP BY col0, col1
----
-29
-29
-29

onlyif mysql # aggregate syntax: 
query I rowsort label-7797
SELECT ALL COUNT( * ) + 34 FROM tab0 GROUP BY col2, col1 HAVING - col1 < col1
----
35

skipif mysql # not compatible
query I rowsort label-7797
SELECT ALL COUNT ( * ) + 34 FROM tab0 GROUP BY col2, col1 HAVING - col1 < col1
----
35

query I rowsort
SELECT ALL col0 + + 89 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
115
132
172

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - 18 + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT - 81 BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 54 * + col1 * col1 col1, - 5 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
104544
39
175446
52
1944
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7802
SELECT DISTINCT - - COUNT( * ) FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
1

skipif mysql # not compatible
query I rowsort label-7802
SELECT DISTINCT - - COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7803
SELECT - MIN( ALL - col2 ) * COUNT( * ) * - MIN( ALL - col2 ) FROM tab0 AS cor0 WHERE NOT ( - 6 ) IS NULL GROUP BY col2
----
1444
576
6241

skipif mysql # not compatible
query I rowsort label-7803
SELECT - MIN ( ALL - col2 ) * COUNT ( * ) * - MIN ( ALL - col2 ) FROM tab0 AS cor0 WHERE NOT ( - 6 ) IS NULL GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - + 1 FROM tab1 cor0 WHERE + col1 * 86 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - 33 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-33
-33
-33

query I rowsort
SELECT DISTINCT col2 + + - 61 AS col1 FROM tab1 GROUP BY col2 HAVING NULL >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7807
SELECT DISTINCT + 20 * + + CAST( NULL AS DECIMAL ) * - + col2 FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7807
SELECT DISTINCT + 20 * + + CAST ( NULL AS REAL ) * - + col2 FROM tab1 GROUP BY col2
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7808
SELECT ALL + SUM( DISTINCT + 80 ) AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7808
SELECT ALL + SUM ( DISTINCT + 80 ) AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - ( - 87 ) AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING 13 IS NULL
----

query I rowsort
SELECT DISTINCT col0 * + col0 * - 73 - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7811
SELECT - 24 FROM tab2 GROUP BY col1 HAVING - COUNT( * ) BETWEEN NULL AND - 66
----

skipif mysql # not compatible
query I rowsort label-7811
SELECT - 24 FROM tab2 GROUP BY col1 HAVING - COUNT ( * ) BETWEEN NULL AND - 66
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query II rowsort
SELECT DISTINCT col0, - 63 - - + 9 - + - 71 * - 5 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
-409
91
-409
92
-409

query I rowsort
SELECT - 70 / 73 + + col0 AS col2 FROM tab1 WHERE + col2 + - + col0 + col0 = 1 * - COALESCE ( - 76, - col0 ) GROUP BY col0 HAVING NULL = - 79
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
44
57
6

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7816
SELECT DISTINCT CAST( NULL AS DECIMAL ) AS col0 FROM tab1 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-7816
SELECT DISTINCT CAST ( NULL AS REAL ) AS col0 FROM tab1 GROUP BY col0, col1
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7817
SELECT DISTINCT COALESCE ( col0, 57 * + col0 ) AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL > COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-7817
SELECT DISTINCT COALESCE ( col0, 57 * + col0 ) AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL > COUNT ( * )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7818
SELECT ( - MIN( CAST( + + col2 AS SIGNED ) ) ) FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-7818
SELECT ( - MIN ( CAST ( + + col2 AS INTEGER ) ) ) FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT - - 39 * col2 FROM tab0 cor0 GROUP BY col2, col1
----
1482
3081
936

query I rowsort
SELECT ALL + col0 + + + 96 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
122
139
179

query I rowsort
SELECT - 52 FROM tab1 AS cor0 GROUP BY col2
----
-52
-52
-52

onlyif mysql # aggregate syntax: 
query I rowsort label-7822
SELECT + 90 + + COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
91
91
91

skipif mysql # not compatible
query I rowsort label-7822
SELECT + 90 + + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
91
91
91

query I rowsort
SELECT DISTINCT + - 90 FROM tab2 cor0 GROUP BY col0
----
-90

query I rowsort
SELECT DISTINCT - col2 FROM tab0 WHERE NOT + col0 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL + 8 * + col0 FROM tab2 GROUP BY col0
----
120
728
736

query I rowsort
SELECT + 80 FROM tab1 GROUP BY col0 HAVING + - 46 BETWEEN NULL AND col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7827
SELECT SUM( DISTINCT - - col2 ) FROM tab0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-7827
SELECT SUM ( DISTINCT - - col2 ) FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT 66 * + 69 * 92 * - 1 FROM tab0 GROUP BY col0
----
-418968
-418968
-418968

onlyif mysql # DIV for integer division: 
query I rowsort label-7829
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 DIV + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7829
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 / + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

onlyif mysql # aggregate syntax: 
query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT( * ) * + + MIN( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT ( * ) * + + MIN ( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7831
SELECT DISTINCT - + COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-7831
SELECT DISTINCT - + COUNT ( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1

onlyif mysql # aggregate syntax: 
query I rowsort label-7832
SELECT - col2 + - + 10 + - COUNT( 68 ) + + 49 FROM tab0 AS cor0 WHERE NOT - 32 IS NOT NULL GROUP BY col2, col1, col1
----

skipif mysql # not compatible
query I rowsort label-7832
SELECT - col2 + - + 10 + - COUNT ( 68 ) + + 49 FROM tab0 AS cor0 WHERE NOT - 32 IS NOT NULL GROUP BY col2, col1, col1
----

query I rowsort
SELECT ALL + 76 * + + col1 + 81 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL AND ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 50 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-32
22
28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 GROUP BY col0 HAVING NOT ( 64 ) < ( NULL )
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col1, col1, col2
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7837
SELECT ALL - CAST( NULL AS SIGNED ) * 92 + + + col2 + col2 / + col2 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7837
SELECT ALL - CAST ( NULL AS INTEGER ) * 92 + + + col2 + col2 / + col2 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7838
SELECT DISTINCT col0 * + COUNT( * ) FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-7838
SELECT DISTINCT col0 * + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7839
SELECT DISTINCT + ( + col0 ) * - col0 / - CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) + 3 * + - col0 * - col0 AS col0 FROM tab1 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-7839
SELECT DISTINCT + ( + col0 ) * - col0 / - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) + 3 * + - col0 * - col0 AS col0 FROM tab1 GROUP BY col0
----
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL col0 * - - ( ( - + 20 ) ) * + COALESCE ( + 88, + + col2 ) + col0, col0 AS col2 FROM tab1 GROUP BY col0
----
-144238
82
-38698
22
-49252
28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 97 * - - 29 * - + col1 col2 FROM tab2 GROUP BY col1 HAVING NOT + + col1 IS NULL
----
-115333
-165967
-171593

onlyif mysql # aggregate syntax: 
query I rowsort label-7842
SELECT ALL - COUNT( * ) - col0 FROM tab2 AS cor0 GROUP BY col0
----
-16
-92
-93

skipif mysql # not compatible
query I rowsort label-7842
SELECT ALL - COUNT ( * ) - col0 FROM tab2 AS cor0 GROUP BY col0
----
-16
-92
-93

query I rowsort
SELECT ALL + 62 * + 5 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7844
SELECT ALL - COUNT( * ) FROM tab0 GROUP BY col0, col1 HAVING ( - 66 - 16 IS NULL )
----

skipif mysql # not compatible
query I rowsort label-7844
SELECT ALL - COUNT ( * ) FROM tab0 GROUP BY col0, col1 HAVING ( - 66 - 16 IS NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7845
SELECT ALL + COUNT( * ) + + + ( 39 ) FROM tab2 GROUP BY col0
----
40
40
40

skipif mysql # not compatible
query I rowsort label-7845
SELECT ALL + COUNT ( * ) + + + ( 39 ) FROM tab2 GROUP BY col0
----
40
40
40

query I rowsort
SELECT - 94 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-94
-94
-94

onlyif mysql # aggregate syntax: 
query I rowsort label-7847
SELECT - + COUNT( * ) * - col1 + col1 * - - 46 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
3807

skipif mysql # not compatible
query I rowsort label-7847
SELECT - + COUNT ( * ) * - col1 + col1 * - - 46 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
3807

query I rowsort
SELECT ALL ( - + col2 ) FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT col0 + - col0 + col0 FROM tab2 GROUP BY col0, col0, col1 HAVING NOT + col1 * - col1 + - + col1 = + - col1
----
15
91
92

query I rowsort
SELECT DISTINCT - + col0 - + - 84 + - col0 * - col0 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
1890
6890
734

query I rowsort
SELECT - col0 - - + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT ALL - ( + col2 ), - col2 FROM tab2 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7853
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( ( + MAX( ALL + 44 ) + 66 NOT BETWEEN - - 81 AND + 93 + + + col2 - ( + - 77 ) + - + 79 ) )
----
NULL

skipif mysql # not compatible
query I rowsort label-7853
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( ( + MAX ( ALL + 44 ) + 66 NOT BETWEEN - - 81 AND + 93 + + + col2 - ( + - 77 ) + - + 79 ) )
----
NULL

query I rowsort
SELECT - - col0 * - + col0 + + - 26 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-510
-6750
-810

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + NULLIF ( col0, - 14 + ( 71 ) ), col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT - - 39 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
39
39
39

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7857
SELECT DISTINCT CAST( NULL AS SIGNED ) + - - col1 AS col0, + 17 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
17

skipif mysql # not compatible
query II rowsort label-7857
SELECT DISTINCT CAST ( NULL AS INTEGER ) + - - col1 AS col0, + 17 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
17

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7858
SELECT - 61 DIV COUNT( * ) AS col0 FROM tab1 GROUP BY col2
----
-61
-61
-61

skipif mysql # not compatible
query I rowsort label-7858
SELECT - 61 / COUNT ( * ) AS col0 FROM tab1 GROUP BY col2
----
-61
-61
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-7859
SELECT SUM( 75 ) AS col1 FROM tab2 GROUP BY col0
----
75
75
75

skipif mysql # not compatible
query I rowsort label-7859
SELECT SUM ( 75 ) AS col1 FROM tab2 GROUP BY col0
----
75
75
75

onlyif mysql # aggregate syntax: 
query I rowsort label-7860
SELECT DISTINCT + col0 + COUNT( DISTINCT COALESCE ( - - col2, ( - col1 ) * col0 + + col1 ) ) + - 98 + ( col0 ) FROM tab1 GROUP BY col2, col0 HAVING + col2 * + col0 + + col2 IS NOT NULL
----
-41
-53
67

skipif mysql # not compatible
query I rowsort label-7860
SELECT DISTINCT + col0 + COUNT ( DISTINCT COALESCE ( - - col2, ( - col1 ) * col0 + + col1 ) ) + - 98 + ( col0 ) FROM tab1 GROUP BY col2, col0 HAVING + col2 * + col0 + + col2 IS NOT NULL
----
-41
-53
67

onlyif mysql # aggregate syntax: 
query I rowsort label-7861
SELECT - col1 - + - col1 * COUNT( * ) + + 71 + 69 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
140
140
140

skipif mysql # not compatible
query I rowsort label-7861
SELECT - col1 - + - col1 * COUNT ( * ) + + 71 + 69 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
140
140
140

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7862
SELECT ALL - COUNT( * ) DIV - col0 + - COUNT( * ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7862
SELECT ALL - COUNT ( * ) / - col0 + - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

query II rowsort
SELECT DISTINCT col2 * + ( - col2 ), + 7 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <= ( 4 )
----

query I rowsort
SELECT - 25 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND 30
----

query I rowsort
SELECT DISTINCT 27 FROM tab1 AS cor0 WHERE NOT - col2 IS NOT NULL GROUP BY col0, col0 HAVING - AVG ( col0 ) * - 17 NOT BETWEEN NULL AND + - 44
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7866
SELECT DISTINCT 84 * 42 + - 91 - SUM( + col0 ) * - - col0 + col0 - ( ( + + col0 ) ) + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-4935
-5119
3197

skipif mysql # not compatible
query I rowsort label-7866
SELECT DISTINCT 84 * 42 + - 91 - SUM ( + col0 ) * - - col0 + col0 - ( ( + + col0 ) ) + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-4935
-5119
3197

onlyif mysql # aggregate syntax: 
query II rowsort label-7867
SELECT ALL SUM( DISTINCT - + col0 ), + col0 FROM tab1 GROUP BY col0
----
-22
22
-28
28
-82
82

skipif mysql # not compatible
query II rowsort label-7867
SELECT ALL SUM ( DISTINCT - + col0 ), + col0 FROM tab1 GROUP BY col0
----
-22
22
-28
28
-82
82

onlyif mysql # aggregate syntax: 
query I rowsort label-7868
SELECT ALL - COUNT( DISTINCT + 84 ) * COUNT( DISTINCT + 75 ) * + col1 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-7868
SELECT ALL - COUNT ( DISTINCT + 84 ) * COUNT ( DISTINCT + 75 ) * + col1 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7869
SELECT DISTINCT 56 / - CAST( NULL AS SIGNED ) + + + CAST( - - ( MIN( + 10 ) ) AS DECIMAL ) * col0 + ( + 30 ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-7869
SELECT DISTINCT 56 / - CAST ( NULL AS INTEGER ) + + + CAST ( - - ( MIN ( + 10 ) ) AS REAL ) * col0 + ( + 30 ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL + 32 * - + col1 FROM tab0 GROUP BY col1
----
-2592
0

onlyif mysql # aggregate syntax: 
query I rowsort label-7872
SELECT DISTINCT col0 AS col1 FROM tab1 WHERE NOT + col0 = - col0 + - 99 AND 99 < col2 GROUP BY col0 HAVING NOT ( - COUNT( * ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7872
SELECT DISTINCT col0 AS col1 FROM tab1 WHERE NOT + col0 = - col0 + - 99 AND 99 < col2 GROUP BY col0 HAVING NOT ( - COUNT ( * ) ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7873
SELECT - col0 * - - COUNT( * ) * + + col1 * - 46 + - col1 AS col2, col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
26
0
83
160137
43

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7873
SELECT - col0 * - - COUNT ( * ) * + + col1 * - 46 + - col1 AS col2, col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
26
0
83
160137
43

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7874
SELECT DISTINCT CAST( NULL AS DECIMAL ) + + 62 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 57 IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-7874
SELECT DISTINCT CAST ( NULL AS REAL ) + + 62 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 57 IS NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-7875
SELECT + MIN( DISTINCT col2 ) FROM tab1 AS cor0 WHERE NOT col1 BETWEEN - + col1 + + - col1 AND + 7 GROUP BY col2 HAVING + col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7875
SELECT + MIN ( DISTINCT col2 ) FROM tab1 AS cor0 WHERE NOT col1 BETWEEN - + col1 + + - col1 AND + 7 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT + - ( - 9 ) * + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-369
-531
-549

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7877
SELECT DISTINCT CAST( + 49 AS DECIMAL ) + + 45 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7877
SELECT DISTINCT CAST ( + 49 AS REAL ) + + 45 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 40 FROM tab0 AS cor0 GROUP BY col0, col1
----
40
40
40

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-7879
SELECT ALL 68 + - col2 DIV + - 56, ( + COUNT( * ) ) * 11 AS col1 FROM tab0 GROUP BY col2
----
68
11
68
11
69
11

skipif mysql # not compatible
query II rowsort label-7879
SELECT ALL 68 + - col2 / + - 56, ( + COUNT ( * ) ) * 11 AS col1 FROM tab0 GROUP BY col2
----
68
11
68
11
69
11

onlyif mysql # aggregate syntax: 
query I rowsort label-7880
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING ( NOT ( NULL ) BETWEEN + COUNT( ALL + - col2 ) / + col1 AND + col2 * - col0 + + col1 )
----

skipif mysql # not compatible
query I rowsort label-7880
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING ( NOT ( NULL ) BETWEEN + COUNT ( ALL + - col2 ) / + col1 AND + col2 * - col0 + + col1 )
----

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE + 6 / - - col1 * + - col1 IS NOT NULL GROUP BY col2, col2, col0 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + - col2 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
2378
4661
5307

onlyif mysql # aggregate syntax: 
query II rowsort label-7883
SELECT 45 AS col2, + SUM( 13 ) * 29 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
45
377
45
377
45
377

skipif mysql # not compatible
query II rowsort label-7883
SELECT 45 AS col2, + SUM ( 13 ) * 29 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
45
377
45
377
45
377

query I rowsort
SELECT + + ( + + col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT - col1 + 84 - + col1 FROM tab2 GROUP BY col2, col1
----
-34
-38
2

query II rowsort
SELECT col1 + - col2 AS col2, 94 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT + col2 BETWEEN + + col1 + + col1 AND NULL
----
57
94

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7887
SELECT ALL - ( + - col1 ) DIV - COUNT( * ) FROM tab1 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-7887
SELECT ALL - ( + - col1 ) / - COUNT ( * ) FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - 31 AS col2 FROM tab1 GROUP BY col2, col1
----
-31
-31
-31

query I rowsort
SELECT - 71 * - + col1 FROM tab0 GROUP BY col1, col2
----
0
0
5751

query I rowsort
SELECT ALL 63 AS col0 FROM tab0 GROUP BY col1
----
63
63

onlyif mysql # aggregate syntax: 
query I rowsort label-7891
SELECT + - COUNT( * ) FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-7891
SELECT + - COUNT ( * ) FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - + col1 + - + ( + col1 ) * + 94 <= NULL
----

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NOT - - 57 IS NULL
----
24
38
79

query I rowsort
SELECT col0 + - ( + 86 ) - - col0 FROM tab1 GROUP BY col0
----
-30
-42
78

onlyif mysql # aggregate syntax: 
query I rowsort label-7895
SELECT + COUNT( * ) FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7895
SELECT + COUNT ( * ) FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT 80 + + - col0 AS col0 FROM tab0 GROUP BY col0
----
-3
37
54

onlyif mysql # aggregate syntax: 
query I rowsort label-7897
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN NULL AND - - COUNT( DISTINCT + 93 ) + - + MAX( + + col0 ) + - col2
----

skipif mysql # not compatible
query I rowsort label-7897
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN NULL AND - - COUNT ( DISTINCT + 93 ) + - + MAX ( + + col0 ) + - col2
----

query I rowsort
SELECT DISTINCT ( col0 ) + + + col0 / + col0 + 48 FROM tab0 cor0 GROUP BY col0 HAVING - ( - col0 ) / + - col0 > NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7899
SELECT CAST( NULL AS DECIMAL ) AS col0 FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7899
SELECT CAST ( NULL AS REAL ) AS col0 FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT 84 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
84
84
84

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7901
SELECT col0 AS col0, CAST( - COALESCE ( - - col0, - col0 ) AS SIGNED ) AS col0 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

skipif mysql # not compatible
query II rowsort label-7901
SELECT col0 AS col0, CAST ( - COALESCE ( - - col0, - col0 ) AS INTEGER ) AS col0 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 WHERE 11 IS NULL GROUP BY col1, col1
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7903
SELECT + - col1 AS col0, + col1 * - COUNT( * ) * + col1 + - ( + col1 ) col2 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-81
-6642
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7903
SELECT + - col1 AS col0, + col1 * - COUNT ( * ) * + col1 + - ( + col1 ) col2 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-81
-6642
0
0

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-7904
SELECT COUNT( * ) AS col2, + COUNT( * ) DIV + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
0
1
0
1
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7904
SELECT COUNT ( * ) AS col2, + COUNT ( * ) / + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
0
1
0
1
0

onlyif mysql # DIV for integer division: 
query I rowsort label-7905
SELECT ALL - 96 DIV - col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING NULL IS NULL
----
1
3
4

skipif mysql # not compatible
query I rowsort label-7905
SELECT ALL - 96 / - col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING NULL IS NULL
----
1
3
4

onlyif mysql # aggregate syntax: 
query I rowsort label-7906
SELECT ALL - COUNT( * ) + col0 AS col1 FROM tab2 GROUP BY col2, col0
----
14
90
91

skipif mysql # not compatible
query I rowsort label-7906
SELECT ALL - COUNT ( * ) + col0 AS col1 FROM tab2 GROUP BY col2, col0
----
14
90
91

query I rowsort
SELECT ALL - 16 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-16
-16

onlyif mysql # aggregate syntax: 
query II rowsort label-7908
SELECT DISTINCT ( - col1 ) + + COUNT( * ) + + 13 AS col2, + col1 + - 13 AS col2 FROM tab0 GROUP BY col1
----
-67
68
15
-13

skipif mysql # not compatible
query II rowsort label-7908
SELECT DISTINCT ( - col1 ) + + COUNT ( * ) + + 13 AS col2, + col1 + - 13 AS col2 FROM tab0 GROUP BY col1
----
-67
68
15
-13

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7909
SELECT ALL 7 + + col0 AS col1 FROM tab2 WHERE NOT ( - CAST( 61 AS DECIMAL ) IS NOT NULL ) GROUP BY col0 HAVING NOT + col0 <> 9 * col0 + - - SUM( + col2 ) * + - col0 + COUNT( * ) + + COUNT( * ) * + 94
----

skipif mysql # not compatible
query I rowsort label-7909
SELECT ALL 7 + + col0 AS col1 FROM tab2 WHERE NOT ( - CAST ( 61 AS REAL ) IS NOT NULL ) GROUP BY col0 HAVING NOT + col0 <> 9 * col0 + - - SUM ( + col2 ) * + - col0 + COUNT ( * ) + + COUNT ( * ) * + 94
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7910
SELECT COUNT( * ) FROM tab0 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-7910
SELECT COUNT ( * ) FROM tab0 GROUP BY col1
----
1
2

query I rowsort
SELECT - - 1 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7912
SELECT - + col0 - + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + NULLIF ( + - COALESCE ( + 38, + MIN( - col0 ) ), - col0 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7912
SELECT - + col0 - + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + NULLIF ( + - COALESCE ( + 38, + MIN ( - col0 ) ), - col0 ) IS NOT NULL
----

query I rowsort
SELECT 33 * + col1 AS col0 FROM tab1 WHERE ( 98 + 49 ) = - col1 GROUP BY col1
----

query I rowsort
SELECT ALL - 28 FROM tab2 WHERE 96 * 51 - col0 IS NOT NULL GROUP BY col1, col2
----
-28
-28
-28

onlyif mysql # aggregate syntax: 
query I rowsort label-7915
SELECT - 32 * col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( + 47 * - col0 + COUNT( * ) ) < - ( col0 )
----

skipif mysql # not compatible
query I rowsort label-7915
SELECT - 32 * col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( + 47 * - col0 + COUNT ( * ) ) < - ( col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7916
SELECT CASE col1 WHEN 97 THEN NULL WHEN - col1 THEN NULL WHEN 44 + 66 THEN - 54 ELSE - MAX( - col1 ) / 25 END * col1 AS col2 FROM tab1 WHERE col0 IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7916
SELECT CASE col1 WHEN 97 THEN NULL WHEN - col1 THEN NULL WHEN 44 + 66 THEN - 54 ELSE - MAX ( - col1 ) / 25 END * col1 AS col2 FROM tab1 WHERE col0 IS NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7917
SELECT col1 FROM tab1 GROUP BY col0, col1 HAVING ( COUNT( ALL 53 ) * + col1 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7917
SELECT col1 FROM tab1 GROUP BY col0, col1 HAVING ( COUNT ( ALL 53 ) * + col1 ) IS NULL
----

query I rowsort
SELECT ALL 55 * 96 AS col1 FROM tab0 GROUP BY col0
----
5280
5280
5280

query I rowsort
SELECT - col2 - col2 FROM tab1 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT DISTINCT ( - col2 ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT - col2 * + col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT ( col2 ) * 7 - - 40 FROM tab1 GROUP BY col2, col1 HAVING col1 NOT IN ( + 93 )
----
355
537
96

query I rowsort
SELECT DISTINCT - col0 + + col0 FROM tab0 WHERE ( + col1 * col0 ) <> + col2 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col0, col1 HAVING NULL <= ( + col1 / col0 + + col0 )
----

query I rowsort
SELECT DISTINCT - 14 AS col2 FROM tab0 WHERE NULL NOT BETWEEN ( col1 + + 55 ) AND ( col1 * + 86 ) GROUP BY col0, col2, col1
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col1 FROM tab0 WHERE NULL NOT BETWEEN ( NULL ) AND - 39 * 65 GROUP BY col1
----

query I rowsort
SELECT - 49 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING + 75 * + col1 > ( - col1 )
----
-49

query I rowsort
SELECT 84 + 79 * + ( - col0 ) FROM tab0 AS cor0 GROUP BY col0
----
-1970
-3313
-6473

onlyif mysql # DIV for integer division: 
query I rowsort label-7930
SELECT ALL col1 - - ( + 29 ) DIV - 9 FROM tab2 GROUP BY col0, col1
----
38
56
58

skipif mysql # not compatible
query I rowsort label-7930
SELECT ALL col1 - - ( + 29 ) / - 9 FROM tab2 GROUP BY col0, col1
----
38
56
58

query I rowsort
SELECT ALL - 85 AS col2 FROM tab1 GROUP BY col1, col1
----
-85
-85
-85

onlyif mysql # aggregate syntax: 
query I rowsort label-7932
SELECT ALL + col1 * COUNT( * ) AS col0 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-7932
SELECT ALL + col1 * COUNT ( * ) AS col0 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - ( - ( - 82 ) ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING ( col0 / - col2 ) IS NULL
----

query I rowsort
SELECT + - col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING ( col0 ) BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7935
SELECT DISTINCT - col1 + + COUNT( 66 ) FROM tab0 AS cor0 GROUP BY col1, col2
----
-80
1

skipif mysql # not compatible
query I rowsort label-7935
SELECT DISTINCT - col1 + + COUNT ( 66 ) FROM tab0 AS cor0 GROUP BY col1, col2
----
-80
1

onlyif mysql # aggregate syntax: 
query I rowsort label-7936
SELECT col1 + COUNT( * ) FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-7936
SELECT col1 + COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

query I rowsort
SELECT DISTINCT - col2 * - 27 FROM tab0 GROUP BY col2 HAVING NOT NULL >= ( + 12 * 86 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7938
SELECT - MAX( DISTINCT - col2 ) FROM tab0 WHERE NOT ( + 98 ) = + 0 GROUP BY col2, col2 HAVING NOT ( NULL ) NOT BETWEEN NULL AND ( + ( SUM( + col0 ) ) )
----

skipif mysql # not compatible
query I rowsort label-7938
SELECT - MAX ( DISTINCT - col2 ) FROM tab0 WHERE NOT ( + 98 ) = + 0 GROUP BY col2, col2 HAVING NOT ( NULL ) NOT BETWEEN NULL AND ( + ( SUM ( + col0 ) ) )
----

query I rowsort
SELECT DISTINCT + 13 FROM tab1 GROUP BY col1
----
13

query I rowsort
SELECT ALL 11 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
11
11
11

onlyif mysql # aggregate syntax: 
query I rowsort label-7941
SELECT MIN( - col2 ) * ( - COUNT( * ) ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

skipif mysql # not compatible
query I rowsort label-7941
SELECT MIN ( - col2 ) * ( - COUNT ( * ) ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-7942
SELECT DISTINCT + col0 * + COUNT( * ) DIV ( col0 * col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-7942
SELECT DISTINCT + col0 * + COUNT ( * ) / ( col0 * col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT - + 44 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 54 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
54

query I rowsort
SELECT + col1 * col1 - col1 FROM tab2 AS cor0 GROUP BY col1
----
1640
3422
3660

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7946
SELECT COUNT( ALL + CAST( + - col2 AS SIGNED ) ) * ( col0 * + 47 ) FROM tab1 GROUP BY col0
----
1034
1316
3854

skipif mysql # not compatible
query I rowsort label-7946
SELECT COUNT ( ALL + CAST ( + - col2 AS INTEGER ) ) * ( col0 * + 47 ) FROM tab1 GROUP BY col0
----
1034
1316
3854

query I rowsort
SELECT + 65 AS col0 FROM tab2 cor0 GROUP BY col1, col1
----
65
65
65

query I rowsort
SELECT DISTINCT + 68 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING - 87 IS NOT NULL
----
68

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7949
SELECT + 95 * col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( CAST( + col1 AS SIGNED ) * - COUNT( * ) ) <> - MIN( ALL 15 )
----
4275
6745
760

skipif mysql # not compatible
query I rowsort label-7949
SELECT + 95 * col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( CAST ( + col1 AS INTEGER ) * - COUNT ( * ) ) <> - MIN ( ALL 15 )
----
4275
6745
760

onlyif mysql # aggregate syntax: 
query I rowsort label-7950
SELECT COUNT( DISTINCT - + col1 ) * col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

skipif mysql # not compatible
query I rowsort label-7950
SELECT COUNT ( DISTINCT - + col1 ) * col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL 2 * + 16 FROM tab0 AS cor0 GROUP BY col2
----
32
32
32

onlyif mysql # aggregate syntax: 
query II rowsort label-7953
SELECT DISTINCT col2, + 4 - - COUNT( * ) * COUNT( * ) FROM tab0 AS cor0 GROUP BY col2
----
24
5
38
5
79
5

skipif mysql # not compatible
query II rowsort label-7953
SELECT DISTINCT col2, + 4 - - COUNT ( * ) * COUNT ( * ) FROM tab0 AS cor0 GROUP BY col2
----
24
5
38
5
79
5

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7954
SELECT ALL + col2 * col1 * col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING + CAST( NULL AS SIGNED ) + ( col2 + 12 ) IS NULL
----
137924
368219
461709

skipif mysql # not compatible
query I rowsort label-7954
SELECT ALL + col2 * col1 * col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING + CAST ( NULL AS INTEGER ) + ( col2 + 12 ) IS NULL
----
137924
368219
461709

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN + col2 * col2 + 13 AND - 70 * col2
----

onlyif mysql # aggregate syntax: 
query II rowsort label-7956
SELECT MIN( DISTINCT - - col2 ) AS col0, col2 AS col0 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

skipif mysql # not compatible
query II rowsort label-7956
SELECT MIN ( DISTINCT - - col2 ) AS col0, col2 AS col0 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

onlyif mysql # aggregate syntax: 
query I rowsort label-7957
SELECT col2 * COUNT( * ) AS col0 FROM tab0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-7957
SELECT col2 * COUNT ( * ) AS col0 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT 47 * + - 30 AS col2 FROM tab2 GROUP BY col2, col1
----
-1410

query I rowsort
SELECT + col1 * - 81 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-3564
-4617
-486

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7960
SELECT + - 28 + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col1, col0 HAVING - COALESCE ( COUNT( * ), - ( + CAST( + 10 AS SIGNED ) ) ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7960
SELECT + - 28 + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col1, col0 HAVING - COALESCE ( COUNT ( * ), - ( + CAST ( + 10 AS INTEGER ) ) ) IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7961
SELECT 72 - + - CAST( + + MAX( ALL - ( ( col1 ) ) ) AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col1
----
15
28
66

skipif mysql # not compatible
query I rowsort label-7961
SELECT 72 - + - CAST ( + + MAX ( ALL - ( ( col1 ) ) ) AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col1
----
15
28
66

query I rowsort
SELECT ALL + 37 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
37
37
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7963
SELECT DISTINCT 42 * ( CAST( 67 AS SIGNED ) ) AS col2 FROM tab1 GROUP BY col2, col2
----
2814

skipif mysql # not compatible
query I rowsort label-7963
SELECT DISTINCT 42 * ( CAST ( 67 AS INTEGER ) ) AS col2 FROM tab1 GROUP BY col2, col2
----
2814

onlyif mysql # aggregate syntax: 
query I rowsort label-7964
SELECT DISTINCT + MIN( DISTINCT + + 18 ) - - 91 * + MIN( - col2 ) FROM tab1 GROUP BY col2, col2
----
-4077
-6443
-710

skipif mysql # not compatible
query I rowsort label-7964
SELECT DISTINCT + MIN ( DISTINCT + + 18 ) - - 91 * + MIN ( - col2 ) FROM tab1 GROUP BY col2, col2
----
-4077
-6443
-710

query I rowsort
SELECT + - col0 * - col0 + + + 78 FROM tab2 AS cor0 WHERE NOT 64 IS NULL GROUP BY col2, col0 HAVING NULL NOT IN ( col2 )
----

query I rowsort
SELECT + 65 FROM tab0 AS cor0 GROUP BY col2 HAVING 62 NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - - col2 * + 15 * + col2 + - ( col2 ) - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7968
SELECT - 72 FROM tab2 cor0 GROUP BY col1 HAVING - col1 * CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7968
SELECT - 72 FROM tab2 cor0 GROUP BY col1 HAVING - col1 * CAST ( NULL AS INTEGER ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7969
SELECT ALL - MIN( DISTINCT - + col2 ) - + - col2 * ( ( col2 ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 * 58 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7969
SELECT ALL - MIN ( DISTINCT - + col2 ) - + - col2 * ( ( col2 ) ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 * 58 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * + col1 + col2 AS col1 FROM tab2 AS cor0 WHERE ( NULL ) = - 43 GROUP BY col2, col1, col2 HAVING NOT NULL >= 10
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 97 + + ( - 30 ) col1 FROM tab2 cor0 GROUP BY col2
----
67
67
67

onlyif mysql # aggregate syntax: 
query I rowsort label-7972
SELECT ALL - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN + - 54 AND ( + COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-7972
SELECT ALL - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN + - 54 AND ( + COUNT ( * ) )
----

query I rowsort
SELECT ALL + col2 * - 77 AS col2 FROM tab1 GROUP BY col2
----
-3465
-5467
-616

onlyif mysql # aggregate syntax: 
query I rowsort label-7974
SELECT - 64 + col0 + + ( - - col0 ) + COUNT( * ) * col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-7974
SELECT - 64 + col0 + + ( - - col0 ) + COUNT ( * ) * col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7975
SELECT ALL + 23 + CAST( NULL AS SIGNED ) * - col0 * col0 * col0 / + - col0 + ( col0 ) FROM tab2 GROUP BY col0 HAVING - COUNT( * ) * + CAST( NULL AS SIGNED ) < NULL
----

skipif mysql # not compatible
query I rowsort label-7975
SELECT ALL + 23 + CAST ( NULL AS INTEGER ) * - col0 * col0 * col0 / + - col0 + ( col0 ) FROM tab2 GROUP BY col0 HAVING - COUNT ( * ) * + CAST ( NULL AS INTEGER ) < NULL
----

query I rowsort
SELECT - ( col2 ) FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING + - AVG ( ALL + + 47 ) IS NOT NULL
----
-58
-79
-87

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7977
SELECT - MAX( ALL + - 12 ) / + CAST( NULL AS SIGNED ) * - - 40 * - col1 - + col1 AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7977
SELECT - MAX ( ALL + - 12 ) / + CAST ( NULL AS INTEGER ) * - - 40 * - col1 - + col1 AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

query I rowsort
SELECT DISTINCT + col0 * - - 3 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
246
66
84

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7979
SELECT ALL - CASE WHEN NOT - CAST( NULL AS DECIMAL ) IS NULL THEN ( - + CAST( NULL AS SIGNED ) ) END FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7979
SELECT ALL - CASE WHEN NOT - CAST ( NULL AS REAL ) IS NULL THEN ( - + CAST ( NULL AS INTEGER ) ) END FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7980
SELECT - + COALESCE ( + + 25, col2, + ( col2 ) + + col2 ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING 33 + - CAST( NULL AS SIGNED ) IS NULL
----
-25
-25
-25

skipif mysql # not compatible
query I rowsort label-7980
SELECT - + COALESCE ( + + 25, col2, + ( col2 ) + + col2 ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING 33 + - CAST ( NULL AS INTEGER ) IS NULL
----
-25
-25
-25

query I rowsort
SELECT ALL 73 + - 23 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT + - ( col2 ) = - col2
----

query I rowsort
SELECT - 28 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL <> + 26 + + 99 + - + ( ( + 57 ) )
----

query II rowsort
SELECT DISTINCT 49, + 39 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
49
39

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7984
SELECT COALESCE ( - + 20, COUNT( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST( - col1 AS SIGNED ) * MIN( CAST( NULL AS SIGNED ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT( * ) THEN NULL WHEN + CAST( - ( + CAST( COUNT( * ) AS SIGNED ) ) AS SIGNED ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7984
SELECT COALESCE ( - + 20, COUNT ( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST ( - col1 AS INTEGER ) * MIN ( CAST ( NULL AS INTEGER ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT ( * ) THEN NULL WHEN + CAST ( - ( + CAST ( COUNT ( * ) AS INTEGER ) ) AS INTEGER ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7985
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7985
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 + 30 + + col0 * 11 AS col0 FROM tab0 WHERE ( NULL IS NOT NULL ) GROUP BY col0, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7987
SELECT + COALESCE ( + MAX( ALL + col1 ), COUNT( ALL NULLIF ( + ( + + 7 ), - + col0 + + col2 ) ) ) * - 16 FROM tab2 AS cor0 GROUP BY col0
----
-656
-944
-976

skipif mysql # not compatible
query I rowsort label-7987
SELECT + COALESCE ( + MAX ( ALL + col1 ), COUNT ( ALL NULLIF ( + ( + + 7 ), - + col0 + + col2 ) ) ) * - 16 FROM tab2 AS cor0 GROUP BY col0
----
-656
-944
-976

query I rowsort
SELECT + col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT - 93 FROM tab0 AS cor0 GROUP BY col0
----
-93
-93
-93

query I rowsort
SELECT ALL - ( + - 71 ) FROM tab2 AS cor0 GROUP BY col0
----
71
71
71

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + 56 - - 78 AS col1 FROM tab1 GROUP BY col2
----
134
134
134

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0 HAVING NOT - col0 = NULL
----

query I rowsort
SELECT + ( - ( + - ( ( col2 ) ) ) ) - + + col2 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 + + col0 * - + col0 FROM tab2 GROUP BY col0
----
-210
-8190
-8372

query I rowsort
SELECT + 71 FROM tab1 GROUP BY col0 HAVING ( ( NOT + + 38 IS NOT NULL ) )
----

query I rowsort
SELECT DISTINCT - - col1 + + col1 + + + ( - col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
44
57
6

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7998
SELECT col0 AS col0 FROM tab0 cor0 GROUP BY col0 HAVING + SUM( DISTINCT CAST( NULL AS DECIMAL ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7998
SELECT col0 AS col0 FROM tab0 cor0 GROUP BY col0 HAVING + SUM ( DISTINCT CAST ( NULL AS REAL ) ) IS NOT NULL
----

query II rowsort
SELECT + col0 + + NULLIF ( col2, + - col2 ) AS col0, + col2 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
153
71
30
8
73
45

query I rowsort
SELECT DISTINCT + 85 - - col2 AS col1 FROM tab1 GROUP BY col1, col2
----
130
156
93

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - 44 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8003
SELECT DISTINCT - - COUNT( * ) * + 26 + + col2 + + 68 + col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8003
SELECT DISTINCT - - COUNT ( * ) * + 26 + + col2 + + 68 + col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8004
SELECT 42 * col0 AS col1, - col0 * + col0 + + 59 FROM tab1 GROUP BY col0, col0 HAVING COUNT( * ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-8004
SELECT 42 * col0 AS col1, - col0 * + col0 + + 59 FROM tab1 GROUP BY col0, col0 HAVING COUNT ( * ) IS NULL
----

query II rowsort
SELECT - NULLIF ( + + 28, - col0 + + - 87 ) / + - col0 AS col1, col1 + - col0 AS col1 FROM tab2 GROUP BY col0, col2, col1 HAVING NOT - col0 > - 7
----
0
-32
0
-51
1
46

onlyif mysql # aggregate syntax: 
query I rowsort label-8006
SELECT DISTINCT + COUNT( * ) - + col1 + - 89 + - col2 * - - col1 FROM tab2 GROUP BY col1, col2 HAVING ( + col2 * - ( - 8 ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8006
SELECT DISTINCT + COUNT ( * ) - + col1 + - 89 + - col2 * - - col1 FROM tab2 GROUP BY col1, col2 HAVING ( + col2 * - ( - 8 ) ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8007
SELECT DISTINCT ( + col2 ) / - COALESCE ( - 12, + col2 ) * - CAST( NULL AS SIGNED ) / + col1 * + 3, col2 AS col0 FROM tab1 GROUP BY col1, col2, col1
----
NULL
45
NULL
71
NULL
8

skipif mysql # not compatible
query II rowsort label-8007
SELECT DISTINCT ( + col2 ) / - COALESCE ( - 12, + col2 ) * - CAST ( NULL AS INTEGER ) / + col1 * + 3, col2 AS col0 FROM tab1 GROUP BY col1, col2, col1
----
NULL
45
NULL
71
NULL
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8008
SELECT DISTINCT - 18 col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( + ( col0 ) ) >= col1 OR NOT - 2 > + col0 + - + CAST( - - col1 AS SIGNED ) * - col1
----
-18

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8008
SELECT DISTINCT - 18 col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( + ( col0 ) ) >= col1 OR NOT - 2 > + col0 + - + CAST ( - - col1 AS INTEGER ) * - col1
----
-18

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NULL <= NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8010
SELECT + - COUNT( ALL - CASE + col0 WHEN + CAST( col0 AS SIGNED ) THEN col1 WHEN 79 THEN NULL WHEN + - col1 THEN col0 / + col0 END ) * - 16 FROM tab0 AS cor0 WHERE + ( ( - col1 ) ) IS NOT NULL GROUP BY col1, col2 HAVING NULL < ( NULL )
----

skipif mysql # not compatible
query I rowsort label-8010
SELECT + - COUNT ( ALL - CASE + col0 WHEN + CAST ( col0 AS INTEGER ) THEN col1 WHEN 79 THEN NULL WHEN + - col1 THEN col0 / + col0 END ) * - 16 FROM tab0 AS cor0 WHERE + ( ( - col1 ) ) IS NOT NULL GROUP BY col1, col2 HAVING NULL < ( NULL )
----

query I rowsort
SELECT DISTINCT + 51 FROM tab0 GROUP BY col0
----
51

query I rowsort
SELECT ALL 52 AS col1 FROM tab2 GROUP BY col0
----
52
52
52

onlyif mysql # aggregate syntax: 
query I rowsort label-8013
SELECT ALL + MAX( + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-8013
SELECT ALL + MAX ( + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - + ( ( - col2 ) ) + - ( + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
0

query II rowsort
SELECT DISTINCT col0 AS col0, col0 * + 86 FROM tab2 AS cor0 GROUP BY col0
----
15
1290
91
7826
92
7912

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8016
SELECT + + 15 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 53 * - - 71 * - - SUM( - 48 ) * - + 77 * + ( + col2 ) + - CAST( NULL AS SIGNED ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-8016
SELECT + + 15 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 53 * - - 71 * - - SUM ( - 48 ) * - + 77 * + ( + col2 ) + - CAST ( NULL AS INTEGER ) <> NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8017
SELECT DISTINCT - - MIN( - - 77 ) * - col0 AS col1, - 37 * - - 88 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 > CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query II rowsort label-8017
SELECT DISTINCT - - MIN ( - - 77 ) * - col0 AS col1, - 37 * - - 88 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 > CAST ( NULL AS INTEGER )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8018
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NOT COUNT( * ) <> + 29
----

skipif mysql # not compatible
query I rowsort label-8018
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NOT COUNT ( * ) <> + 29
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8019
SELECT - col1 * - MAX( - col1 ) FROM tab1 GROUP BY col1
----
-1936
-3249
-36

skipif mysql # not compatible
query I rowsort label-8019
SELECT - col1 * - MAX ( - col1 ) FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + ( - col0 ) AS col2 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT + 18 AS col2 FROM tab2 GROUP BY col1, col0
----
18

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8023
SELECT CAST( + - COUNT( * ) AS SIGNED ) FROM tab2 GROUP BY col1, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8023
SELECT CAST ( + - COUNT ( * ) AS INTEGER ) FROM tab2 GROUP BY col1, col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT 62 AS col0 FROM tab0 GROUP BY col1
----
62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8025
SELECT - + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 WHERE NOT - 16 NOT IN ( - col2 * + + col0 / + 44, - 7 / col1 ) GROUP BY col0, col1 HAVING NOT ( NULL ) NOT BETWEEN NULL AND + col0 + AVG ( + col1 )
----

skipif mysql # not compatible
query I rowsort label-8025
SELECT - + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 WHERE NOT - 16 NOT IN ( - col2 * + + col0 / + 44, - 7 / col1 ) GROUP BY col0, col1 HAVING NOT ( NULL ) NOT BETWEEN NULL AND + col0 + AVG ( + col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8026
SELECT CASE + ( - - ( - + col2 ) ) WHEN col2 THEN - - 62 * + + col2 END * + COUNT( * ) + + col2 + + + 99 - + col2 - 60 * + 2 + + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8026
SELECT CASE + ( - - ( - + col2 ) ) WHEN col2 THEN - - 62 * + + col2 END * + COUNT ( * ) + + col2 + + + 99 - + col2 - 60 * + 2 + + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query II rowsort
SELECT ALL + col1, - 12 * - col1 * col1 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
44
23232
57
38988
6
432

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 92 col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
-92
-92
-92

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE 86 IS NOT NULL GROUP BY col2 HAVING ( NOT NULL <= NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8030
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - COUNT( * ) > NULL
----

skipif mysql # not compatible
query I rowsort label-8030
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - COUNT ( * ) > NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8031
SELECT - + ( + 23 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + ( 25 ) BETWEEN ( 56 + - - COUNT( * ) * + - 96 + + col0 ) AND 95 * + - col1
----

skipif mysql # not compatible
query I rowsort label-8031
SELECT - + ( + 23 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + ( 25 ) BETWEEN ( 56 + - - COUNT ( * ) * + - 96 + + col0 ) AND 95 * + - col1
----

query I rowsort
SELECT ALL + - 82 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-82
-82
-82

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2 HAVING col2 IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8034
SELECT + 90 col1, + ( + MIN( ALL - + col0 ) ) FROM tab1 cor0 GROUP BY col1, col1, col0
----
90
-22
90
-28
90
-82

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8034
SELECT + 90 col1, + ( + MIN ( ALL - + col0 ) ) FROM tab1 cor0 GROUP BY col1, col1, col0
----
90
-22
90
-28
90
-82

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col2, col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - 21, col0 + col1 * - - 1 AS col1 FROM tab0 GROUP BY col0, col1
----
-21
124
-21
26
-21
83

query I rowsort
SELECT + ( - col1 ) AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

onlyif mysql # aggregate syntax: 
query I rowsort label-8038
SELECT DISTINCT - + MIN( DISTINCT + + col0 ) col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( col0 ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8038
SELECT DISTINCT - + MIN ( DISTINCT + + col0 ) col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col1 HAVING + col2 IS NOT NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-8040
SELECT - col0 + - col0 + - 47 * - ( - 89 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - COUNT( * ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-8040
SELECT - col0 + - col0 + - 47 * - ( - 89 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - COUNT ( * ) <= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8041
SELECT DISTINCT - COUNT( * ) - - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

skipif mysql # not compatible
query I rowsort label-8041
SELECT DISTINCT - COUNT ( * ) - - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

query II rowsort
SELECT DISTINCT col0, col0 * - 63 AS col1 FROM tab1 GROUP BY col0
----
22
-1386
28
-1764
82
-5166

query II rowsort
SELECT col2 - + - col1, + col2 FROM tab2 GROUP BY col1, col2 HAVING NOT ( - col2 BETWEEN ( NULL ) AND NULL )
----

query I rowsort
SELECT ALL + 55 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING + - col1 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8045
SELECT + col2 * + ( - COUNT( col2 ) ) * + + col2 + 70 - - COUNT( * ) AS col1 FROM tab1 cor0 GROUP BY col2, col2
----
-1954
-4970
7

skipif mysql # not compatible
query I rowsort label-8045
SELECT + col2 * + ( - COUNT ( col2 ) ) * + + col2 + 70 - - COUNT ( * ) AS col1 FROM tab1 cor0 GROUP BY col2, col2
----
-1954
-4970
7

query I rowsort
SELECT DISTINCT - 90 * + 64 FROM tab1 GROUP BY col1
----
-5760

query I rowsort
SELECT DISTINCT ( col1 ) + col1 + + - 62 FROM tab0 GROUP BY col1
----
-62
100

onlyif mysql # aggregate syntax: 
query I rowsort label-8048
SELECT DISTINCT + COUNT( * ) col0 FROM tab0 GROUP BY col2 HAVING NULL = + + col0 + + 57
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8048
SELECT DISTINCT + COUNT ( * ) col0 FROM tab0 GROUP BY col2 HAVING NULL = + + col0 + + 57
----

query I rowsort
SELECT + ( - 20 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= - - 51
----

query I rowsort
SELECT ALL + 73 + - - 79 FROM tab2 AS cor0 GROUP BY col1
----
152
152
152

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8052
SELECT + 70 * CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT 14 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8052
SELECT + 70 * CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT 14 IS NULL
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8053
SELECT DISTINCT col1 - - 99 / + - CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8053
SELECT DISTINCT col1 - - 99 / + - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col1
----
NULL

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8055
SELECT DISTINCT NULLIF ( + SUM( - - 88 ), col0 * - col1 * + - 41 + - COUNT( * ) ), SUM( ALL + 1 ) AS col2 FROM tab1 GROUP BY col1, col0 HAVING ( NULL ) BETWEEN NULL AND - + col0 * - 76 - - - ( - + CAST( + + col1 AS SIGNED ) ) + + ( - ( + 89 ) ) * - col1
----

skipif mysql # not compatible
query II rowsort label-8055
SELECT DISTINCT NULLIF ( + SUM ( - - 88 ), col0 * - col1 * + - 41 + - COUNT ( * ) ), SUM ( ALL + 1 ) AS col2 FROM tab1 GROUP BY col1, col0 HAVING ( NULL ) BETWEEN NULL AND - + col0 * - 76 - - - ( - + CAST ( + + col1 AS INTEGER ) ) + + ( - ( + 89 ) ) * - col1
----

query I rowsort
SELECT + - ( - col2 ) / col1 * - col1 FROM tab2 WHERE + 13 NOT BETWEEN - + col2 * + 35 + + 89 * + - col2 + - 6 + 84 + - col1 * col1 - + + NULLIF ( + + 14, - col0 ) AND NULL GROUP BY col2, col2, col1 HAVING NOT + col2 + + - col1 IN ( ( - 52 ) )
----

query I rowsort
SELECT - ( - 93 ) FROM tab2 GROUP BY col2, col0
----
93
93
93

onlyif mysql # aggregate syntax: 
query I rowsort label-8058
SELECT - col0 + + SUM( DISTINCT + - col0 ) FROM tab0 GROUP BY col2, col0
----
-166
-52
-86

skipif mysql # not compatible
query I rowsort label-8058
SELECT - col0 + + SUM ( DISTINCT + - col0 ) FROM tab0 GROUP BY col2, col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT col1 * + col2 FROM tab2 GROUP BY col2, col1
----
2378
4661
5307

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8060
SELECT - 31 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT IN ( + CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-8060
SELECT - 31 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT IN ( + CAST ( NULL AS INTEGER ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8061
SELECT MIN( col2 ) AS col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-8061
SELECT MIN ( col2 ) AS col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

onlyif mysql # aggregate syntax: 
query I rowsort label-8062
SELECT ALL - COUNT( * ) * - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-8062
SELECT ALL - COUNT ( * ) * - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

onlyif mysql # aggregate syntax: 
query II rowsort label-8063
SELECT col0 AS col2, col1 + + COALESCE ( + 0, MIN( - + col1 ) ) FROM tab2 AS cor0 GROUP BY col1, col0
----
15
61
91
59
92
41

skipif mysql # not compatible
query II rowsort label-8063
SELECT col0 AS col2, col1 + + COALESCE ( + 0, MIN ( - + col1 ) ) FROM tab2 AS cor0 GROUP BY col1, col0
----
15
61
91
59
92
41

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 49 AS col2, + col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL ( + + 46 ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 35 * + col0 FROM tab2 GROUP BY col0
----
3185
3220
525

onlyif mysql # aggregate syntax: 
query I rowsort label-8067
SELECT ALL - 65 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - COUNT( * ) * 98 IS NULL
----
-65
-65

skipif mysql # not compatible
query I rowsort label-8067
SELECT ALL - 65 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - COUNT ( * ) * 98 IS NULL
----
-65
-65

onlyif mysql # aggregate syntax: 
query I rowsort label-8068
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING - MAX( DISTINCT + col0 ) IS NOT NULL
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8068
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING - MAX ( DISTINCT + col0 ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + - 70 FROM tab1 cor0 WHERE NOT - 77 - + ( + col2 ) IS NULL GROUP BY col2
----
-70
-70
-70

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8070
SELECT ALL + - 64 * - col2 DIV col2 + col2 + + + MAX( col2 ) + + col2 FROM tab0 AS cor0 GROUP BY col2
----
136
178
301

skipif mysql # not compatible
query I rowsort label-8070
SELECT ALL + - 64 * - col2 / col2 + col2 + + + MAX ( col2 ) + + col2 FROM tab0 AS cor0 GROUP BY col2
----
136
178
301

query I rowsort
SELECT - 41 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
-41
-41
-41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8072
SELECT ALL 10 / - CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

skipif mysql # not compatible
query I rowsort label-8072
SELECT ALL 10 / - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8073
SELECT col1 - - 47 + + COUNT( * ) FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8073
SELECT col1 - - 47 + + COUNT ( * ) FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-8074
SELECT ALL - col0 AS col2, - 22 DIV + - 41 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + SUM( ALL - - col2 ) IS NOT NULL
----
-15
0
-91
0
-92
0

skipif mysql # not compatible
query II rowsort label-8074
SELECT ALL - col0 AS col2, - 22 / + - 41 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + SUM ( ALL - - col2 ) IS NOT NULL
----
-15
0
-91
0
-92
0

onlyif mysql # aggregate syntax: 
query I rowsort label-8075
SELECT DISTINCT ( + col2 ) + 42 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING COUNT( * ) NOT BETWEEN + + ( + - col0 ) * - + AVG ( ALL - col1 ) + + col1 - - + col1 + - + col1 AND NULL
----

skipif mysql # not compatible
query I rowsort label-8075
SELECT DISTINCT ( + col2 ) + 42 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING COUNT ( * ) NOT BETWEEN + + ( + - col0 ) * - + AVG ( ALL - col1 ) + + col1 - - + col1 + - + col1 AND NULL
----

query I rowsort
SELECT DISTINCT - 55 AS col0 FROM tab2 GROUP BY col1
----
-55

query I rowsort
SELECT + 85 * + AVG ( - 58 ) / + col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8078
SELECT DISTINCT + MAX( ALL + col1 ) FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2 HAVING + - 94 IS NULL
----

skipif mysql # not compatible
query I rowsort label-8078
SELECT DISTINCT + MAX ( ALL + col1 ) FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2 HAVING + - 94 IS NULL
----

query I rowsort
SELECT ALL + - ( - - col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8081
SELECT ALL COUNT( * ) - col2 + + col2 AS col1, - COUNT( * ) AS col1 FROM tab2 GROUP BY col2
----
1
-1
1
-1
1
-1

skipif mysql # not compatible
query II rowsort label-8081
SELECT ALL COUNT ( * ) - col2 + + col2 AS col1, - COUNT ( * ) AS col1 FROM tab2 GROUP BY col2
----
1
-1
1
-1
1
-1

query I rowsort
SELECT 34 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
34
34
34

query I rowsort
SELECT ALL 63 FROM tab2 AS cor0 GROUP BY col1
----
63
63
63

query I rowsort
SELECT DISTINCT - 47 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-47

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col2 * + NULLIF ( - 0, - + col2 ) = - ( 56 )
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-8086
SELECT + 78 + - col2 AS col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT col2 <> + ( col1 ) + + MAX( - + col2 )
----

skipif mysql # not compatible
query I rowsort label-8086
SELECT + 78 + - col2 AS col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT col2 <> + ( col1 ) + + MAX ( - + col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8087
SELECT - col1 * + col2 * + COUNT( * ) col0 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-1944
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8087
SELECT - col1 * + col2 * + COUNT ( * ) col0 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-1944
0
0

query I rowsort
SELECT - col2 + col2 + + + col2 - - + col2 * - col2 FROM tab0 GROUP BY col2, col2
----
-1406
-552
-6162

onlyif mysql # aggregate syntax: 
query I rowsort label-8089
SELECT - COUNT( * ) + - - col2 FROM tab2 GROUP BY col2, col1
----
57
78
86

skipif mysql # not compatible
query I rowsort label-8089
SELECT - COUNT ( * ) + - - col2 FROM tab2 GROUP BY col2, col1
----
57
78
86

onlyif mysql # aggregate syntax: 
query I rowsort label-8090
SELECT ALL col2 * - 80 FROM tab2 WHERE ( col1 * - col2 ) IS NULL GROUP BY col2 HAVING - COUNT( * ) / + 0 * - 89 IS NULL
----

skipif mysql # not compatible
query I rowsort label-8090
SELECT ALL col2 * - 80 FROM tab2 WHERE ( col1 * - col2 ) IS NULL GROUP BY col2 HAVING - COUNT ( * ) / + 0 * - 89 IS NULL
----

query II rowsort
SELECT ALL - + 55, col1 FROM tab2 WHERE - - 72 BETWEEN NULL AND + 63 GROUP BY col1, col2, col0
----

query I rowsort
SELECT + 79 * col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 63 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8093
SELECT + + col1 AS col2 FROM tab2 cor0 WHERE NULL NOT BETWEEN + CAST( - + col2 AS SIGNED ) * col2 + - - 32 + col0 AND NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-8093
SELECT + + col1 AS col2 FROM tab2 cor0 WHERE NULL NOT BETWEEN + CAST ( - + col2 AS INTEGER ) * col2 + - - 32 + col0 AND NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8094
SELECT ALL COUNT( * ) FROM tab0 AS cor0 GROUP BY col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8094
SELECT ALL COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0, col1
----
1
1
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8095
SELECT ALL + COUNT( * ) * - 97 + - col0 AS col2, + CAST( NULL AS SIGNED ) + - ( + col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8095
SELECT ALL + COUNT ( * ) * - 97 + - col0 AS col2, + CAST ( NULL AS INTEGER ) + - ( + col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 14 AS col1 FROM tab1 GROUP BY col2
----
14
14
14

onlyif mysql # aggregate syntax: 
query I rowsort label-8097
SELECT 76 * - col0 + + 1 + + - col0 + + - col0 + 22 * + 31 + COUNT( * ) * + COUNT( * ) AS col1 FROM tab2 GROUP BY col0
----
-486
-6414
-6492

skipif mysql # not compatible
query I rowsort label-8097
SELECT 76 * - col0 + + 1 + + - col0 + + - col0 + 22 * + 31 + COUNT ( * ) * + COUNT ( * ) AS col1 FROM tab2 GROUP BY col0
----
-486
-6414
-6492

onlyif mysql # aggregate syntax: 
query I rowsort label-8098
SELECT DISTINCT - col1 * - - MAX( DISTINCT + - col1 ) + + + 62 AS col0 FROM tab2 GROUP BY col1 HAVING NOT - AVG ( ALL - col0 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8098
SELECT DISTINCT - col1 * - - MAX ( DISTINCT + - col1 ) + + + 62 AS col0 FROM tab2 GROUP BY col1 HAVING NOT - AVG ( ALL - col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - col1 ) AS col0 FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8100
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-8100
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL col1 * - ( + col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-6561
0

onlyif mysql # aggregate syntax: 
query I rowsort label-8102
SELECT - COUNT( * ) / + col2 - - col2 - + col2 * col2 * - - COUNT( * ) AS col1 FROM tab2 WHERE NOT col2 NOT BETWEEN NULL AND - col0 GROUP BY col2, col2 HAVING NOT col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8102
SELECT - COUNT ( * ) / + col2 - - col2 - + col2 * col2 * - - COUNT ( * ) AS col1 FROM tab2 WHERE NOT col2 NOT BETWEEN NULL AND - col0 GROUP BY col2, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

onlyif mysql # aggregate syntax: 
query I rowsort label-8104
SELECT ALL - + SUM( DISTINCT - ( + - col0 ) ) * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8104
SELECT ALL - + SUM ( DISTINCT - ( + - col0 ) ) * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 98 + - 45 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
53
53
53

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT( * ) END WHEN + - col1 * - col0 THEN - COUNT( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST( NULL AS SIGNED ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX ( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT ( * ) END WHEN + - col1 * - col0 THEN - COUNT ( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT ( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST ( NULL AS INTEGER ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8107
SELECT + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) = NULL
----

skipif mysql # not compatible
query I rowsort label-8107
SELECT + - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) = NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT - col2 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + col0 / - col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT + col1 * - col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
-531441
0

onlyif mysql # aggregate syntax: 
query I rowsort label-8112
SELECT DISTINCT + 65 * - - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= col2 / + 51
----

skipif mysql # not compatible
query I rowsort label-8112
SELECT DISTINCT + 65 * - - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= col2 / + 51
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8113
SELECT DISTINCT + 75 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8113
SELECT DISTINCT + 75 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8114
SELECT DISTINCT MIN( ALL - 81 ) + - col0 FROM tab0 GROUP BY col1, col0, col0
----
-107
-124
-164

skipif mysql # not compatible
query I rowsort label-8114
SELECT DISTINCT MIN ( ALL - 81 ) + - col0 FROM tab0 GROUP BY col1, col0, col0
----
-107
-124
-164

query I rowsort
SELECT - 69 * + col1 AS col0 FROM tab0 GROUP BY col1
----
-5589
0

query I rowsort
SELECT ALL + 22 + - 26 FROM tab2 GROUP BY col0, col2, col1
----
-4
-4
-4

onlyif mysql # aggregate syntax: 
query I rowsort label-8117
SELECT - COUNT( ALL - - 40 ) * + 5 FROM tab0 GROUP BY col1
----
-10
-5

skipif mysql # not compatible
query I rowsort label-8117
SELECT - COUNT ( ALL - - 40 ) * + 5 FROM tab0 GROUP BY col1
----
-10
-5

query I rowsort
SELECT ALL - 22 + + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-14
23
49

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 38 col0 FROM tab1 cor0 GROUP BY col0, col1
----
-38
-38
-38

query I rowsort
SELECT + 27 + + - 17 - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8121
SELECT COUNT( * ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + + 1 * - + col1 <= NULL
----

skipif mysql # not compatible
query I rowsort label-8121
SELECT COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + + 1 * - + col1 <= NULL
----

query I rowsort
SELECT ALL - col0 * - col0 + + col1 + + - 26 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
1904
650
6863

query I rowsort
SELECT + col2 + - 45 FROM tab2 GROUP BY col2, col2
----
13
34
42

onlyif mysql # aggregate syntax: 
query I rowsort label-8124
SELECT DISTINCT + COUNT( * ) AS col2 FROM tab0 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-8124
SELECT DISTINCT + COUNT ( * ) AS col2 FROM tab0 GROUP BY col0, col0
----
1

onlyif mysql # aggregate syntax: 
query I rowsort label-8125
SELECT ( - 25 ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING COUNT( * ) + + - ( - 79 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8125
SELECT ( - 25 ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING COUNT ( * ) + + - ( - 79 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8126
SELECT DISTINCT + col1 * - col1 DIV - col1 FROM tab1 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-8126
SELECT DISTINCT + col1 * - col1 / - col1 FROM tab1 GROUP BY col1
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-8127
SELECT ALL - COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8127
SELECT ALL - COUNT ( * ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT 51 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING + col1 BETWEEN - 69 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8129
SELECT DISTINCT + + COUNT( * ) FROM tab1 cor0 GROUP BY col2 HAVING NOT + 98 IS NULL
----
1

skipif mysql # not compatible
query I rowsort label-8129
SELECT DISTINCT + + COUNT ( * ) FROM tab1 cor0 GROUP BY col2 HAVING NOT + 98 IS NULL
----
1

query I rowsort
SELECT ALL 72 * - 23 FROM tab1 GROUP BY col1, col2, col2 HAVING NULL <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8131
SELECT col0 * + COUNT( col0 ) + - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

skipif mysql # not compatible
query I rowsort label-8131
SELECT col0 * + COUNT ( col0 ) + - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

onlyif mysql # aggregate syntax: 
query I rowsort label-8132
SELECT ALL - MAX( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8132
SELECT ALL - MAX ( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT ( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 22 * - col0 / - col2 AS col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT + col0 * col0 * col2 + 78 > NULL
----

query I rowsort
SELECT + - 25 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-25
-25
-25

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8135
SELECT + CAST( - - col1 AS SIGNED ) / SUM( DISTINCT + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8135
SELECT + CAST ( - - col1 AS INTEGER ) / SUM ( DISTINCT + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT 37 FROM tab2 AS cor0 WHERE col0 IS NULL GROUP BY col2, col1, col1, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8137
SELECT + 1 FROM tab1 AS cor0 GROUP BY col2 HAVING - ( - COUNT( * ) ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-8137
SELECT + 1 FROM tab1 AS cor0 GROUP BY col2 HAVING - ( - COUNT ( * ) ) <= NULL
----

query I rowsort
SELECT - - 78 / + ( + - col1 ) AS col2 FROM tab1 AS cor0 WHERE col0 <> NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 48 col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-48

query I rowsort
SELECT - ( - - 9 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
-9
-9
-9

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8141
SELECT ALL col1 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING + COUNT( * ) * - + 10 < CAST( + 89 AS SIGNED )
----
118
122
82

skipif mysql # not compatible
query I rowsort label-8141
SELECT ALL col1 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING + COUNT ( * ) * - + 10 < CAST ( + 89 AS INTEGER )
----
118
122
82

query I rowsort
SELECT ( + 60 ) FROM tab2 GROUP BY col0, col2
----
60
60
60

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8143
SELECT CAST( + 33 AS SIGNED ) - COUNT( * ), - col1 * 17 * - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8143
SELECT CAST ( + 33 AS INTEGER ) - COUNT ( * ), - col1 * 17 * - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8144
SELECT - COUNT( ALL - CAST( - 18 AS SIGNED ) ) AS col2 FROM tab0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-8144
SELECT - COUNT ( ALL - CAST ( - 18 AS INTEGER ) ) AS col2 FROM tab0 GROUP BY col1
----
-1
-2

onlyif mysql # aggregate syntax: 
query I rowsort label-8145
SELECT DISTINCT - + 24 FROM tab1 cor0 GROUP BY col1 HAVING ( ( NOT NULL >= - MIN( - 95 ) ) )
----

skipif mysql # not compatible
query I rowsort label-8145
SELECT DISTINCT - + 24 FROM tab1 cor0 GROUP BY col1 HAVING ( ( NOT NULL >= - MIN ( - 95 ) ) )
----

query I rowsort
SELECT DISTINCT - 63 FROM tab0 AS cor0 GROUP BY col1
----
-63

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8147
SELECT - 8 + CAST( NULL AS DECIMAL ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8147
SELECT - 8 + CAST ( NULL AS REAL ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 * 80 FROM tab2 WHERE NOT - + col1 / + 33 + col2 - 59 IS NULL GROUP BY col0, col2
----
1200
7280
7360

query I rowsort
SELECT ALL - col2 * + - col1 * - col0 FROM tab1 GROUP BY col1, col2, col0
----
-1056
-256168
-71820

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8150
SELECT ALL col0, col0 AS col2 FROM tab2 AS cor0 WHERE NOT - col0 NOT BETWEEN + col1 * - + 67 - + + CAST( NULL AS SIGNED ) AND col0 / - NULLIF ( - col2, 91 / + + 69 + + 39 * - 47 ) + + + 35 - + 80 GROUP BY col0
----

skipif mysql # not compatible
query II rowsort label-8150
SELECT ALL col0, col0 AS col2 FROM tab2 AS cor0 WHERE NOT - col0 NOT BETWEEN + col1 * - + 67 - + + CAST ( NULL AS INTEGER ) AND col0 / - NULLIF ( - col2, 91 / + + 69 + + 39 * - 47 ) + + + 35 - + 80 GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8151
SELECT + COUNT( * ) * - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

skipif mysql # not compatible
query I rowsort label-8151
SELECT + COUNT ( * ) * - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT - - 73 FROM tab1 cor0 GROUP BY col0
----
73
73
73

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8153
SELECT - + 70 * + CAST( NULL AS SIGNED ) + - col0 + COUNT( - col2 ) * + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8153
SELECT - + 70 * + CAST ( NULL AS INTEGER ) + - col0 + COUNT ( - col2 ) * + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT + 63 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

onlyif mysql # aggregate syntax: 
query I rowsort label-8156
SELECT COUNT( * ) + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8156
SELECT COUNT ( * ) + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * + + col1 + + 93 FROM tab2 WHERE NOT + 93 * - col2 - + 29 * + col2 * + 34 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col1 + - - col1 FROM tab2 GROUP BY col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - ( 95 ) col2 FROM tab2 GROUP BY col0
----
-95

query II rowsort
SELECT DISTINCT - col1 AS col2, 66 * + + col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
2706
-59
3894
-61
4026

query I rowsort
SELECT ALL + 75 FROM tab1 GROUP BY col1
----
75
75
75

onlyif mysql # aggregate syntax: 
query I rowsort label-8162
SELECT DISTINCT COUNT( * ) * col2 + + 0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-8162
SELECT DISTINCT COUNT ( * ) * col2 + + 0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + 43 col1 FROM tab0 AS cor0 GROUP BY col0
----
-1118
-1849
-3569

onlyif mysql # DIV for integer division: 
query I rowsort label-8164
SELECT DISTINCT col0 DIV + + 2 + + col0 + 51 * + + col0 + - 96 FROM tab1 AS cor0 GROUP BY col0
----
1059
1374
4209

skipif mysql # not compatible
query I rowsort label-8164
SELECT DISTINCT col0 / + + 2 + + col0 + 51 * + + col0 + - 96 FROM tab1 AS cor0 GROUP BY col0
----
1059
1374
4209

query II rowsort
SELECT 92, col1 FROM tab2 GROUP BY col1
----
92
41
92
59
92
61

onlyif mysql # aggregate syntax: 
query II rowsort label-8166
SELECT COUNT( * ) AS col2, + 37 AS col1 FROM tab0 GROUP BY col0
----
1
37
1
37
1
37

skipif mysql # not compatible
query II rowsort label-8166
SELECT COUNT ( * ) AS col2, + 37 AS col1 FROM tab0 GROUP BY col0
----
1
37
1
37
1
37

query I rowsort
SELECT ALL - 99 FROM tab0 AS cor0 GROUP BY col0, col0
----
-99
-99
-99

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col2, col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + 22 FROM tab0 GROUP BY col2
----
22

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 47 col2 FROM tab1 GROUP BY col2, col1 HAVING col1 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8171
SELECT NULLIF ( + 57, COUNT( * ) * + col2 ) * 99 + + 38 * - 77 FROM tab2 WHERE NOT col0 * 17 BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8171
SELECT NULLIF ( + 57, COUNT ( * ) * + col2 ) * 99 + + 38 * - 77 FROM tab2 WHERE NOT col0 * 17 BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT 55 * - col2 FROM tab1 GROUP BY col2, col0
----
-2475
-3905
-440

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NULL < - 20 GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab0 WHERE - 73 * + col1 BETWEEN + col0 AND 75 * - col0 GROUP BY col2, col1
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 WHERE NOT - col2 NOT BETWEEN col0 AND + 95 + - 29 * col2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * - col0 col2 FROM tab1 GROUP BY col1, col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT 42 + - 87 AS col1 FROM tab1 GROUP BY col2, col2
----
-45
-45
-45

query I rowsort
SELECT col0 - + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT DISTINCT + 67 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
67

query I rowsort
SELECT DISTINCT - col0 * - col0 + + col0 FROM tab0 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT + 37 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL >= col0
----

query I rowsort
SELECT - ( - col2 ) AS col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col2 + 98 FROM tab1 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 4 AS col0 FROM tab1 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col1
----
4
4
4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8185
SELECT ALL 0 * + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8185
SELECT ALL 0 * + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 2 FROM tab1 AS cor0 GROUP BY col0, col2
----
2

query I rowsort
SELECT + 52 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
52
52
52

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8188
SELECT ALL + col0 * col0 + 78 DIV + ( COUNT( * ) * 34 ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1851
678
6891

skipif mysql # not compatible
query I rowsort label-8188
SELECT ALL + col0 * col0 + 78 / + ( COUNT ( * ) * 34 ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1851
678
6891

onlyif mysql # aggregate syntax: 
query I rowsort label-8189
SELECT COUNT( * ) FROM tab2 AS cor0 WHERE NOT ( + col1 ) IS NULL GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8189
SELECT COUNT ( * ) FROM tab2 AS cor0 WHERE NOT ( + col1 ) IS NULL GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN - col2 AND NULL
----

query I rowsort
SELECT + - col0 + + col0 * col0 FROM tab2 cor0 GROUP BY col0
----
210
8190
8372

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) <= ( 2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8193
SELECT MIN( ALL + col0 ) * + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( - ( - col0 ) ) IN ( 75 * 0 )
----
484
6724
784

skipif mysql # not compatible
query I rowsort label-8193
SELECT MIN ( ALL + col0 ) * + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT ( - ( - col0 ) ) IN ( 75 * 0 )
----
484
6724
784

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8194
SELECT ALL + col2 FROM tab2 GROUP BY col2, col2 HAVING + CAST( NULL AS DECIMAL ) IS NULL
----
58
79
87

skipif mysql # not compatible
query I rowsort label-8194
SELECT ALL + col2 FROM tab2 GROUP BY col2, col2 HAVING + CAST ( NULL AS REAL ) IS NULL
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-8195
SELECT 52 * col1 + - col0 FROM tab2 GROUP BY col1, col0 HAVING MAX( ALL - 65 ) >= ( col0 )
----

skipif mysql # not compatible
query I rowsort label-8195
SELECT 52 * col1 + - col0 FROM tab2 GROUP BY col1, col0 HAVING MAX ( ALL - 65 ) >= ( col0 )
----

query I rowsort
SELECT ALL - 79 * + col2 AS col1 FROM tab2 GROUP BY col0, col2
----
-4582
-6241
-6873

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col0 HAVING NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8198
SELECT - 54 DIV + - ( - 14 ) + col2 FROM tab1 GROUP BY col2, col0
----
42
5
68

skipif mysql # not compatible
query I rowsort label-8198
SELECT - 54 / + - ( - 14 ) + col2 FROM tab1 GROUP BY col2, col0
----
42
5
68

onlyif mysql # aggregate syntax: 
query I rowsort label-8199
SELECT + 96 * 48 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL BETWEEN COUNT( * ) AND 66 / 81
----

skipif mysql # not compatible
query I rowsort label-8199
SELECT + 96 * 48 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL BETWEEN COUNT ( * ) AND 66 / 81
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8200
SELECT col0 * - + col2 col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN - COUNT( * ) AND ( - COUNT( * ) / - 11 + COUNT( - col0 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8200
SELECT col0 * - + col2 col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN - COUNT ( * ) AND ( - COUNT ( * ) / - 11 + COUNT ( - col0 ) )
----

query I rowsort
SELECT ALL 51 + col0 FROM tab0 AS cor0 WHERE col1 * + 31 < ( - col2 ) GROUP BY col2, col0 HAVING NULL IN ( - col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8202
SELECT DISTINCT + COUNT( * ) * + col2 / col2 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - 79 / - col1 + 25 ) >= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8202
SELECT DISTINCT + COUNT ( * ) * + col2 / col2 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - 79 / - col1 + 25 ) >= ( NULL )
----

query I rowsort
SELECT - ( + col0 ) * col0 AS col0 FROM tab2 AS cor0 WHERE col1 * - COALESCE ( + 55, 0 ) IS NULL GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8204
SELECT DISTINCT + 85 AS col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING - COUNT( * ) IS NOT NULL
----
85

skipif mysql # not compatible
query I rowsort label-8204
SELECT DISTINCT + 85 AS col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING - COUNT ( * ) IS NOT NULL
----
85

onlyif mysql # aggregate syntax: 
query I rowsort label-8205
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + SUM( col2 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8205
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + SUM ( col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 WHERE NULL < NULL GROUP BY col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8207
SELECT + col0 * + 86 + + - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NOT ( - COUNT( * ) ) IS NULL
----
1229
7767
7871

skipif mysql # not compatible
query I rowsort label-8207
SELECT + col0 * + 86 + + - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NOT ( - COUNT ( * ) ) IS NULL
----
1229
7767
7871

query I rowsort
SELECT col0 + ( 94 ) FROM tab1 AS cor0 WHERE + - 91 IS NULL OR NOT NULL NOT IN ( + 0 ) GROUP BY col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8209
SELECT - 78 * - col0 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT COUNT( * ) IS NULL
----
1155
7007
7084

skipif mysql # not compatible
query I rowsort label-8209
SELECT - 78 * - col0 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT COUNT ( * ) IS NULL
----
1155
7007
7084

query I rowsort
SELECT ALL + ( + + col2 ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8211
SELECT DISTINCT COALESCE ( 28, + + CAST( NULL AS SIGNED ), 37 + + col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8211
SELECT DISTINCT COALESCE ( 28, + + CAST ( NULL AS INTEGER ), 37 + + col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT 8 <> ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8213
SELECT ALL COUNT( * ) * - ( + 12 ) + - + 56 AS col2 FROM tab1 GROUP BY col1
----
-68
-68
-68

skipif mysql # not compatible
query I rowsort label-8213
SELECT ALL COUNT ( * ) * - ( + 12 ) + - + 56 AS col2 FROM tab1 GROUP BY col1
----
-68
-68
-68

onlyif mysql # aggregate syntax: 
query I rowsort label-8214
SELECT 79 + + + ( + - MIN( ALL 92 ) ) - + col0 * + CASE 48 WHEN - 52 THEN NULL WHEN CASE ( + 69 ) WHEN - NULLIF ( 69, 39 + + COUNT( * ) ) / 94 THEN + COUNT( * ) END THEN NULL ELSE 79 - 72 END AS col1 FROM tab1 GROUP BY col0
----
-167
-209
-587

skipif mysql # not compatible
query I rowsort label-8214
SELECT 79 + + + ( + - MIN ( ALL 92 ) ) - + col0 * + CASE 48 WHEN - 52 THEN NULL WHEN CASE ( + 69 ) WHEN - NULLIF ( 69, 39 + + COUNT ( * ) ) / 94 THEN + COUNT ( * ) END THEN NULL ELSE 79 - 72 END AS col1 FROM tab1 GROUP BY col0
----
-167
-209
-587

onlyif mysql # aggregate syntax: 
query I rowsort label-8215
SELECT 91 AS col0 FROM tab2 WHERE NOT + - col0 IS NOT NULL GROUP BY col0, col0 HAVING COUNT( - col0 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8215
SELECT 91 AS col0 FROM tab2 WHERE NOT + - col0 IS NOT NULL GROUP BY col0, col0 HAVING COUNT ( - col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE NOT col1 BETWEEN - - col1 AND col2 + 45 GROUP BY col0
----

query I rowsort
SELECT DISTINCT 93 AS col1 FROM tab0 GROUP BY col2
----
93

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8218
SELECT DISTINCT - CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( + col2 ) NOT BETWEEN 35 + COUNT( * ) AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-8218
SELECT DISTINCT - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( + col2 ) NOT BETWEEN 35 + COUNT ( * ) AND ( NULL )
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8219
SELECT ALL col2 DIV col2 + - COUNT( * ) + + col2 * 7 FROM tab1 AS cor0 GROUP BY col2
----
315
497
56

skipif mysql # not compatible
query I rowsort label-8219
SELECT ALL col2 / col2 + - COUNT ( * ) + + col2 * 7 FROM tab1 AS cor0 GROUP BY col2
----
315
497
56

query I rowsort
SELECT DISTINCT 90 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - - col0 IS NOT NULL
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-8222
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = MAX( DISTINCT col0 ) * + 94
----

skipif mysql # not compatible
query I rowsort label-8222
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = MAX ( DISTINCT col0 ) * + 94
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8223
SELECT COUNT( * ) AS col0 FROM tab2 AS cor0 WHERE - 86 IN ( + + 25, + col1 ) GROUP BY col2 HAVING NOT ( 79 ) IN ( AVG ( 56 ) )
----

skipif mysql # not compatible
query I rowsort label-8223
SELECT COUNT ( * ) AS col0 FROM tab2 AS cor0 WHERE - 86 IN ( + + 25, + col1 ) GROUP BY col2 HAVING NOT ( 79 ) IN ( AVG ( 56 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8224
SELECT ALL + col0 * + COUNT( * ) FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-8224
SELECT ALL + col0 * + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col1 + - 79 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-160
-79
-79

onlyif mysql # aggregate syntax: 
query I rowsort label-8226
SELECT - 8 FROM tab1 AS cor0 WHERE ( NULL ) > NULL GROUP BY col0 HAVING NOT - COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8226
SELECT - 8 FROM tab1 AS cor0 WHERE ( NULL ) > NULL GROUP BY col0 HAVING NOT - COUNT ( * ) IS NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8228
SELECT ALL + COUNT( * ) + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST( + ( - 88 ) AS SIGNED ) * + COUNT( * ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-8228
SELECT ALL + COUNT ( * ) + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST ( + ( - 88 ) AS INTEGER ) * + COUNT ( * ) >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8229
SELECT DISTINCT COALESCE ( 33, col1 ) AS col0 FROM tab1 WHERE NOT ( NOT ( NOT - + col0 + CAST( NULL AS SIGNED ) IS NULL ) ) GROUP BY col1, col0
----

skipif mysql # not compatible
query I rowsort label-8229
SELECT DISTINCT COALESCE ( 33, col1 ) AS col0 FROM tab1 WHERE NOT ( NOT ( NOT - + col0 + CAST ( NULL AS INTEGER ) IS NULL ) ) GROUP BY col1, col0
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8230
SELECT COUNT( * ) AS col0, - col2 FROM tab2 GROUP BY col2 HAVING NOT + 47 IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8230
SELECT COUNT ( * ) AS col0, - col2 FROM tab2 GROUP BY col2 HAVING NOT + 47 IS NOT NULL
----

query I rowsort
SELECT + ( + + 97 ) + - - ( - 19 ) FROM tab2 GROUP BY col0
----
78
78
78

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8232
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT + COUNT( * ) + COALESCE ( - - 44, CAST( + col2 AS SIGNED ), + MAX( 84 ) / + COUNT( * ) ) BETWEEN ( NULL ) AND + COUNT( * )
----
58
79
87

skipif mysql # not compatible
query I rowsort label-8232
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT + COUNT ( * ) + COALESCE ( - - 44, CAST ( + col2 AS INTEGER ), + MAX ( 84 ) / + COUNT ( * ) ) BETWEEN ( NULL ) AND + COUNT ( * )
----
58
79
87

query I rowsort
SELECT DISTINCT - 91 * - 96 FROM tab0 GROUP BY col0, col0
----
8736

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8234
SELECT ALL - + col1 - col1 DIV COUNT( * ) - - 46 * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
3564

skipif mysql # not compatible
query I rowsort label-8234
SELECT ALL - + col1 - col1 / COUNT ( * ) - - 46 * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
3564

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8235
SELECT DISTINCT 32 DIV + COUNT( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
32

skipif mysql # not compatible
query I rowsort label-8235
SELECT DISTINCT 32 / + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1, col1
----
32

query I rowsort
SELECT DISTINCT - col2 * + 30 + + + 1 + + col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING - col2 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8237
SELECT COUNT( * ) FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8237
SELECT COUNT ( * ) FROM tab0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8239
SELECT 51 + - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT - + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8239
SELECT 51 + - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT - + COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT 57 - - col2, 45 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( 81 ) IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8242
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - COALESCE ( + 59, + ( SUM( DISTINCT + 70 ) ) ) * + 69 >= COUNT( * )
----
24
38
79

skipif mysql # not compatible
query I rowsort label-8242
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - COALESCE ( + 59, + ( SUM ( DISTINCT + 70 ) ) ) * + 69 >= COUNT ( * )
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + ( + col1 ) IS NOT NULL
----

query I rowsort
SELECT 34 + + 57 AS col1 FROM tab0 GROUP BY col0
----
91
91
91

query I rowsort
SELECT + col1 * col1 AS col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL - 93 FROM tab2 AS cor0 GROUP BY col1
----
-93
-93
-93

onlyif mysql # aggregate syntax: 
query I rowsort label-8247
SELECT MAX( DISTINCT + - col2 ) col0 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8247
SELECT MAX ( DISTINCT + - col2 ) col0 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT - 64 FROM tab1 AS cor0 GROUP BY col1
----
-64
-64
-64

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST( NULL AS SIGNED ) ), + col1 + col0 * - 14 * + CAST( + COUNT( * ) AS SIGNED ) ) + + - MIN( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST ( NULL AS INTEGER ) ), + col1 + col0 * - 14 * + CAST ( + COUNT ( * ) AS INTEGER ) ) + + - MIN ( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

query I rowsort
SELECT + - ( - + col1 ) + + + 0 * - col1 * - 16 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT 67 + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
108
126
128

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8252
SELECT + ( + CAST( NULL AS SIGNED ) ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8252
SELECT + ( + CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT 25 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8255
SELECT + SUM( col2 ) * col2 FROM tab2 GROUP BY col1, col2
----
3364
6241
7569

skipif mysql # not compatible
query I rowsort label-8255
SELECT + SUM ( col2 ) * col2 FROM tab2 GROUP BY col1, col2
----
3364
6241
7569

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col2, col0, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 / - col2 * col2 col1 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8258
SELECT + NULLIF ( - ( CAST( NULL AS SIGNED ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8258
SELECT + NULLIF ( - ( CAST ( NULL AS INTEGER ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT 22 FROM tab0 GROUP BY col2
----
22
22
22

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN + 96 AND NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8261
SELECT 95, 67 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - COUNT( * ) + - 96 IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8261
SELECT 95, 67 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - COUNT ( * ) + - 96 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8262
SELECT ALL + CAST( NULL AS SIGNED ) + - + 61 - - CAST( NULL AS SIGNED ) * 80 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8262
SELECT ALL + CAST ( NULL AS INTEGER ) + - + 61 - - CAST ( NULL AS INTEGER ) * 80 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 96 AS col0 FROM tab0 GROUP BY col2
----
96
96
96

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8264
SELECT ALL - col1 * - MIN( DISTINCT + + 15 ) * col1 / - 75 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - - col0 NOT IN ( + CAST( - - CAST( - 53 AS SIGNED ) AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-8264
SELECT ALL - col1 * - MIN ( DISTINCT + + 15 ) * col1 / - 75 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - - col0 NOT IN ( + CAST ( - - CAST ( - 53 AS INTEGER ) AS INTEGER ) )
----

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-8265
SELECT - ( + COUNT( * ) ) FROM tab0 GROUP BY col0 HAVING - + col0 * + + col0 NOT BETWEEN NULL AND + + CAST( + - ( 55 ) AS DECIMAL )
----

skipif mysql # not compatible
query I rowsort label-8265
SELECT - ( + COUNT ( * ) ) FROM tab0 GROUP BY col0 HAVING - + col0 * + + col0 NOT BETWEEN NULL AND + + CAST ( + - ( 55 ) AS REAL )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8266
SELECT ALL - + COALESCE ( - + COUNT( CAST( - ( + + 77 ) AS SIGNED ) ), + col2 ) * col2 FROM tab0 WHERE 68 IS NULL GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8266
SELECT ALL - + COALESCE ( - + COUNT ( CAST ( - ( + + 77 ) AS INTEGER ) ), + col2 ) * col2 FROM tab0 WHERE 68 IS NULL GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8267
SELECT ALL 58 + 81 - col2 DIV + col2 + - + ( col2 ) col0 FROM tab2 cor0 GROUP BY col2
----
51
59
80

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8267
SELECT ALL 58 + 81 - col2 / + col2 + - + ( col2 ) col0 FROM tab2 cor0 GROUP BY col2
----
51
59
80

query I rowsort
SELECT + ( col1 ) * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

onlyif mysql # DIV for integer division: 
query I rowsort label-8269
SELECT DISTINCT - col1 + - col0 + + 97 DIV 94 FROM tab2 GROUP BY col0, col1
----
-132
-149
-75

skipif mysql # not compatible
query I rowsort label-8269
SELECT DISTINCT - col1 + - col0 + + 97 / 94 FROM tab2 GROUP BY col0, col1
----
-132
-149
-75

query I rowsort
SELECT ALL 32 FROM tab1 GROUP BY col0, col1
----
32
32
32

query I rowsort
SELECT + ( - + col2 ) FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT + 91 + - col1 + + - col1 * col1 AS col1 FROM tab1 AS cor0 WHERE col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT 15 AS col0 FROM tab0 GROUP BY col2, col2
----
15
15
15

query I rowsort
SELECT ALL + ( col2 ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT - + 91 <= + - col2
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8276
SELECT 50 * - col0 * + ( + col0 ) col0 FROM tab1 GROUP BY col0, col0 HAVING + - ( + 36 ) * - col0 + + CAST( col0 AS SIGNED ) - - MIN( ALL - - col1 ) = ( - 98 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8276
SELECT 50 * - col0 * + ( + col0 ) col0 FROM tab1 GROUP BY col0, col0 HAVING + - ( + 36 ) * - col0 + + CAST ( col0 AS INTEGER ) - - MIN ( ALL - - col1 ) = ( - 98 )
----

query I rowsort
SELECT ALL - + 82 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= - - col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8278
SELECT DISTINCT - ( - - col1 ) DIV - col1 FROM tab2 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-8278
SELECT DISTINCT - ( - - col1 ) / - col1 FROM tab2 AS cor0 GROUP BY col1
----
1

query I rowsort
SELECT ALL col2 * ( - - col2 ) + - col2 * col2 FROM tab2 GROUP BY col2 HAVING 42 IS NULL
----

query I rowsort
SELECT + - 61 FROM tab2 AS cor0 GROUP BY col1
----
-61
-61
-61

query I rowsort
SELECT - col1 * col1 + + - col1 FROM tab2 GROUP BY col1
----
-1722
-3540
-3782

query II rowsort
SELECT 59 AS col2, col2 * col2 FROM tab2 GROUP BY col2, col1 HAVING NOT ( NOT - + 46 IS NOT NULL )
----
59
3364
59
6241
59
7569

query I rowsort
SELECT - col1 + + 61 FROM tab1 GROUP BY col1, col1
----
17
4
55

query I rowsort
SELECT - ( + col2 ) FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8285
SELECT ALL - col1 AS col0, 86 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + COUNT( * ) >= - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query II rowsort label-8285
SELECT ALL - col1 AS col0, 86 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + COUNT ( * ) >= - CAST ( NULL AS INTEGER )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8286
SELECT - COUNT( * ) AS col1 FROM tab0 AS cor0 WHERE ( 35 * + col1 / - + 73 + - + ( - ( - + ( - col0 ) ) ) IS NOT NULL ) GROUP BY col2, col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8286
SELECT - COUNT ( * ) AS col1 FROM tab0 AS cor0 WHERE ( 35 * + col1 / - + 73 + - + ( - ( - + ( - col0 ) ) ) IS NOT NULL ) GROUP BY col2, col2, col2
----
-1
-1
-1

query I rowsort
SELECT ALL 30 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
30
30
30

onlyif mysql # aggregate syntax: 
query II rowsort label-8288
SELECT ALL col0 - - col0 AS col2, col0 + ( + col0 ) col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL NOT BETWEEN + COUNT( * ) * col1 AND + ( + - col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8288
SELECT ALL col0 - - col0 AS col2, col0 + ( + col0 ) col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL NOT BETWEEN + COUNT ( * ) * col1 AND + ( + - col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8289
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + CAST( col2 AS SIGNED ) BETWEEN NULL AND + 58 + + col2
----

skipif mysql # not compatible
query I rowsort label-8289
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + CAST ( col2 AS INTEGER ) BETWEEN NULL AND + 58 + + col2
----

query I rowsort
SELECT col0 * + 99 FROM tab1 GROUP BY col2, col0
----
2178
2772
8118

onlyif mysql # aggregate syntax: 
query I rowsort label-8291
SELECT + MAX( - col0 ) * - col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

skipif mysql # not compatible
query I rowsort label-8291
SELECT + MAX ( - col0 ) * - col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + 1 FROM tab0 GROUP BY col0
----
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8293
SELECT DISTINCT - CAST( + + 40 AS SIGNED ), COUNT( * ) AS col1 FROM tab2 GROUP BY col2
----
-40
1

skipif mysql # not compatible
query II rowsort label-8293
SELECT DISTINCT - CAST ( + + 40 AS INTEGER ), COUNT ( * ) AS col1 FROM tab2 GROUP BY col2
----
-40
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8294
SELECT + CAST( - + MIN( NULLIF ( + - 48, col2 ) ) AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - + 44 + + col0 / - + col0 IS NULL
----
48
48
48

skipif mysql # not compatible
query I rowsort label-8294
SELECT + CAST ( - + MIN ( NULLIF ( + - 48, col2 ) ) AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - + 44 + + col0 / - + col0 IS NULL
----
48
48
48

query I rowsort
SELECT DISTINCT 62 FROM tab1 AS cor0 GROUP BY col0
----
62

onlyif mysql # aggregate syntax: 
query II rowsort label-8296
SELECT + COUNT( DISTINCT + + col0 ) AS col1, col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + COUNT( - col1 ) + + + SUM( DISTINCT - 33 ) + - COUNT( * ) * - + 56 * ( col0 ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8296
SELECT + COUNT ( DISTINCT + + col0 ) AS col1, col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + COUNT ( - col1 ) + + + SUM ( DISTINCT - 33 ) + - COUNT ( * ) * - + 56 * ( col0 ) IS NOT NULL
----

query I rowsort
SELECT - ( 35 ) FROM tab1 GROUP BY col0
----
-35
-35
-35

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8298
SELECT ALL - COUNT( * ) * + col2 DIV + COALESCE ( - - 33, col0 ) AS col1 FROM tab2 GROUP BY col0, col2
----
-1
-2
-2

skipif mysql # not compatible
query I rowsort label-8298
SELECT ALL - COUNT ( * ) * + col2 / + COALESCE ( - - 33, col0 ) AS col1 FROM tab2 GROUP BY col0, col2
----
-1
-2
-2

query I rowsort
SELECT ALL 58 / col1 - col1 * col1 * - col1 * + col1 / col1 - - col1 * - 98 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query II rowsort
SELECT ALL 15 * - + col1 * - + col1 AS col0, col1 FROM tab0 GROUP BY col1 HAVING - 26 IS NULL
----

query I rowsort
SELECT - - ( + - 48 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-48
-48
-48

onlyif mysql # aggregate syntax: 
query I rowsort label-8302
SELECT + COALESCE ( + 63, - ( - + COUNT( * ) ) ) FROM tab1 cor0 GROUP BY col1, col2
----
63
63
63

skipif mysql # not compatible
query I rowsort label-8302
SELECT + COALESCE ( + 63, - ( - + COUNT ( * ) ) ) FROM tab1 cor0 GROUP BY col1, col2
----
63
63
63

query I rowsort
SELECT ALL - 63 FROM tab0 GROUP BY col2
----
-63
-63
-63

query I rowsort
SELECT DISTINCT col0 - + - 47 + - - 80 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
149
155
209

query I rowsort
SELECT DISTINCT + 92 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
92

onlyif mysql # aggregate syntax: 
query I rowsort label-8306
SELECT DISTINCT 26 + - ( + COUNT( - 39 ) ) + - + ( + - 29 ) AS col1 FROM tab0 GROUP BY col2
----
54

skipif mysql # not compatible
query I rowsort label-8306
SELECT DISTINCT 26 + - ( + COUNT ( - 39 ) ) + - + ( + - 29 ) AS col1 FROM tab0 GROUP BY col2
----
54

onlyif mysql # DIV for integer division: 
query I rowsort label-8307
SELECT ALL + col2 DIV + col2 FROM tab1 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8307
SELECT ALL + col2 / + col2 FROM tab1 GROUP BY col2
----
1
1
1

onlyif mysql # aggregate syntax: 
query II rowsort label-8308
SELECT DISTINCT - + COUNT( col0 ) + col0 AS col2, + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-8308
SELECT DISTINCT - + COUNT ( col0 ) + col0 AS col2, + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT ALL + + col2 AS col1, col2 FROM tab0 cor0 GROUP BY col2
----
24
24
38
38
79
79

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8310
SELECT + - CAST( NULL AS SIGNED ) + - col2 + - - SUM( ALL - + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8310
SELECT + - CAST ( NULL AS INTEGER ) + - col2 + - - SUM ( ALL - + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col2 * - + 83 FROM tab2 AS cor0 GROUP BY col2
----
4814
6557
7221

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 WHERE NOT 41 + + col0 IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL + 60 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-19
22
36

onlyif mysql # aggregate syntax: 
query I rowsort label-8314
SELECT SUM( col1 ) * col1 FROM tab2 GROUP BY col1, col2 HAVING ( - MAX( ALL - col0 ) / col1 >= 76 )
----

skipif mysql # not compatible
query I rowsort label-8314
SELECT SUM ( col1 ) * col1 FROM tab2 GROUP BY col1, col2 HAVING ( - MAX ( ALL - col0 ) / col1 >= 76 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8315
SELECT DISTINCT MAX( ALL - col0 ) FROM tab1 GROUP BY col0, col2, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-8315
SELECT DISTINCT MAX ( ALL - col0 ) FROM tab1 GROUP BY col0, col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - 60 + - ( col0 ) AS col2 FROM tab0 GROUP BY col0, col2
----
-103
-143
-86

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST( + COUNT( * ) AS DECIMAL ) * - col2 >= - - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM ( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST ( + COUNT ( * ) AS REAL ) * - col2 >= - - CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - + col1 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL >= + - col0
----

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - ( 60 ) / col0 + - - 16 * - col0 FROM tab2 AS cor0 WHERE col1 IS NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query II rowsort
SELECT ALL + col2 * 13 + - col2, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
288
24
456
38
948
79

onlyif mysql # aggregate syntax: 
query I rowsort label-8323
SELECT DISTINCT + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + + COUNT( * ) >= col2 * + 8
----
58
79
87

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8323
SELECT DISTINCT + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + + COUNT ( * ) >= col2 * + 8
----
58
79
87

onlyif mysql # aggregate syntax: 
query I rowsort label-8324
SELECT + 60 / - + 22 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND + COUNT( * ) + - - 86 + + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-8324
SELECT + 60 / - + 22 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND + COUNT ( * ) + - - 86 + + COUNT ( * )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8325
SELECT DISTINCT + ( CAST( NULL AS SIGNED ) ) + - col2 * - ( + col2 ) / + 95 + + col2 * + - COUNT( * ) AS col1 FROM tab2 GROUP BY col2 HAVING - 69 BETWEEN - + 26 AND NULL
----

skipif mysql # not compatible
query I rowsort label-8325
SELECT DISTINCT + ( CAST ( NULL AS INTEGER ) ) + - col2 * - ( + col2 ) / + 95 + + col2 * + - COUNT ( * ) AS col1 FROM tab2 GROUP BY col2 HAVING - 69 BETWEEN - + 26 AND NULL
----

query I rowsort
SELECT 26 * col2 * + - col2 FROM tab0 GROUP BY col2
----
-14976
-162266
-37544

query II rowsort
SELECT DISTINCT col0 + + col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
182
91
184
92
30
15

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8328
SELECT ALL + CAST( NULL AS SIGNED ) + - ( col0 ) FROM tab1 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8328
SELECT ALL + CAST ( NULL AS INTEGER ) + - ( col0 ) FROM tab1 GROUP BY col0, col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8329
SELECT DISTINCT + - CAST( NULL AS SIGNED ) / MAX( - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8329
SELECT DISTINCT + - CAST ( NULL AS INTEGER ) / MAX ( - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

query I rowsort
SELECT DISTINCT + col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT 97 FROM tab1 GROUP BY col1
----
97

query I rowsort
SELECT ALL col0 * + + col0 AS col2 FROM tab0 GROUP BY col1, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT 5 FROM tab0 GROUP BY col1
----
5

onlyif mysql # aggregate syntax: 
query I rowsort label-8334
SELECT ALL + col1 * - - MAX( + 82 ) FROM tab1 GROUP BY col2, col1
----
3608
4674
492

skipif mysql # not compatible
query I rowsort label-8334
SELECT ALL + col1 * - - MAX ( + 82 ) FROM tab1 GROUP BY col2, col1
----
3608
4674
492

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-44
-57
-6

onlyif mysql # aggregate syntax: 
query I rowsort label-8336
SELECT - COUNT( DISTINCT - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8336
SELECT - COUNT ( DISTINCT - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8337
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - CAST( NULL AS DECIMAL ) IS NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-8337
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - CAST ( NULL AS REAL ) IS NULL
----
15
91
92

onlyif mysql # aggregate syntax: 
query II rowsort label-8338
SELECT + col2 AS col1, 16 * - MAX( ALL - col2 ) * + + col2 * + - ( - - 16 ) AS col1 FROM tab2 WHERE NOT + CASE - col1 WHEN - ( + 14 ) THEN + 99 END IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) = - 22 + + col2
----

skipif mysql # not compatible
query II rowsort label-8338
SELECT + col2 AS col1, 16 * - MAX ( ALL - col2 ) * + + col2 * + - ( - - 16 ) AS col1 FROM tab2 WHERE NOT + CASE - col1 WHEN - ( + 14 ) THEN + 99 END IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) = - 22 + + col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col2 + - 33 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL <> - col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8340
SELECT MAX( 60 ) * + SUM( - + col1 ) + - col1 + + COUNT( * ) AS col0 FROM tab0 GROUP BY col1
----
-4940
2

skipif mysql # not compatible
query I rowsort label-8340
SELECT MAX ( 60 ) * + SUM ( - + col1 ) + - col1 + + COUNT ( * ) AS col0 FROM tab0 GROUP BY col1
----
-4940
2

query I rowsort
SELECT - 84 * - - col0 * - - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-155316
-56784
-578676

query I rowsort
SELECT col2 * + col2 * - ( col2 ) FROM tab0 AS cor0 GROUP BY col2, col2
----
-13824
-493039
-54872

query I rowsort
SELECT 42 AS col1 FROM tab2 GROUP BY col0
----
42
42
42

query II rowsort
SELECT + - col1 AS col1, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + 42 > NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8347
SELECT CAST( COUNT( * ) AS SIGNED ) FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-8347
SELECT CAST ( COUNT ( * ) AS INTEGER ) FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + 3 * - 44 * - - 35 * col1 * + - 59 + - - col1 AS col1 FROM tab1 GROUP BY col1, col1
----
11993564
15537117
1635486

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * 13 * - 41 col2 FROM tab1 GROUP BY col1, col2 HAVING + ( + - col1 ) IS NOT NULL
----
-23452
-30381
-3198

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8351
SELECT ALL + 75 * + COUNT( * ) * - ( + - col0 ) / + COALESCE ( + + COUNT( * ), + ( ( col2 ) ), + col2 * col2 ) * + COUNT( ALL col2 ) - - col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-8351
SELECT ALL + 75 * + COUNT ( * ) * - ( + - col0 ) / + COALESCE ( + + COUNT ( * ), + ( ( col2 ) ), + col2 * col2 ) * + COUNT ( ALL col2 ) - - col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8352
SELECT DISTINCT - AVG ( + col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT( * ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-8352
SELECT DISTINCT - AVG ( + col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT ( * ) <= NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8353
SELECT + 19 + - col1 + - ( + COUNT( * ) ) + - - 34 * - CAST( 41 AS SIGNED ) * col1 AS col2 FROM tab0 GROUP BY col1
----
-112977
17

skipif mysql # not compatible
query I rowsort label-8353
SELECT + 19 + - col1 + - ( + COUNT ( * ) ) + - - 34 * - CAST ( 41 AS INTEGER ) * col1 AS col2 FROM tab0 GROUP BY col1
----
-112977
17

query II rowsort
SELECT ALL + col1 * 30 AS col1, + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
1320
44
1710
57
180
6

onlyif mysql # aggregate syntax: 
query I rowsort label-8355
SELECT 12 AS col1 FROM tab1 GROUP BY col2 HAVING NOT + ( + 80 ) * - 20 >= + MAX( DISTINCT + col1 )
----
12
12
12

skipif mysql # not compatible
query I rowsort label-8355
SELECT 12 AS col1 FROM tab1 GROUP BY col2 HAVING NOT + ( + 80 ) * - 20 >= + MAX ( DISTINCT + col1 )
----
12
12
12

query II rowsort
SELECT 17 AS col0, - col2 FROM tab1 AS cor0 WHERE + COALESCE ( - 25, + col0 ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT + + 92 * + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT 88 IS NULL )
----
3772
5428
5612

query I rowsort
SELECT ALL + + col2 * + + 97 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
5626
7663
8439

query I rowsort
SELECT ALL 20 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
20
20
20

onlyif mysql # aggregate syntax: 
query I rowsort label-8360
SELECT ALL + COUNT( * ) AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8360
SELECT ALL + COUNT ( * ) AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
1
1
1

onlyif mysql # aggregate syntax: 
query I rowsort label-8361
SELECT + + 58 * - col2 + + + ( - - COUNT( * ) ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1391
-2203
-4581

skipif mysql # not compatible
query I rowsort label-8361
SELECT + + 58 * - col2 + + + ( - - COUNT ( * ) ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1391
-2203
-4581

query I rowsort
SELECT ALL + ( col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + 27 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8363
SELECT + col2 - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NOT col2 * + COUNT( * ) * - 32 IS NULL )
----
0
0
0

skipif mysql # not compatible
query I rowsort label-8363
SELECT + col2 - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NOT col2 * + COUNT ( * ) * - 32 IS NULL )
----
0
0
0

query I rowsort
SELECT ALL col0 - 29 - col0 * col0 FROM tab2 GROUP BY col0 HAVING NOT col0 * 37 IS NULL
----
-239
-8219
-8401

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8365
SELECT col2 FROM tab1 GROUP BY col2, col1 HAVING NOT - 39 + 66 - CAST( - col2 AS SIGNED ) * + COUNT( * ) * + + col2 + + col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8365
SELECT col2 FROM tab1 GROUP BY col2, col1 HAVING NOT - 39 + 66 - CAST ( - col2 AS INTEGER ) * + COUNT ( * ) * + + col2 + + col1 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8366
SELECT COUNT( 43 ) + - col0 FROM tab2 GROUP BY col0, col2 HAVING ( NULL IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-8366
SELECT COUNT ( 43 ) + - col0 FROM tab2 GROUP BY col0, col2 HAVING ( NULL IS NOT NULL )
----

query II rowsort
SELECT - col2, 76 * - col2 + + col2 * 20 AS col1 FROM tab0 GROUP BY col2, col0
----
-24
-1344
-38
-2128
-79
-4424

query I rowsort
SELECT ALL ( - 51 ) FROM tab0 GROUP BY col0, col1
----
-51
-51
-51

onlyif mysql # aggregate syntax: 
query I rowsort label-8369
SELECT NULLIF ( + col2, + + col2 ) * - - COUNT( * ) FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8369
SELECT NULLIF ( + col2, + + col2 ) * - - COUNT ( * ) FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8370
SELECT - CAST( - - col0 AS SIGNED ) FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-8370
SELECT - CAST ( - - col0 AS INTEGER ) FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col0, col1, col0 HAVING NOT COALESCE ( - col0, + 16 / + + 88 ) + 93 IS NULL
----
41
59
61

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-8372
SELECT ( - CAST( - MAX( - + col0 ) AS DECIMAL ) ) * + 82 + - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT col1 - col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8372
SELECT ( - CAST ( - MAX ( - + col0 ) AS REAL ) ) * + 82 + - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT col1 - col0 IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8373
SELECT 87 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0, col1 HAVING NOT ( NOT COALESCE ( + 55, 87 ) + MAX( + NULLIF ( + col0, + 71 + 9 / - col1 * - + ( 63 ) ) ) - - col1 <= - col1 )
----

skipif mysql # not compatible
query I rowsort label-8373
SELECT 87 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0, col1 HAVING NOT ( NOT COALESCE ( + 55, 87 ) + MAX ( + NULLIF ( + col0, + 71 + 9 / - col1 * - + ( 63 ) ) ) - - col1 <= - col1 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8374
SELECT ALL + col2 + - col2 FROM tab0 GROUP BY col2 HAVING NOT - ( - SUM( DISTINCT + 90 ) ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-8374
SELECT ALL + col2 + - col2 FROM tab0 GROUP BY col2 HAVING NOT - ( - SUM ( DISTINCT + 90 ) ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 25 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8376
SELECT DISTINCT - col1 * + COUNT( * ) + col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8376
SELECT DISTINCT - col1 * + COUNT ( * ) + col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

query I rowsort
SELECT + col2 * - 56 FROM tab2 AS cor0 GROUP BY col2
----
-3248
-4424
-4872

query I rowsort
SELECT ALL - NULLIF ( - 14, - - 48 ) FROM tab2 AS cor0 GROUP BY col1
----
14
14
14

query I rowsort
SELECT 29 FROM tab1 GROUP BY col0
----
29
29
29

query I rowsort
SELECT - 11 + + col1 FROM tab0 GROUP BY col1, col1
----
-11
70

onlyif mysql # aggregate syntax: 
query II rowsort label-8381
SELECT + COUNT( * ) AS col1, - 0 * + - 69 * + ( + 53 ) AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING ( COUNT( col1 ) ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-8381
SELECT + COUNT ( * ) AS col1, - 0 * + - 69 * + ( + 53 ) AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING ( COUNT ( col1 ) ) IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # aggregate syntax: 
query I rowsort label-8383
SELECT ALL + 37 col0 FROM tab1 GROUP BY col2 HAVING NULL NOT BETWEEN COUNT( * ) + - ( - col0 ) + col0 * col0 * + col2 * - - 37 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8383
SELECT ALL + 37 col0 FROM tab1 GROUP BY col2 HAVING NULL NOT BETWEEN COUNT ( * ) + - ( - col0 ) + col0 * col0 * + col2 * - - 37 AND NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT col2 IS NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query II rowsort label-8385
SELECT - + col0 * 43 * - + 0 - - ( + - col0 ) * - + 40 - - NULLIF ( + col1, + - 88 ), COUNT( col0 ) AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
3699
1
3721
1
661
1

skipif mysql # not compatible
query II rowsort label-8385
SELECT - + col0 * 43 * - + 0 - - ( + - col0 ) * - + 40 - - NULLIF ( + col1, + - 88 ), COUNT ( col0 ) AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
3699
1
3721
1
661
1

query I rowsort
SELECT 22 FROM tab1 AS cor0 GROUP BY col2, col2
----
22
22
22

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - 35 FROM tab2 AS cor0 GROUP BY col1
----
-35
-35
-35

onlyif mysql # aggregate syntax: 
query I rowsort label-8389
SELECT DISTINCT + col1 * COUNT( * ) AS col0 FROM tab1 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-8389
SELECT DISTINCT + col1 * COUNT ( * ) AS col0 FROM tab1 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8390
SELECT SUM( 13 ) AS col1 FROM tab2 GROUP BY col0, col2
----
13
13
13

skipif mysql # not compatible
query I rowsort label-8390
SELECT SUM ( 13 ) AS col1 FROM tab2 GROUP BY col0, col2
----
13
13
13

query I rowsort
SELECT DISTINCT - 5 AS col0 FROM tab1 GROUP BY col2, col2
----
-5

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col0, + 6 FROM tab0 GROUP BY col0 HAVING NOT 84 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8393
SELECT DISTINCT CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) * + col2 FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8393
SELECT DISTINCT CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) * + col2 FROM tab2 GROUP BY col2
----
NULL

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8394
SELECT + COUNT( * ) FROM tab0 AS cor0 WHERE NOT - col0 * - + CAST( + + col0 AS SIGNED ) * - 96 <= + col2 - 30 GROUP BY col0, col2 HAVING NOT 20 IS NULL
----

skipif mysql # not compatible
query I rowsort label-8394
SELECT + COUNT ( * ) FROM tab0 AS cor0 WHERE NOT - col0 * - + CAST ( + + col0 AS INTEGER ) * - 96 <= + col2 - 30 GROUP BY col0, col2 HAVING NOT 20 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8395
SELECT - ( - - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <> + COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-8395
SELECT - ( - - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <> + COUNT ( * )
----

query II rowsort
SELECT DISTINCT col1 AS col0, col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query II rowsort
SELECT col1, - col1 FROM tab2 AS cor0 GROUP BY col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT - + 33 FROM tab0 cor0 GROUP BY col1
----
-33
-33

onlyif mysql # aggregate syntax: 
query I rowsort label-8399
SELECT DISTINCT MAX( - col1 ) + + + 55 + + COUNT( * ) AS col0 FROM tab1 GROUP BY col1, col2
----
-1
12
50

skipif mysql # not compatible
query I rowsort label-8399
SELECT DISTINCT MAX ( - col1 ) + + + 55 + + COUNT ( * ) AS col0 FROM tab1 GROUP BY col1, col2
----
-1
12
50

query I rowsort
SELECT DISTINCT - - AVG ( - - col2 ) + - 91 + col2 * + 61 FROM tab0 WHERE NOT 75 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
0
162

onlyif mysql # aggregate syntax: 
query I rowsort label-8403
SELECT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT - 45 * - 12 - + - COUNT( * ) / col1 IS NULL
----
58
79
87

skipif mysql # not compatible
query I rowsort label-8403
SELECT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT - 45 * - 12 - + - COUNT ( * ) / col1 IS NULL
----
58
79
87

onlyif mysql # aggregate syntax: 
query II rowsort label-8404
SELECT ALL - col1 col1, + COUNT( * ) FROM tab2 AS cor0 GROUP BY col1
----
-41
1
-59
1
-61
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8404
SELECT ALL - col1 col1, + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1
----
-41
1
-59
1
-61
1

onlyif mysql # aggregate syntax: 
query I rowsort label-8405
SELECT + 85 * + ( - + COUNT( * ) ) FROM tab0 GROUP BY col0, col1
----
-85
-85
-85

skipif mysql # not compatible
query I rowsort label-8405
SELECT + 85 * + ( - + COUNT ( * ) ) FROM tab0 GROUP BY col0, col1
----
-85
-85
-85

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + 77 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
77
77
77

query I rowsort
SELECT 40 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1120
-3280
-880

query I rowsort
SELECT ALL 97 * + col1 AS col0 FROM tab0 GROUP BY col1
----
0
7857

query I rowsort
SELECT - ( col0 ) AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-8412
SELECT DISTINCT col2 DIV col2 AS col1 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-8412
SELECT DISTINCT col2 / col2 AS col1 FROM tab2 GROUP BY col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 54 col0 FROM tab0 AS cor0 GROUP BY col1
----
54
54

query I rowsort
SELECT - + col0 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8415
SELECT ALL CAST( ( - + 82 ) AS SIGNED ) + 51 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-8415
SELECT ALL CAST ( ( - + 82 ) AS INTEGER ) + 51 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8416
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT + CAST( - + 9 AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8416
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT + CAST ( - + 9 AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT ALL 44 * - + 83 FROM tab0 GROUP BY col2, col0
----
-3652
-3652
-3652

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING 23 IS NOT NULL
----
24
38
79

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-8419
SELECT + col1, col1 + - COUNT( * ) DIV - + 35 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT - col0 - + + col0 BETWEEN + NULLIF ( + COUNT( ALL - col1 ), - col0 * - + 61 DIV ( + + col0 ) * MAX( DISTINCT + ( - NULLIF ( - col2, - col2 - - col2 ) ) ) + + col0 ) AND + col0 * - + col1
----
0
0
0
0
81
81

skipif mysql # not compatible
query II rowsort label-8419
SELECT + col1, col1 + - COUNT ( * ) / - + 35 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT - col0 - + + col0 BETWEEN + NULLIF ( + COUNT ( ALL - col1 ), - col0 * - + 61 / ( + + col0 ) * MAX ( DISTINCT + ( - NULLIF ( - col2, - col2 - - col2 ) ) ) + + col0 ) AND + col0 * - + col1
----
0
0
0
0
81
81

onlyif mysql # aggregate syntax: 
query I rowsort label-8420
SELECT 23 * - SUM( + + 59 ) FROM tab0 AS cor0 GROUP BY col0
----
-1357
-1357
-1357

skipif mysql # not compatible
query I rowsort label-8420
SELECT 23 * - SUM ( + + 59 ) FROM tab0 AS cor0 GROUP BY col0
----
-1357
-1357
-1357

query I rowsort
SELECT DISTINCT 25 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8422
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 WHERE + col1 * - + col0 + - - 45 > - CAST( NULL AS SIGNED ) GROUP BY col1, col0, col0
----

skipif mysql # not compatible
query I rowsort label-8422
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 WHERE + col1 * - + col0 + - - 45 > - CAST ( NULL AS INTEGER ) GROUP BY col1, col0, col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8423
SELECT DISTINCT - COUNT( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-8423
SELECT DISTINCT - COUNT ( * ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-1

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT 66 FROM tab2 AS cor0 GROUP BY col0, col2
----
66

query I rowsort
SELECT ALL + col0 - - 68 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8427
SELECT DISTINCT + - MIN( DISTINCT - col0 ) FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8427
SELECT DISTINCT + - MIN ( DISTINCT - col0 ) FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST( + COUNT( * ) AS SIGNED ) + - 64 + + + 20 * - col1 + - - COUNT( DISTINCT + col1 ) * - col1 / COUNT( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST ( + COUNT ( * ) AS INTEGER ) + - 64 + + + 20 * - col1 + - - COUNT ( DISTINCT + col1 ) * - col1 / COUNT ( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT + - 1 IS NULL GROUP BY col2
----
-58
-79
-87

onlyif mysql # aggregate syntax: 
query I rowsort label-8430
SELECT 47 * + COUNT( * ) FROM tab0 AS cor0 GROUP BY col0
----
47
47
47

skipif mysql # not compatible
query I rowsort label-8430
SELECT 47 * + COUNT ( * ) FROM tab0 AS cor0 GROUP BY col0
----
47
47
47

query I rowsort
SELECT ALL + + col1 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

onlyif mysql # aggregate syntax: 
query I rowsort label-8432
SELECT - col1 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col1 HAVING NULL IN ( - NULLIF ( - MAX( col2 ), ( MAX( + 43 ) ) + + 7 ) - COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-8432
SELECT - col1 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col1 HAVING NULL IN ( - NULLIF ( - MAX ( col2 ), ( MAX ( + 43 ) ) + + 7 ) - COUNT ( * ) )
----

query I rowsort
SELECT ALL + col1 * col1 AS col2 FROM tab0 WHERE NOT 85 IS NOT NULL GROUP BY col1 HAVING NOT ( 59 ) >= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8434
SELECT DISTINCT - col0 col1 FROM tab0 GROUP BY col0 HAVING MIN( 82 ) + - 54 < + 28
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8434
SELECT DISTINCT - col0 col1 FROM tab0 GROUP BY col0 HAVING MIN ( 82 ) + - 54 < + 28
----

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT ( + col0 ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - 40 FROM tab0 GROUP BY col0, col2 HAVING + col0 IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT ( col0 ) <= + 23
----
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-8438
SELECT 52 * - COUNT( * ) FROM tab2 GROUP BY col1, col2
----
-52
-52
-52

skipif mysql # not compatible
query I rowsort label-8438
SELECT 52 * - COUNT ( * ) FROM tab2 GROUP BY col1, col2
----
-52
-52
-52

onlyif mysql # aggregate syntax: 
query I rowsort label-8439
SELECT ALL 24 + MIN( DISTINCT - col2 + - col2 ) col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-118
-66
8

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8439
SELECT ALL 24 + MIN ( DISTINCT - col2 + - col2 ) col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-118
-66
8

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT + col1 + col1 IS NULL
----
15
91
92

onlyif mysql # aggregate syntax: 
query I rowsort label-8441
SELECT DISTINCT SUM( - 97 ) * COUNT( * ) + + 89 col0 FROM tab2 GROUP BY col2
----
-8

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8441
SELECT DISTINCT SUM ( - 97 ) * COUNT ( * ) + + 89 col0 FROM tab2 GROUP BY col2
----
-8

query I rowsort
SELECT - col1 + + col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-8443
SELECT col2 * CAST( NULLIF ( CAST( NULL AS SIGNED ), + col0 / - 65 ) / + 24 AS SIGNED ) + - 59 * col1 col1 FROM tab1 GROUP BY col2, col1 HAVING + col1 / - MIN( CAST( NULL AS DECIMAL ) ) > ( + 24 * + COUNT( * ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8443
SELECT col2 * CAST ( NULLIF ( CAST ( NULL AS INTEGER ), + col0 / - 65 ) / + 24 AS INTEGER ) + - 59 * col1 col1 FROM tab1 GROUP BY col2, col1 HAVING + col1 / - MIN ( CAST ( NULL AS REAL ) ) > ( + 24 * + COUNT ( * ) )
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT col0 + + col0 FROM tab2 GROUP BY col0
----
182
184
30

onlyif mysql # aggregate syntax: 
query I rowsort label-8446
SELECT ALL COUNT( ALL col0 ) + col0 FROM tab2 GROUP BY col0 HAVING NULL NOT IN ( - 48 )
----

skipif mysql # not compatible
query I rowsort label-8446
SELECT ALL COUNT ( ALL col0 ) + col0 FROM tab2 GROUP BY col0 HAVING NULL NOT IN ( - 48 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8447
SELECT col1 DIV - col0 AS col2 FROM tab2 GROUP BY col1, col0
----
-4
0
0

skipif mysql # not compatible
query I rowsort label-8447
SELECT col1 / - col0 AS col2 FROM tab2 GROUP BY col1, col0
----
-4
0
0

query I rowsort
SELECT ALL 90 FROM tab1 GROUP BY col2
----
90
90
90

onlyif mysql # aggregate syntax: 
query I rowsort label-8449
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT + COUNT( * ) <= ( + 43 )
----

skipif mysql # not compatible
query I rowsort label-8449
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT + COUNT ( * ) <= ( + 43 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8450
SELECT 68 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IN ( + ( - 25 ) * COUNT( * ) + 10 )
----

skipif mysql # not compatible
query I rowsort label-8450
SELECT 68 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IN ( + ( - 25 ) * COUNT ( * ) + 10 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8451
SELECT DISTINCT 22 FROM tab2 GROUP BY col2, col1, col1 HAVING COUNT( * ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8451
SELECT DISTINCT 22 FROM tab2 GROUP BY col2, col1, col1 HAVING COUNT ( * ) IS NULL
----

query I rowsort
SELECT col1 * + 20 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING - 74 IS NULL
----

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN ( + NULLIF ( 60, col2 ) ) AND ( 90 / 33 ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 18 * 20 col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
360
360
360

query I rowsort
SELECT col1 * - 0 FROM tab2 cor0 GROUP BY col1, col2, col1
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-8456
SELECT DISTINCT + SUM( ALL + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-8456
SELECT DISTINCT + SUM ( ALL + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT 0 / - NULLIF ( col2, col2 ) + - col0 * ( 23 + + 73 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
NULL

query I rowsort
SELECT 65 AS col2 FROM tab0 GROUP BY col0, col2 HAVING - col2 IN ( 33 )
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT - + col0 + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( - AVG ( + col0 ) * - 26 ) NOT IN ( 39 * + col0 )
----
-11
-14
17

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8461
SELECT col2 FROM tab0 AS cor0 WHERE NOT 49 + + col1 IS NULL GROUP BY col2, col1 HAVING NOT ( COUNT( * ) ) BETWEEN + 76 - - col2 AND - CASE NULLIF ( - 39, CAST( - col1 AS SIGNED ) ) WHEN + 67 * - 30 THEN CAST( 1 AS SIGNED ) + + COUNT( * ) * col2 ELSE NULL END
----
24
38
79

skipif mysql # not compatible
query I rowsort label-8461
SELECT col2 FROM tab0 AS cor0 WHERE NOT 49 + + col1 IS NULL GROUP BY col2, col1 HAVING NOT ( COUNT ( * ) ) BETWEEN + 76 - - col2 AND - CASE NULLIF ( - 39, CAST ( - col1 AS INTEGER ) ) WHEN + 67 * - 30 THEN CAST ( 1 AS INTEGER ) + + COUNT ( * ) * col2 ELSE NULL END
----
24
38
79

query I rowsort
SELECT 56 + - 68 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * + 40 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----

query I rowsort
SELECT + 87 / col2 / col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col2 * col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= + col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 16 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( + 53 ) BETWEEN + col2 * + col1 AND 22
----
16
16
16

query I rowsort
SELECT ALL + 99 FROM tab0 AS cor0 GROUP BY col0
----
99
99
99

query I rowsort
SELECT ALL + 94 + - + col1 + col1 FROM tab0 GROUP BY col1
----
94
94

query II rowsort
SELECT col2 AS col1, - 38 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
58
-38
79
-38
87
-38

onlyif mysql # aggregate syntax: 
query I rowsort label-8470
SELECT ALL COUNT( * ) + 96 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <= ( - col2 )
----

skipif mysql # not compatible
query I rowsort label-8470
SELECT ALL COUNT ( * ) + 96 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <= ( - col2 )
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING col2 * col2 IS NULL
----

query II rowsort
SELECT - col1 AS col1, 67 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-44
67
-57
67
-6
67

onlyif mysql # DIV for integer division: 
query I rowsort label-8473
SELECT - col0 * 55 * 4 + col0 DIV 84 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col0
----
-20019
-20239
-3300

skipif mysql # not compatible
query I rowsort label-8473
SELECT - col0 * 55 * 4 + col0 / 84 AS col1 FROM tab2 cor0 GROUP BY col0, col0, col0
----
-20019
-20239
-3300

query I rowsort
SELECT ALL + col0 * + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8475
SELECT - col2 * CAST( - col0 AS SIGNED ) FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

skipif mysql # not compatible
query I rowsort label-8475
SELECT - col2 * CAST ( - col0 AS INTEGER ) FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 + - col1 + 78 col0 FROM tab0 GROUP BY col1
----
78
78

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col2, col2 HAVING NOT 84 IS NULL
----
58
79
87

query I rowsort
SELECT ALL 54 - - ( col0 ) / - 88 AS col1 FROM tab2 AS cor0 WHERE ( - col2 + + 93 ) NOT IN ( - ( - 4 ) ) GROUP BY col1, col0 HAVING NOT NULL > col0
----

query I rowsort
SELECT ALL + ( + - col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + ( 91 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * 2 col0 FROM tab2 AS cor0 WHERE ( NOT ( NULL ) >= NULL ) GROUP BY col1
----

query I rowsort
SELECT col1 * col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
132
1596
3608

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT 96 IS NOT NULL
----

query I rowsort
SELECT col0 + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + col0 + + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT + col1 * + 79 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8487
SELECT DISTINCT COUNT( 19 ) FROM tab1 cor0 WHERE ( NULL ) = - col0 - - - 39 + - - col0 * + col1 GROUP BY col2, col0 HAVING ( NULL ) <> COUNT( ALL + col0 )
----

skipif mysql # not compatible
query I rowsort label-8487
SELECT DISTINCT COUNT ( 19 ) FROM tab1 cor0 WHERE ( NULL ) = - col0 - - - 39 + - - col0 * + col1 GROUP BY col2, col0 HAVING ( NULL ) <> COUNT ( ALL + col0 )
----

query I rowsort
SELECT ALL 74 * col1 FROM tab1 GROUP BY col1
----
3256
4218
444

query I rowsort
SELECT ALL - - 70 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
70
70
70

onlyif mysql # aggregate syntax: 
query II rowsort label-8490
SELECT DISTINCT + COUNT( * ) AS col2, - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
-26
1
-43
1
-83

skipif mysql # not compatible
query II rowsort label-8490
SELECT DISTINCT + COUNT ( * ) AS col2, - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
-26
1
-43
1
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-8491
SELECT 29 * - 3 + - - col1 + col1 + 41 + + 65 * + col1 / - AVG ( + col1 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL NOT BETWEEN - COUNT( * ) AND - col1
----

skipif mysql # not compatible
query I rowsort label-8491
SELECT 29 * - 3 + - - col1 + col1 + 41 + + 65 * + col1 / - AVG ( + col1 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL NOT BETWEEN - COUNT ( * ) AND - col1
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT ( - col2 + - + col2 ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + 40 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
40
40
40

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-8494
SELECT DISTINCT + COUNT( * ) DIV - COUNT( * ) + 26 * + ( - COALESCE ( - 58, - col2, - col1 DIV CAST( NULL AS SIGNED ) ) ) + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
1508

skipif mysql # not compatible
query I rowsort label-8494
SELECT DISTINCT + COUNT ( * ) / - COUNT ( * ) + 26 * + ( - COALESCE ( - 58, - col2, - col1 / CAST ( NULL AS INTEGER ) ) ) + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
1508

query I rowsort
SELECT col1 + + ( + 66 ) FROM tab2 AS cor0 GROUP BY col1
----
107
125
127

query I rowsort
SELECT col2 * + 92 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
5336
7268
8004

onlyif mysql # aggregate syntax: 
query II rowsort label-8497
SELECT DISTINCT + MAX( - - col1 ), - 64 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
-64
59
-64
61
-64

skipif mysql # not compatible
query II rowsort label-8497
SELECT DISTINCT + MAX ( - - col1 ), - 64 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
-64
59
-64
61
-64

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8498
SELECT col2 * CASE + + CAST( NULL AS SIGNED ) WHEN + - 74 THEN NULL WHEN col2 THEN NULL WHEN - 74 THEN + 67 END AS col0 FROM tab0 GROUP BY col2 HAVING + 68 / - COUNT( * ) > NULL
----

skipif mysql # not compatible
query I rowsort label-8498
SELECT col2 * CASE + + CAST ( NULL AS INTEGER ) WHEN + - 74 THEN NULL WHEN col2 THEN NULL WHEN - 74 THEN + 67 END AS col0 FROM tab0 GROUP BY col2 HAVING + 68 / - COUNT ( * ) > NULL
----

query I rowsort
SELECT col2 / - - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT - 39 - + - 49 + col2 <> + + 79 * ( col2 )
----

query I rowsort
SELECT + 36 * - col2 FROM tab1 GROUP BY col1, col2
----
-1620
-2556
-288

query II rowsort
SELECT - ( 1 ) AS col0, col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * 95 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-4275
-6745
-760

onlyif mysql # aggregate syntax: 
query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) * - col1 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT ( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) * - col1 = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8504
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT( * ) NOT IN ( - COUNT( * ), 88, COUNT( * ) )
----

skipif mysql # not compatible
query I rowsort label-8504
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT ( * ) NOT IN ( - COUNT ( * ), 88, COUNT ( * ) )
----

query I rowsort
SELECT - 21 + - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
1
61
7

query I rowsort
SELECT - 54 FROM tab1 GROUP BY col1
----
-54
-54
-54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 97 * col1 * + 6 col2 FROM tab2 WHERE NOT - + 19 NOT BETWEEN + - col2 AND NULL GROUP BY col1 HAVING NOT - 77 BETWEEN NULL AND 24 * 17 + col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8508
SELECT DISTINCT - col1 DIV - 75 col0 FROM tab0 GROUP BY col1
----
0
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8508
SELECT DISTINCT - col1 / - 75 col0 FROM tab0 GROUP BY col1
----
0
1

onlyif mysql # DIV for integer division: 
query II rowsort label-8509
SELECT - ( - NULLIF ( col1, + 24 ) ) DIV - - col0, 21 + col1 AS col1 FROM tab1 GROUP BY col1, col1, col0
----
0
27
0
65
2
78

skipif mysql # not compatible
query II rowsort label-8509
SELECT - ( - NULLIF ( col1, + 24 ) ) / - - col0, 21 + col1 AS col1 FROM tab1 GROUP BY col1, col1, col0
----
0
27
0
65
2
78

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT col0 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

onlyif mysql # aggregate syntax: 
query I rowsort label-8512
SELECT + col0 * + - ( - + COUNT( * ) ) FROM tab1 cor0 GROUP BY col0, col1, col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-8512
SELECT + col0 * + - ( - + COUNT ( * ) ) FROM tab1 cor0 GROUP BY col0, col1, col0
----
22
28
82

onlyif mysql # aggregate syntax: 
query II rowsort label-8513
SELECT col1, + COUNT( * ) FROM tab0 GROUP BY col1
----
0
2
81
1

skipif mysql # not compatible
query II rowsort label-8513
SELECT col1, + COUNT ( * ) FROM tab0 GROUP BY col1
----
0
2
81
1

query I rowsort
SELECT ALL + col1 * + ( + col2 ) + + + 98 AS col0 FROM tab1 GROUP BY col1, col2, col1
----
146
2663
3222

onlyif mysql # aggregate syntax: 
query II rowsort label-8515
SELECT - col0 AS col1, MIN( col0 ) col2 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8515
SELECT - col0 AS col1, MIN ( col0 ) col2 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

onlyif mysql # aggregate syntax: 
query I rowsort label-8516
SELECT - col1 * + col1 AS col1 FROM tab0 GROUP BY col1 HAVING + col1 + SUM( ALL - 48 ) * - + 11 * - + col1 <= + 59
----
-6561
0

skipif mysql # not compatible
query I rowsort label-8516
SELECT - col1 * + col1 AS col1 FROM tab0 GROUP BY col1 HAVING + col1 + SUM ( ALL - 48 ) * - + 11 * - + col1 <= + 59
----
-6561
0

onlyif mysql # aggregate syntax: 
query I rowsort label-8517
SELECT ALL + col2 * MAX( DISTINCT - col2 ) AS col1 FROM tab2 GROUP BY col2, col0
----
-3364
-6241
-7569

skipif mysql # not compatible
query I rowsort label-8517
SELECT ALL + col2 * MAX ( DISTINCT - col2 ) AS col1 FROM tab2 GROUP BY col2, col0
----
-3364
-6241
-7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8518
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST( - col1 AS SIGNED ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8518
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST ( - col1 AS INTEGER ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

onlyif mysql # aggregate syntax: 
query I rowsort label-8519
SELECT ALL col2 AS col0 FROM tab1 cor0 WHERE ( col0 ) + + 15 IS NULL GROUP BY col2 HAVING NOT - col2 + col2 * + 50 = - - COUNT( ALL col2 ) * COUNT( * ) + col2
----

skipif mysql # not compatible
query I rowsort label-8519
SELECT ALL col2 AS col0 FROM tab1 cor0 WHERE ( col0 ) + + 15 IS NULL GROUP BY col2 HAVING NOT - col2 + col2 * + 50 = - - COUNT ( ALL col2 ) * COUNT ( * ) + col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8520
SELECT ALL + COUNT( * ) FROM tab2 GROUP BY col0, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8520
SELECT ALL + COUNT ( * ) FROM tab2 GROUP BY col0, col2
----
1
1
1

query I rowsort
SELECT col0 * + col1 + col0 FROM tab0 GROUP BY col1, col0 HAVING NULL = AVG ( col0 )
----

query I rowsort
SELECT 4 + + 54 AS col2 FROM tab2 WHERE + col2 IN ( + - 43 / - col2 * + col0 + + col0 * - + col1, 53 ) GROUP BY col1 HAVING ( col1 ) NOT BETWEEN col1 AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8523
SELECT ALL + col1 + - - COUNT( * ) * + col1 + + + 58 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= col1
----

skipif mysql # not compatible
query I rowsort label-8523
SELECT ALL + col1 + - - COUNT ( * ) * + col1 + + + 58 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8524
SELECT + col1 DIV col1 * + + 16 FROM tab1 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
16
16
16

skipif mysql # not compatible
query I rowsort label-8524
SELECT + col1 / col1 * + + 16 FROM tab1 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
16
16
16

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8525
SELECT ALL col2 DIV - col1 * + ( - + COUNT( * ) ) FROM tab1 AS cor0 GROUP BY col2, col1
----
0
1
1

skipif mysql # not compatible
query I rowsort label-8525
SELECT ALL col2 / - col1 * + ( - + COUNT ( * ) ) FROM tab1 AS cor0 GROUP BY col2, col1
----
0
1
1

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8526
SELECT + CAST( NULL AS SIGNED ) * col1 + + COUNT( * ) * + + col1 + - COUNT( * ) * + 20, 71 - + - col1 * - + 63 * + - 11 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
NULL
30563
NULL
39572
NULL
4229

skipif mysql # not compatible
query II rowsort label-8526
SELECT + CAST ( NULL AS INTEGER ) * col1 + + COUNT ( * ) * + + col1 + - COUNT ( * ) * + 20, 71 - + - col1 * - + 63 * + - 11 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
NULL
30563
NULL
39572
NULL
4229

onlyif mysql # aggregate syntax: 
query I rowsort label-8527
SELECT ALL 67 + 50 * COUNT( * ) + + - 82 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NOT + col0 IS NOT NULL )
----
35
35
35

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8527
SELECT ALL 67 + 50 * COUNT ( * ) + + - 82 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NOT + col0 IS NOT NULL )
----
35
35
35

onlyif mysql # aggregate syntax: 
query I rowsort label-8528
SELECT DISTINCT COUNT( * ) - - + col2 + + MAX( + - 9 ) FROM tab1 GROUP BY col2 HAVING NOT ( - 33 ) < ( NULL )
----

skipif mysql # not compatible
query I rowsort label-8528
SELECT DISTINCT COUNT ( * ) - - + col2 + + MAX ( + - 9 ) FROM tab1 GROUP BY col2 HAVING NOT ( - 33 ) < ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST( + + col1 AS SIGNED ) + 42 + - col1 + - 16
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST ( + + col1 AS INTEGER ) + 42 + - col1 + - 16
----

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8531
SELECT ALL + + col1 * + 1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT 14 BETWEEN - + COUNT( * ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-8531
SELECT ALL + + col1 * + 1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT 14 BETWEEN - + COUNT ( * ) AND NULL
----

query I rowsort
SELECT DISTINCT + 34 + - 61 * - - col0 FROM tab2 AS cor0 GROUP BY col0
----
-5517
-5578
-881

onlyif mysql # aggregate syntax: 
query I rowsort label-8533
SELECT ALL - - col2 + + ( AVG ( + col2 ) ) col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8533
SELECT ALL - - col2 + + ( AVG ( + col2 ) ) col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT COUNT ( * ) IS NOT NULL
----

query I rowsort
SELECT + + NULLIF ( - - 88, + - 83 + 35 ) AS col1 FROM tab2 AS cor0 GROUP BY col2
----
88
88
88

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING + ( - 39 ) IS NULL
----

query I rowsort
SELECT DISTINCT + 69 + 12 - - 78 * + col2 FROM tab0 GROUP BY col2
----
1953
3045
6243

query I rowsort
SELECT + col0 * - ( 86 ) AS col2 FROM tab2 GROUP BY col0, col2
----
-1290
-7826
-7912

onlyif mysql # aggregate syntax: 
query I rowsort label-8538
SELECT DISTINCT - SUM( DISTINCT - + col0 ) FROM tab0 GROUP BY col0, col2, col2
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8538
SELECT DISTINCT - SUM ( DISTINCT - + col0 ) FROM tab0 GROUP BY col0, col2, col2
----
26
43
83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8539
SELECT + col0 AS col2, NULLIF ( + COUNT( * ), - + col2 + - col1 * - CAST( NULL AS SIGNED ) ) FROM tab2 GROUP BY col0, col2, col1 HAVING NOT ( - col1 + - 65 IS NULL )
----
15
1
91
1
92
1

skipif mysql # not compatible
query II rowsort label-8539
SELECT + col0 AS col2, NULLIF ( + COUNT ( * ), - + col2 + - col1 * - CAST ( NULL AS INTEGER ) ) FROM tab2 GROUP BY col0, col2, col1 HAVING NOT ( - col1 + - 65 IS NULL )
----
15
1
91
1
92
1

onlyif mysql # aggregate syntax: 
query I rowsort label-8540
SELECT MIN( - + col2 ) FROM tab1 WHERE + 30 > + col2 * - 22 GROUP BY col2
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-8540
SELECT MIN ( - + col2 ) FROM tab1 WHERE + 30 > + col2 * - 22 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 + + + 77 FROM tab0 GROUP BY col0, col2, col2
----
101
115
156

onlyif mysql # aggregate syntax: 
query I rowsort label-8542
SELECT DISTINCT - COUNT( - col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-8542
SELECT DISTINCT - COUNT ( - col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-1
-2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 30 col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col1, col0
----

query I rowsort
SELECT DISTINCT + col0 * - col0 * + col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
-10626
-21924
-551286

query II rowsort
SELECT DISTINCT col0 + - col0 AS col2, col0 FROM tab2 AS cor0 GROUP BY col0
----
0
15
0
91
0
92

query II rowsort
SELECT ALL + col2 AS col1, + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
58
92
79
91
87
15

onlyif mysql # aggregate syntax: 
query I rowsort label-8547
SELECT - COALESCE ( COUNT( * ), + 88 + COALESCE ( - col0, - COALESCE ( - 90, + MAX( DISTINCT - col2 ) ) ) ) FROM tab2 GROUP BY col0, col0 HAVING ( NOT NULL IS NOT NULL )
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8547
SELECT - COALESCE ( COUNT ( * ), + 88 + COALESCE ( - col0, - COALESCE ( - 90, + MAX ( DISTINCT - col2 ) ) ) ) FROM tab2 GROUP BY col0, col0 HAVING ( NOT NULL IS NOT NULL )
----
-1
-1
-1

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

onlyif mysql # aggregate syntax: 
query I rowsort label-8549
SELECT + COUNT( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8549
SELECT + COUNT ( * ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
1
1
1

query II rowsort
SELECT 27 * - + ( + 0 ) * col1, col1 + + 76 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
157
0
76
0
76

query I rowsort
SELECT - + COALESCE ( ( + col1 ), ( - 73 ) ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT + 62 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
62
62
62

onlyif mysql # aggregate syntax: 
query I rowsort label-8553
SELECT DISTINCT + 99 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NULL < COUNT( * )
----

skipif mysql # not compatible
query I rowsort label-8553
SELECT DISTINCT + 99 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NULL < COUNT ( * )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8554
SELECT + COUNT( * ) * - + col1 * + col1 AS col2, COUNT( * ) AS col0 FROM tab1 GROUP BY col1 HAVING 91 = NULL
----

skipif mysql # not compatible
query II rowsort label-8554
SELECT + COUNT ( * ) * - + col1 * + col1 AS col2, COUNT ( * ) AS col0 FROM tab1 GROUP BY col1 HAVING 91 = NULL
----

query I rowsort
SELECT DISTINCT + 85 FROM tab1 GROUP BY col1
----
85

query I rowsort
SELECT ALL ( 0 ) AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8557
SELECT - 83 + 59 + + + ( col2 ) + + - col2 + + - col2 - - col2 + + COUNT( * ) FROM tab2 GROUP BY col2
----
-23
-23
-23

skipif mysql # not compatible
query I rowsort label-8557
SELECT - 83 + 59 + + + ( col2 ) + + - col2 + + - col2 - - col2 + + COUNT ( * ) FROM tab2 GROUP BY col2
----
-23
-23
-23

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NULL
----
0
81

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

onlyif mysql # aggregate syntax: 
query I rowsort label-8560
SELECT + - 26 * - 36 + - COUNT( * ) * - - col2 FROM tab0 AS cor0 WHERE NOT - col0 * - col0 IS NULL GROUP BY col2
----
857
898
912

skipif mysql # not compatible
query I rowsort label-8560
SELECT + - 26 * - 36 + - COUNT ( * ) * - - col2 FROM tab0 AS cor0 WHERE NOT - col0 * - col0 IS NULL GROUP BY col2
----
857
898
912

query I rowsort
SELECT DISTINCT 87 + + + col1 AS col1 FROM tab2 GROUP BY col1
----
128
146
148

query I rowsort
SELECT ALL - - 77 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
77
77
77

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col2 col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT + - col0 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8565
SELECT ALL - col2 - - COALESCE ( col0, + + CAST( NULL AS SIGNED ) ) col1 FROM tab1 cor0 GROUP BY col0, col2
----
-17
11
14

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8565
SELECT ALL - col2 - - COALESCE ( col0, + + CAST ( NULL AS INTEGER ) ) col1 FROM tab1 cor0 GROUP BY col0, col2
----
-17
11
14

query I rowsort
SELECT - ( col2 ) * + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-3364
-6241
-7569

onlyif mysql # aggregate syntax: 
query I rowsort label-8567
SELECT - + col2 col1 FROM tab1 WHERE col0 IS NOT NULL GROUP BY col2 HAVING NOT NULL BETWEEN SUM( + col2 ) AND COUNT( * )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8567
SELECT - + col2 col1 FROM tab1 WHERE col0 IS NOT NULL GROUP BY col2 HAVING NOT NULL BETWEEN SUM ( + col2 ) AND COUNT ( * )
----

query I rowsort
SELECT + 62 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL < - - col1 + - col0 + + col1
----

query I rowsort
SELECT ALL + 3 * + 25 + - - col2 * 64 * - 70 * + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 71 col0 FROM tab0 AS cor0 GROUP BY col2
----
71

query II rowsort
SELECT + col0 + - 35 - - col0 AS col1, col0 FROM tab2 AS cor0 GROUP BY col0
----
-5
15
147
91
149
92

query I rowsort
SELECT ALL 95 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NOT NULL
----
95
95
95

onlyif mysql # DIV for integer division: 
query II rowsort label-8573
SELECT col0, 44 + - - col0 DIV - col0 + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
65
28
71
82
125

skipif mysql # not compatible
query II rowsort label-8573
SELECT col0, 44 + - - col0 / - col0 + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
65
28
71
82
125

onlyif mysql # aggregate syntax: 
query I rowsort label-8574
SELECT - MIN( - 58 ) FROM tab2 AS cor0 GROUP BY col1, col1
----
58
58
58

skipif mysql # not compatible
query I rowsort label-8574
SELECT - MIN ( - 58 ) FROM tab2 AS cor0 GROUP BY col1, col1
----
58
58
58

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT + col0 IS NULL
----
-15
-91
-92

onlyif mysql # aggregate syntax: 
query I rowsort label-8576
SELECT DISTINCT + 73 * + MAX( DISTINCT - - col0 ) + + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8576
SELECT DISTINCT + 73 * + MAX ( DISTINCT - - col0 ) + + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8577
SELECT DISTINCT 11 DIV 8 FROM tab1 WHERE NOT + 8 IS NULL GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-8577
SELECT DISTINCT 11 / 8 FROM tab1 WHERE NOT + 8 IS NULL GROUP BY col0
----
1

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT - 90 IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-8579
SELECT DISTINCT - col2 - - - 91 DIV + - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
-115
-157
-173

skipif mysql # not compatible
query I rowsort label-8579
SELECT DISTINCT - col2 - - - 91 / + - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
-115
-157
-173

query I rowsort
SELECT DISTINCT + 86 FROM tab0 AS cor0 GROUP BY col0
----
86

query I rowsort
SELECT ALL ( 70 ) * - col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING - col1 IS NOT NULL
----
-3080
-3990
-420

onlyif mysql # aggregate syntax: 
query I rowsort label-8582
SELECT - SUM( ALL + 12 ) FROM tab0 GROUP BY col2, col1
----
-12
-12
-12

skipif mysql # not compatible
query I rowsort label-8582
SELECT - SUM ( ALL + 12 ) FROM tab0 GROUP BY col2, col1
----
-12
-12
-12

query I rowsort
SELECT DISTINCT - 49 FROM tab0 cor0 GROUP BY col2, col1
----
-49

onlyif mysql # aggregate syntax: 
query II rowsort label-8584
SELECT col0 AS col1, COUNT( * ) FROM tab0 cor0 GROUP BY col0
----
26
1
43
1
83
1

skipif mysql # not compatible
query II rowsort label-8584
SELECT col0 AS col1, COUNT ( * ) FROM tab0 cor0 GROUP BY col0
----
26
1
43
1
83
1

query I rowsort
SELECT + col2 + + + ( - 23 ) FROM tab1 WHERE ( ( - 74 * col0 * col0 * + - ( - col0 ) = NULL ) ) GROUP BY col2 HAVING NOT NULL > ( + 46 * 45 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query III rowsort label-8586
SELECT - ( COUNT( * ) ), 17 AS col1, - col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING CAST( NULL AS SIGNED ) = NULL
----

skipif mysql # not compatible
query III rowsort label-8586
SELECT - ( COUNT ( * ) ), 17 AS col1, - col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING CAST ( NULL AS INTEGER ) = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8587
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8587
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8588
SELECT col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0, col2 HAVING 10 + - + col0 + col0 + - + CAST( NULL AS DECIMAL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8588
SELECT col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0, col2 HAVING 10 + - + col0 + col0 + - + CAST ( NULL AS REAL ) IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 + - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8591
SELECT ALL - COUNT( * ) col0 FROM tab0 AS cor0 WHERE NULL BETWEEN + col0 * col0 - col0 / + col2 + 75 / col2 AND + 91 - - col1 GROUP BY col2 HAVING ( + COUNT( * ) ) NOT BETWEEN ( - col2 ) / 8 AND + CAST( - col2 AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8591
SELECT ALL - COUNT ( * ) col0 FROM tab0 AS cor0 WHERE NULL BETWEEN + col0 * col0 - col0 / + col2 + 75 / col2 AND + 91 - - col1 GROUP BY col2 HAVING ( + COUNT ( * ) ) NOT BETWEEN ( - col2 ) / 8 AND + CAST ( - col2 AS INTEGER )
----

query I rowsort
SELECT 49 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT( * ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT ( * ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 * + 40 AS col1 FROM tab1 GROUP BY col2
----
1800
2840
320

onlyif mysql # aggregate syntax: 
query I rowsort label-8595
SELECT ALL 78 * - + CASE + - 44 WHEN + - col2 THEN + - 95 * 39 ELSE NULL END * - col2 * - + COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8595
SELECT ALL 78 * - + CASE + - 44 WHEN + - col2 THEN + - 95 * 39 ELSE NULL END * - col2 * - + COUNT ( * ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT 79 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 14 + + - 38 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
-24
-24
-24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8598
SELECT ALL + + CAST( NULL AS SIGNED ) / + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8598
SELECT ALL + + CAST ( NULL AS INTEGER ) / + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) = - 29 GROUP BY col0
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8600
SELECT ALL - + CAST( + 65 AS DECIMAL ) * col0 FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING + - col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-8600
SELECT ALL - + CAST ( + 65 AS REAL ) * col0 FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING + - col0 IS NULL
----

query I rowsort
SELECT + + col2 * - 96 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-5568
-7584
-8352

onlyif mysql # aggregate syntax: 
query I rowsort label-8602
SELECT ALL ( 14 ) FROM tab2 GROUP BY col0, col2 HAVING NOT ( - + COUNT( * ) ) + + col0 * ( + COUNT( * ) ) / + COUNT( * ) + col0 - + 5 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8602
SELECT ALL ( 14 ) FROM tab2 GROUP BY col0, col2 HAVING NOT ( - + COUNT ( * ) ) + + col0 * ( + COUNT ( * ) ) / + COUNT ( * ) + col0 - + 5 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8603
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab1 cor0 WHERE col2 IS NOT NULL GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8603
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab1 cor0 WHERE col2 IS NOT NULL GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-8604
SELECT COUNT( * ) FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL BETWEEN - ( - ( - + COUNT( * ) ) ) * 90 AND + col1
----

skipif mysql # not compatible
query I rowsort label-8604
SELECT COUNT ( * ) FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL BETWEEN - ( - ( - + COUNT ( * ) ) ) * 90 AND + col1
----

query II rowsort
SELECT DISTINCT 38, + ( + 28 ) AS col0 FROM tab1 GROUP BY col2, col1
----
38
28

query I rowsort
SELECT - ( - col2 ) FROM tab2 AS cor0 WHERE NOT 36 = ( + + 60 ) GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL + - 81 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING + - col2 * 2 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8608
SELECT + MIN( 90 ) FROM tab0 GROUP BY col0 HAVING NOT + COUNT( * ) * 3 * - 53 - - col0 > 0
----
90
90
90

skipif mysql # not compatible
query I rowsort label-8608
SELECT + MIN ( 90 ) FROM tab0 GROUP BY col0 HAVING NOT + COUNT ( * ) * 3 * - 53 - - col0 > 0
----
90
90
90

onlyif mysql # aggregate syntax: 
query I rowsort label-8609
SELECT - + col2 AS col2 FROM tab1 WHERE NOT 12 + col2 - + + 8 / 69 - + col1 IS NOT NULL GROUP BY col2, col1 HAVING NOT - ( COUNT( * ) ) = - - COUNT( * ) * + - col2
----

skipif mysql # not compatible
query I rowsort label-8609
SELECT - + col2 AS col2 FROM tab1 WHERE NOT 12 + col2 - + + 8 / 69 - + col1 IS NOT NULL GROUP BY col2, col1 HAVING NOT - ( COUNT ( * ) ) = - - COUNT ( * ) * + - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8610
SELECT CAST( 69 AS SIGNED ) FROM tab1 GROUP BY col0
----
69
69
69

skipif mysql # not compatible
query I rowsort label-8610
SELECT CAST ( 69 AS INTEGER ) FROM tab1 GROUP BY col0
----
69
69
69

onlyif mysql # aggregate syntax: 
query II rowsort label-8611
SELECT col1 * + COUNT( * ), 64 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8611
SELECT col1 * + COUNT ( * ), 64 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 + - 35 * - col2 - - 16 AS col2 FROM tab0 GROUP BY col2, col2
----
1308
2702
832

query I rowsort
SELECT ALL - + 2 FROM tab0 AS cor0 GROUP BY col2
----
-2
-2
-2

query I rowsort
SELECT - col1 * + + col1 AS col2 FROM tab0 GROUP BY col1
----
-6561
0

onlyif mysql # aggregate syntax: 
query II rowsort label-8615
SELECT DISTINCT + col1 AS col1, ( - col2 ) FROM tab2 cor0 GROUP BY col1, col2 HAVING - COUNT( DISTINCT - col0 ) IS NOT NULL
----
41
-58
59
-79
61
-87

skipif mysql # not compatible
query II rowsort label-8615
SELECT DISTINCT + col1 AS col1, ( - col2 ) FROM tab2 cor0 GROUP BY col1, col2 HAVING - COUNT ( DISTINCT - col0 ) IS NOT NULL
----
41
-58
59
-79
61
-87

query II rowsort
SELECT ALL col2, - 57 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
-57
38
-57
79
-57

onlyif mysql # aggregate syntax: 
query I rowsort label-8617
SELECT DISTINCT COUNT( - + col0 ) FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN - - COUNT( ALL col1 ) AND col0 * - col0 + + col2 / - 27
----

skipif mysql # not compatible
query I rowsort label-8617
SELECT DISTINCT COUNT ( - + col0 ) FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN - - COUNT ( ALL col1 ) AND col0 * - col0 + + col2 / - 27
----

query I rowsort
SELECT col1 * 36 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - 29 / + - 99 + + + 26 IS NOT NULL
----
1584
2052
216

query I rowsort
SELECT 7 FROM tab1 GROUP BY col0, col2 HAVING NOT + - col0 + + - col2 IS NULL
----
7
7
7

onlyif mysql # aggregate syntax: 
query I rowsort label-8620
SELECT MIN( - + 70 ) AS col1 FROM tab2 GROUP BY col2, col2
----
-70
-70
-70

skipif mysql # not compatible
query I rowsort label-8620
SELECT MIN ( - + 70 ) AS col1 FROM tab2 GROUP BY col2, col2
----
-70
-70
-70

onlyif mysql # aggregate syntax: 
query I rowsort label-8621
SELECT ALL 75 AS col1 FROM tab2 GROUP BY col0, col1 HAVING - + col1 <> col1 + COUNT( * )
----
75
75
75

skipif mysql # not compatible
query I rowsort label-8621
SELECT ALL 75 AS col1 FROM tab2 GROUP BY col0, col1 HAVING - + col1 <> col1 + COUNT ( * )
----
75
75
75

onlyif mysql # aggregate syntax: 
query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT ( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8623
SELECT + COUNT( * ) DIV + - 99 - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8623
SELECT + COUNT ( * ) / + - 99 - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT 98 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
98

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8625
SELECT MAX( DISTINCT - NULLIF ( CAST( NULL AS SIGNED ), ( - + col2 ) ) ) + + col2 FROM tab0 GROUP BY col1, col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8625
SELECT MAX ( DISTINCT - NULLIF ( CAST ( NULL AS INTEGER ), ( - + col2 ) ) ) + + col2 FROM tab0 GROUP BY col1, col1, col2
----
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-8626
SELECT DISTINCT - COUNT( * ) FROM tab0 cor0 GROUP BY col1
----
-1
-2

skipif mysql # not compatible
query I rowsort label-8626
SELECT DISTINCT - COUNT ( * ) FROM tab0 cor0 GROUP BY col1
----
-1
-2

query I rowsort
SELECT - 70 + - - col2 * - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1514
-6311
-646

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8628
SELECT 7 / + - ( - col0 ) / col0 FROM tab1 GROUP BY col0 HAVING NOT + + COUNT( * ) = + + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-8628
SELECT 7 / + - ( - col0 ) / col0 FROM tab1 GROUP BY col0 HAVING NOT + + COUNT ( * ) = + + CAST ( NULL AS INTEGER )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8629
SELECT + + COUNT( * ) + ( + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
2
82

skipif mysql # not compatible
query I rowsort label-8629
SELECT + + COUNT ( * ) + ( + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
2
82

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL = NULL
----

query II rowsort
SELECT DISTINCT + col1 + - + 16, col1 AS col0 FROM tab2 GROUP BY col1, col1
----
25
41
43
59
45
61

onlyif mysql # aggregate syntax: 
query I rowsort label-8632
SELECT + - COUNT( * ) + + 87 + - col0 * + 23 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-1823
-512
-903

skipif mysql # not compatible
query I rowsort label-8632
SELECT + - COUNT ( * ) + + 87 + - col0 * + 23 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-1823
-512
-903

query II rowsort
SELECT ALL + 57 AS col1, col0 AS col2 FROM tab2 GROUP BY col0
----
57
15
57
91
57
92

onlyif mysql # aggregate syntax: 
query I rowsort label-8634
SELECT DISTINCT + COUNT( * ) AS col2 FROM tab0 GROUP BY col1, col1
----
1
2

skipif mysql # not compatible
query I rowsort label-8634
SELECT DISTINCT + COUNT ( * ) AS col2 FROM tab0 GROUP BY col1, col1
----
1
2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 60 col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - col0 - + 7 IS NULL
----
60
60
60

onlyif mysql # aggregate syntax: 
query I rowsort label-8636
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1 HAVING NOT - col1 / + COUNT( * ) * col1 * + col0 IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-8636
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1 HAVING NOT - col1 / + COUNT ( * ) * col1 * + col0 IS NULL
----
41
59
61

onlyif mysql # aggregate syntax: 
query I rowsort label-8637
SELECT ALL + 59 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( col2, col2 + - ( - + CASE + 57 WHEN + COUNT( * ) THEN - MIN( DISTINCT col2 ) WHEN - col2 * - - 27 THEN NULL ELSE - COUNT( * ) + + col0 END ), MIN( - 52 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8637
SELECT ALL + 59 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( col2, col2 + - ( - + CASE + 57 WHEN + COUNT ( * ) THEN - MIN ( DISTINCT col2 ) WHEN - col2 * - - 27 THEN NULL ELSE - COUNT ( * ) + + col0 END ), MIN ( - 52 ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8638
SELECT ALL - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8638
SELECT ALL - COUNT ( * ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + 82 col2 FROM tab1 AS cor0 GROUP BY col2
----
11
37
74

query I rowsort
SELECT DISTINCT + 60 FROM tab0 GROUP BY col1
----
60

query I rowsort
SELECT + ( + col0 ) AS col2 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL 64 * - col1 FROM tab1 GROUP BY col1
----
-2816
-3648
-384

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8643
SELECT ALL - - col2 + + - 69 * - - CAST( NULL AS SIGNED ) + 22 AS col0, CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL
NULL
NULL
NULL

skipif mysql # not compatible
query II rowsort label-8643
SELECT ALL - - col2 + + - 69 * - - CAST ( NULL AS INTEGER ) + 22 AS col0, CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL
NULL
NULL
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-8644
SELECT + - 8 * + + col2 * - 46 + - COUNT( * ) FROM tab0 cor0 WHERE NOT + col1 - + col2 IS NOT NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-8644
SELECT + - 8 * + + col2 * - 46 + - COUNT ( * ) FROM tab0 cor0 WHERE NOT + col1 - + col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - + 48 AS col1 FROM tab0 AS cor0 WHERE + ( - col2 ) + col2 = + + col0 GROUP BY col2, col1
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT ( + + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8648
SELECT ALL ( col0 ) FROM tab0 GROUP BY col2, col1, col0 HAVING NOT NULL IN ( CAST( NULL AS SIGNED ) + - NULLIF ( col1, + + col1 / - - col1 + - col0 / + col0 ) )
----

skipif mysql # not compatible
query I rowsort label-8648
SELECT ALL ( col0 ) FROM tab0 GROUP BY col2, col1, col0 HAVING NOT NULL IN ( CAST ( NULL AS INTEGER ) + - NULLIF ( col1, + + col1 / - - col1 + - col0 / + col0 ) )
----

query I rowsort
SELECT + ( - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT - 49 IS NOT NULL
----

query I rowsort
SELECT 30 * + col1 FROM tab1 GROUP BY col1, col1
----
1320
1710
180

query I rowsort
SELECT DISTINCT ( + + 11 ) FROM tab1 GROUP BY col2
----
11

query II rowsort
SELECT DISTINCT - col1 AS col1, 91 / + ( - 25 ) AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL - + 10 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
16
33
73

onlyif mysql # aggregate syntax: 
query I rowsort label-8654
SELECT - + 48 * COUNT( * ) FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NOT NULL NOT IN ( - + col2, COUNT( * ), col2 / + 30 + + COUNT( * ), - 19 )
----

skipif mysql # not compatible
query I rowsort label-8654
SELECT - + 48 * COUNT ( * ) FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NOT NULL NOT IN ( - + col2, COUNT ( * ), col2 / + 30 + + COUNT ( * ), - 19 )
----

onlyif mysql # aggregate syntax: 
query II rowsort label-8655
SELECT DISTINCT 84 AS col0, + col0 * + MIN( + ( - - col2 ) ) * 69 FROM tab1 GROUP BY col0, col2
----
84
12144
84
401718
84
86940

skipif mysql # not compatible
query II rowsort label-8655
SELECT DISTINCT 84 AS col0, + col0 * + MIN ( + ( - - col2 ) ) * 69 FROM tab1 GROUP BY col0, col2
----
84
12144
84
401718
84
86940

onlyif mysql # aggregate syntax: 
query I rowsort label-8656
SELECT DISTINCT col2 + 84 + - col0 - - + col2 * col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT col0 * - + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8656
SELECT DISTINCT col2 + 84 + - col0 - - + col2 * col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT col0 * - + COUNT ( * ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8657
SELECT DISTINCT COUNT( * ) DIV + col1 FROM tab1 GROUP BY col1, col1
----
0

skipif mysql # not compatible
query I rowsort label-8657
SELECT DISTINCT COUNT ( * ) / + col1 FROM tab1 GROUP BY col1, col1
----
0

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query II rowsort label-8658
SELECT DISTINCT + col2, CAST( AVG ( ALL + 13 ) AS SIGNED ) DIV + MAX( DISTINCT 87 ) FROM tab0 cor0 GROUP BY col2, col2
----
24
0
38
0
79
0

skipif mysql # not compatible
query II rowsort label-8658
SELECT DISTINCT + col2, CAST ( AVG ( ALL + 13 ) AS INTEGER ) / + MAX ( DISTINCT 87 ) FROM tab0 cor0 GROUP BY col2, col2
----
24
0
38
0
79
0

query I rowsort
SELECT DISTINCT - ( + 11 ) AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-11

onlyif mysql # aggregate syntax: 
query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT( * ) AND - - 79
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT ( * ) AND - - 79
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8661
SELECT ALL col0 DIV col0 * - - col0 * col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

skipif mysql # not compatible
query I rowsort label-8661
SELECT ALL col0 / col0 * - - col0 * col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

onlyif mysql # aggregate syntax: 
query I rowsort label-8662
SELECT + COUNT( * ) + + + 13 FROM tab2 AS cor0 GROUP BY col0
----
14
14
14

skipif mysql # not compatible
query I rowsort label-8662
SELECT + COUNT ( * ) + + + 13 FROM tab2 AS cor0 GROUP BY col0
----
14
14
14

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 78 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 85 IS NOT NULL
----
78
78
78

onlyif mysql # aggregate syntax: 
query I rowsort label-8664
SELECT - - 89 * 45 * - COUNT( * ) FROM tab2 WHERE NOT 94 * + 72 > NULL GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8664
SELECT - - 89 * 45 * - COUNT ( * ) FROM tab2 WHERE NOT 94 * + 72 > NULL GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT ALL 32 * - col2 + - + col2 - - - col2 AS col1, col2 FROM tab2 GROUP BY col2
----
-1972
58
-2686
79
-2958
87

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-8666
SELECT DISTINCT - 13 - - - COUNT( * ) DIV + - col0 AS col1, + col0 * - NULLIF ( + - ( + col0 ), + 89 ) FROM tab2 AS cor0 GROUP BY col0
----
-13
225
-13
8281
-13
8464

skipif mysql # not compatible
query II rowsort label-8666
SELECT DISTINCT - 13 - - - COUNT ( * ) / + - col0 AS col1, + col0 * - NULLIF ( + - ( + col0 ), + 89 ) FROM tab2 AS cor0 GROUP BY col0
----
-13
225
-13
8281
-13
8464

onlyif mysql # aggregate syntax: 
query I rowsort label-8667
SELECT DISTINCT - 55 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT( DISTINCT col2 ) IS NULL
----
-55

skipif mysql # not compatible
query I rowsort label-8667
SELECT DISTINCT - 55 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT COUNT ( DISTINCT col2 ) IS NULL
----
-55

onlyif mysql # aggregate syntax: 
query I rowsort label-8668
SELECT + - ( + col1 ) * + col1 + - COUNT( col1 ) + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1981
-3307
-43

skipif mysql # not compatible
query I rowsort label-8668
SELECT + - ( + col1 ) * + col1 + - COUNT ( col1 ) + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1981
-3307
-43

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8669
SELECT ALL 85 + COUNT( * ) FROM tab0 AS cor0 WHERE ( 87 * CAST( + - 44 AS SIGNED ) ) IS NOT NULL GROUP BY col0
----
86
86
86

skipif mysql # not compatible
query I rowsort label-8669
SELECT ALL 85 + COUNT ( * ) FROM tab0 AS cor0 WHERE ( 87 * CAST ( + - 44 AS INTEGER ) ) IS NOT NULL GROUP BY col0
----
86
86
86

query I rowsort
SELECT col1 + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT - 28 / - NULLIF ( - + AVG ( DISTINCT - col1 ), col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8672
SELECT ALL - col0 - + COALESCE ( + COUNT( * ), - - 36 ) FROM tab2 WHERE NULL <= col1 + - - 77 GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-8672
SELECT ALL - col0 - + COALESCE ( + COUNT ( * ), - - 36 ) FROM tab2 WHERE NULL <= col1 + - - 77 GROUP BY col0, col2
----

query I rowsort
SELECT + 69 FROM tab1 GROUP BY col0
----
69
69
69

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( + 60, - + col1, + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
60

query I rowsort
SELECT + 37 FROM tab2 AS cor0 GROUP BY col1, col1
----
37
37
37

onlyif mysql # aggregate syntax: 
query I rowsort label-8676
SELECT - COUNT( * ) * + col1 + + + SUM( DISTINCT - 45 ) AS col2 FROM tab2 AS cor0 WHERE NULL >= - col2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8676
SELECT - COUNT ( * ) * + col1 + + + SUM ( DISTINCT - 45 ) AS col2 FROM tab2 AS cor0 WHERE NULL >= - col2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + 62 FROM tab2 GROUP BY col1
----
62
62
62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 96 * + cor0.col2 col1 FROM tab1 AS cor0 GROUP BY cor0.col2, col1
----
-4320
-6816
-768

query I rowsort
SELECT ALL 0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT - + 82 AS col0 FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
-82
-82
-82

query I rowsort
SELECT - + tab0.col0 AS col1 FROM tab0 GROUP BY tab0.col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - 13 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-13

query I rowsort
SELECT ALL ( 41 ) * + cor0.col2 AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
1845
2911
328

query I rowsort
SELECT DISTINCT 27 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
27

query I rowsort
SELECT ALL + 7 + + cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
31
45
86

query I rowsort
SELECT ALL cor0.col2 FROM tab1, tab1 cor0 GROUP BY cor0.col2
----
45
71
8

query I rowsort
SELECT ALL - 88 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-88
-88

query I rowsort
SELECT - 72 * - cor0.col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, cor0.col2
----
3240
5112
576

query I rowsort
SELECT DISTINCT cor0.col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT 47 - - 4 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
51

query I rowsort
SELECT - cor0.col2 * cor0.col1 - - cor0.col2 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-2320
-4582
-5220

query I rowsort
SELECT DISTINCT + 79 FROM tab1 AS cor0 GROUP BY cor0.col2
----
79

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT 85 FROM tab1 AS cor0 GROUP BY cor0.col0
----
85

query I rowsort
SELECT DISTINCT - 13 AS col1 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
-13

query I rowsort
SELECT - cor0.col0 AS col1 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT 26 - cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-15
-33
-35

query I rowsort
SELECT DISTINCT + 10 - 25 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-15

query I rowsort
SELECT cor0.col2 * 54 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
2430
3834
432

query I rowsort
SELECT 92 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col2
----
92
92
92

query I rowsort
SELECT + 3 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
3
3
3

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8702
SELECT - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8702
SELECT - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1
----
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 43 col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
43

query I rowsort
SELECT DISTINCT + cor0.col0 * 1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 2 col1 FROM tab2 AS cor0 GROUP BY cor0.col1, col0
----
2
2
2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8706
SELECT ALL + CAST( NULL AS SIGNED ) * 17 * - cor0.col2 col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8706
SELECT ALL + CAST ( NULL AS INTEGER ) * 17 * - cor0.col2 col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT 2 * cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
164
44
56

query I rowsort
SELECT - 95 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-95
-95
-95

query I rowsort
SELECT + + 43 FROM tab1 GROUP BY tab1.col2
----
43
43
43

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 50 col1 FROM tab2 GROUP BY tab2.col2
----
50
50
50

query I rowsort
SELECT + 33 AS col0 FROM tab0 GROUP BY col1
----
33
33

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8712
SELECT DISTINCT CAST( NULL AS SIGNED ) + 22 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8712
SELECT DISTINCT CAST ( NULL AS INTEGER ) + 22 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT 75 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
75
75
75

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 86 + cor0.col0 * cor0.col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
1935
6975
762

query I rowsort
SELECT cor0.col1 * cor0.col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
1936
3249
36

query I rowsort
SELECT - tab0.col1 * - 74 AS col1 FROM tab0 GROUP BY col1
----
0
5994

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - cor0.col0 * 50 col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1300
-2150
-4150

query I rowsort
SELECT DISTINCT 71 AS col2 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col0
----
71

query I rowsort
SELECT 45 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
45
45
45

query I rowsort
SELECT 95 - 7 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
88
88
88

query I rowsort
SELECT - + 43 AS col0 FROM tab0, tab0 cor0 GROUP BY tab0.col2
----
-43
-43
-43

query I rowsort
SELECT DISTINCT 22 FROM tab2 cor0 GROUP BY cor0.col2
----
22

query I rowsort
SELECT DISTINCT 97 FROM tab1 AS cor0 GROUP BY cor0.col1
----
97

query I rowsort
SELECT DISTINCT ( 61 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
61

query I rowsort
SELECT 27 FROM tab1 AS cor0 CROSS JOIN tab0 cor1 GROUP BY cor0.col0
----
27
27
27

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 44 col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
44
44
44

query I rowsort
SELECT ALL + 14 FROM tab0 AS cor0 GROUP BY cor0.col2
----
14
14
14

query I rowsort
SELECT cor0.col2 + + 25 + - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-32
104
63

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8730
SELECT + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8730
SELECT + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT ALL - 9 AS col1 FROM tab0 cor0 GROUP BY col0
----
-9
-9
-9

query I rowsort
SELECT + cor0.col2 * + ( + col2 ) * col2 - cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, cor0.col0
----
13800
492960
54834

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8733
SELECT ALL - cor0.col0 * CAST( NULL AS DECIMAL ) + - cor0.col1 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8733
SELECT ALL - cor0.col0 * CAST ( NULL AS REAL ) + - cor0.col1 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-8734
SELECT ALL 26 DIV - cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-4
0
0

skipif mysql # not compatible
query I rowsort label-8734
SELECT ALL 26 / - cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-4
0
0

query I rowsort
SELECT - cor0.col1 * + ( - 63 + + cor0.col1 ) FROM tab2 cor0 GROUP BY cor0.col1
----
122
236
902

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT tab0.col0 * + ( 37 ) * tab0.col0 col0 FROM tab0 GROUP BY tab0.col0
----
25012
254893
68413

query I rowsort
SELECT DISTINCT + 7 AS col1 FROM tab2, tab2 AS cor0 GROUP BY tab2.col1
----
7

query I rowsort
SELECT 24 FROM tab1 AS cor0 GROUP BY cor0.col1
----
24
24
24

query I rowsort
SELECT ALL 40 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
40
40
40

query I rowsort
SELECT - 12 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-12
-12
-12

onlyif mysql # DIV for integer division: 
query I rowsort label-8741
SELECT + cor0.col1 + 15 DIV + cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-8741
SELECT + cor0.col1 + 15 / + cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT 73 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
73

query I rowsort
SELECT DISTINCT - 32 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-32

query I rowsort
SELECT ALL - 84 + + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1
-41
-58

query I rowsort
SELECT 61 FROM tab0 AS cor0 GROUP BY cor0.col2
----
61
61
61

query I rowsort
SELECT ALL - cor0.col0 + + cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-12
-34
72

query I rowsort
SELECT - col1 * 58 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-2552
-3306
-348

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8748
SELECT COALESCE ( - cor0.col2, - CAST( NULL AS SIGNED ) ) + cor0.col2 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-8748
SELECT COALESCE ( - cor0.col2, - CAST ( NULL AS INTEGER ) ) + cor0.col2 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
0

query I rowsort
SELECT - 26 * cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2132
-572
-728

query I rowsort
SELECT + 6 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col2
----
6
6
6

query I rowsort
SELECT - + 83 FROM tab0 GROUP BY col0
----
-83
-83
-83

query I rowsort
SELECT DISTINCT - 54 FROM tab1 AS cor0 CROSS JOIN tab0 cor1 GROUP BY cor0.col2
----
-54

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT ALL ( col1 ) FROM tab0 cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT + cor0.col1 * 10 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
810

query I rowsort
SELECT DISTINCT - 17 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-17

query I rowsort
SELECT DISTINCT + 10 AS col1 FROM tab0, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col0
----
10

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8758
SELECT DISTINCT - cor0.col0 + - CAST( NULL AS DECIMAL ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL

skipif mysql # not compatible
query I rowsort label-8758
SELECT DISTINCT - cor0.col0 + - CAST ( NULL AS REAL ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL

query I rowsort
SELECT ALL cor0.col0 + 87 FROM tab1 AS cor0 GROUP BY col0
----
109
115
169

query I rowsort
SELECT + 89 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
89
89
89

query I rowsort
SELECT ALL - - 88 FROM tab0, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
88
88
88

onlyif mysql # DIV for integer division: 
query I rowsort label-8762
SELECT ALL 70 DIV + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1
2

skipif mysql # not compatible
query I rowsort label-8762
SELECT ALL 70 / + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1
2

query I rowsort
SELECT DISTINCT + - cor0.col0 * - 80 FROM tab0, tab0 AS cor0 GROUP BY cor0.col0
----
2080
3440
6640

query I rowsort
SELECT + 43 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
43
43
43

query I rowsort
SELECT 74 + - 63 FROM tab2 AS cor0 GROUP BY cor0.col2
----
11
11
11

query I rowsort
SELECT - NULLIF ( cor0.col2, - cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-24
-38
-79

query I rowsort
SELECT 44 + + 56 FROM tab0 AS cor0 GROUP BY col1
----
100
100

query I rowsort
SELECT ALL - - ( 84 ) AS col1 FROM tab2 GROUP BY tab2.col1
----
84
84
84

query I rowsort
SELECT ALL 74 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
74
74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 76 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
76
76

query I rowsort
SELECT + - col0 AS col0 FROM tab2 GROUP BY tab2.col0
----
-15
-91
-92

query I rowsort
SELECT cor0.col2 * 77 AS col2 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
1848
2926
6083

onlyif mysql # DIV for integer division: 
query I rowsort label-8773
SELECT cor0.col0 DIV 6 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
13
3
4

skipif mysql # not compatible
query I rowsort label-8773
SELECT cor0.col0 / 6 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
13
3
4

query I rowsort
SELECT cor0.col2 * - col2 - - cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col2
----
-3306
-6162
-7482

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 56 col1 FROM tab0 GROUP BY tab0.col1
----
56
56

query I rowsort
SELECT ALL - - 68 FROM tab0 GROUP BY col1
----
68
68

query I rowsort
SELECT col0 * cor0.col0 * NULLIF ( cor0.col0, - cor0.col0 ) + 36 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
10684
21988
551404

query I rowsort
SELECT + col0 * + 90 + - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col1
----
2314
3827
7387

query I rowsort
SELECT - 68 AS col0 FROM tab1, tab2 AS cor0 GROUP BY tab1.col1
----
-68
-68
-68

query I rowsort
SELECT 32 FROM tab0 AS cor0 GROUP BY cor0.col0
----
32
32
32

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8781
SELECT - CAST( NULL AS SIGNED ) + 52 * cor0.col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8781
SELECT - CAST ( NULL AS INTEGER ) + 52 * cor0.col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 95 * + 58 - cor0.col2 * cor0.col2 FROM tab1 AS cor0 GROUP BY col2
----
3485
469
5446

query I rowsort
SELECT cor0.col1 * - cor0.col1 + 67 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-1614
-3414
-3654

query I rowsort
SELECT DISTINCT 37 + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
108
45
82

query I rowsort
SELECT - 76 + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-38
-52
3

query I rowsort
SELECT DISTINCT + ( cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
58
79
87

query I rowsort
SELECT DISTINCT cor0.col1 * 72 FROM tab2 AS cor0 GROUP BY cor0.col1
----
2952
4248
4392

query I rowsort
SELECT DISTINCT - 35 FROM tab1, tab0 AS cor0 GROUP BY cor0.col0
----
-35

onlyif mysql # DIV for integer division: 
query I rowsort label-8789
SELECT ALL cor0.col2 + - col2 DIV + cor0.col2 FROM tab2 cor0 GROUP BY cor0.col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-8789
SELECT ALL cor0.col2 + - col2 / + cor0.col2 FROM tab2 cor0 GROUP BY cor0.col2
----
57
78
86

query I rowsort
SELECT ALL 37 FROM tab1 AS cor0 GROUP BY cor0.col2
----
37
37
37

query I rowsort
SELECT DISTINCT + - cor0.col2 FROM tab1, tab2 cor0 GROUP BY cor0.col2
----
-58
-79
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8792
SELECT DISTINCT cor0.col0 + + CAST( NULL AS SIGNED ) FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
NULL

skipif mysql # not compatible
query I rowsort label-8792
SELECT DISTINCT cor0.col0 + + CAST ( NULL AS INTEGER ) FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
NULL

query I rowsort
SELECT ALL cor0.col0 * 22 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
2002
2024
330

query I rowsort
SELECT DISTINCT + cor0.col1 * - cor0.col1 FROM tab2 cor0 GROUP BY cor0.col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + cor0.col1 + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
114
12
88

query I rowsort
SELECT + 74 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
74
74
74

query I rowsort
SELECT + ( 69 ) * + 28 AS col1 FROM tab2 GROUP BY tab2.col2
----
1932
1932
1932

query I rowsort
SELECT DISTINCT - cor0.col2 * 40 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-2320
-3160
-3480

query I rowsort
SELECT DISTINCT - 79 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-79

query I rowsort
SELECT ALL - 60 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-60
-60
-60

query I rowsort
SELECT DISTINCT 76 * - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-6156
0

query I rowsort
SELECT + ( + cor0.col1 * col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT + cor1.col2 AS col2 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col2
----
24
38
79

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8804
SELECT ALL - CAST( NULL AS DECIMAL ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8804
SELECT ALL - CAST ( NULL AS REAL ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT + cor0.col1 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
----
44
57
6

query I rowsort
SELECT 40 FROM tab0 AS cor0 GROUP BY cor0.col0
----
40
40
40

query I rowsort
SELECT + + 2 FROM tab1, tab2 AS cor0, tab0 AS cor1 GROUP BY cor1.col2
----
2
2
2

query I rowsort
SELECT + 84 FROM tab1 AS cor0 GROUP BY cor0.col2
----
84
84
84

query I rowsort
SELECT ALL - 3 FROM tab2 AS cor0 GROUP BY col1
----
-3
-3
-3

query I rowsort
SELECT ALL 8 FROM tab2 GROUP BY tab2.col1
----
8
8
8

query I rowsort
SELECT DISTINCT + + 2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col2
----
2

onlyif mysql # DIV for integer division: 
query I rowsort label-8812
SELECT 22 DIV - cor0.col2 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-8812
SELECT 22 / - cor0.col2 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 27 * 41 col0 FROM tab2 GROUP BY col2
----
-1107

query I rowsort
SELECT 58 * + cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
5278
5336
870

query I rowsort
SELECT DISTINCT - 97 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2
----
-97

query I rowsort
SELECT ALL 6 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
6
6
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8817
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8817
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 91 FROM tab2 AS cor0 GROUP BY cor0.col2
----
91
91
91

onlyif mysql # DIV for integer division: 
query I rowsort label-8819
SELECT ALL 67 DIV cor0.col2 - + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0, cor0.col2
----
-22
-37
-79

skipif mysql # not compatible
query I rowsort label-8819
SELECT ALL 67 / cor0.col2 - + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0, cor0.col2
----
-22
-37
-79

query I rowsort
SELECT - cor0.col2 + - 71 AS col2 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-116
-142
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - 71 col2 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
71

query I rowsort
SELECT - 20 FROM tab1, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col2
----
-20
-20
-20

onlyif mysql # DIV for integer division: 
query I rowsort label-8823
SELECT - cor0.col1 DIV + 69 FROM tab1 cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-8823
SELECT - cor0.col1 / + 69 FROM tab1 cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT ALL cor0.col1 * - cor0.col1 AS col2 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
----
-6561
0

query I rowsort
SELECT ALL 27 FROM tab0 AS cor0 GROUP BY cor0.col1
----
27
27

query I rowsort
SELECT ALL - 88 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-88
-88
-88

query I rowsort
SELECT DISTINCT - 70 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-151
-70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 1 + cor0.col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
1
82

query I rowsort
SELECT ALL - 75 + cor0.col0 * + cor0.col0 + + 47 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
197
8253
8436

query I rowsort
SELECT ALL 75 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
75
75
75

query I rowsort
SELECT 66 * cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1584
2508
5214

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY cor0.col0
----
-26
-43
-83

query I rowsort
SELECT + 95 FROM tab1, tab2 AS cor0 GROUP BY cor0.col2
----
95
95
95

query I rowsort
SELECT DISTINCT 91 FROM tab2 AS cor0 GROUP BY cor0.col0
----
91

query I rowsort
SELECT ALL cor0.col2 AS col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col2
----
58
79
87

query I rowsort
SELECT cor0.col0 + + cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
164
44
56

query I rowsort
SELECT ALL - cor0.col0 + + 59 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0, col0
----
-24
16
33

query I rowsort
SELECT - 70 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-70
-70
-70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 95 col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col1
----
-95
-95

query I rowsort
SELECT ALL - 77 FROM tab2, tab1 AS cor0 GROUP BY tab2.col1
----
-77
-77
-77

query I rowsort
SELECT DISTINCT + cor0.col1 + + 63 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
144
63

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8842
SELECT + CAST( NULL AS SIGNED ) * - 65 + + cor0.col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8842
SELECT + CAST ( NULL AS INTEGER ) * - 65 + + cor0.col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1, cor0.col0
----
15
91
92

query I rowsort
SELECT 41 AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
41
41
41

query I rowsort
SELECT DISTINCT + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
41
59
61

query I rowsort
SELECT 40 AS col0 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col2
----
40
40
40

query I rowsort
SELECT DISTINCT 86 FROM tab2 AS cor0 GROUP BY cor0.col2
----
86

query I rowsort
SELECT ALL - 51 AS col1 FROM tab2, tab1 AS cor0, tab1 AS cor1 GROUP BY cor0.col2
----
-51
-51
-51

query I rowsort
SELECT col1 - + cor0.col1 * ( + 47 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-1886
-2714
-2806

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL cor0.col1 + cor0.col1 + - cor0.col0 * cor0.col0 col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-1687
-676
-6889

query I rowsort
SELECT 14 FROM tab0 AS cor0 GROUP BY cor0.col1
----
14
14

query I rowsort
SELECT 39 * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1599
2301
2379

query I rowsort
SELECT 89 * - cor0.col2 FROM tab1 AS cor0 GROUP BY col2
----
-4005
-6319
-712

query I rowsort
SELECT - ( 48 ) * - 24 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
1152
1152
1152

query I rowsort
SELECT DISTINCT 34 AS col1 FROM tab0 cor0 GROUP BY cor0.col0
----
34

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 25 col1 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col1
----
25

query I rowsort
SELECT 76 * cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1140
6916
6992

query I rowsort
SELECT ALL cor0.col0 * - cor0.col0 - + cor0.col0 * 82 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-13695
-2808
-5375

query I rowsort
SELECT ALL 96 + + ( cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0, col0
----
118
124
178

query I rowsort
SELECT cor0.col1 * - cor0.col2 FROM tab1 AS cor0 GROUP BY col1, cor0.col2
----
-2565
-3124
-48

onlyif mysql # DIV for integer division: 
query I rowsort label-8861
SELECT 62 DIV cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
0
0
1

skipif mysql # not compatible
query I rowsort label-8861
SELECT 62 / cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
0
0
1

query I rowsort
SELECT ALL 47 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
47
47
47

query I rowsort
SELECT ALL - 71 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-71
-71
-71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT cor0.col1 * col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - ( 49 ) col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-49

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8866
SELECT DISTINCT - CAST( NULL AS DECIMAL ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8866
SELECT DISTINCT - CAST ( NULL AS REAL ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 66 col0 FROM tab1 AS cor0 GROUP BY col2
----
66

onlyif mysql # DIV for integer division: 
query I rowsort label-8868
SELECT cor0.col1 DIV + ( - cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8868
SELECT cor0.col1 / + ( - cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-1
-1
-1

query I rowsort
SELECT - col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-81
0

query I rowsort
SELECT ALL 70 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
70
70
70

query I rowsort
SELECT DISTINCT + cor0.col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + cor0.col2 * cor0.col1 * ( cor0.col2 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
46656

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 33 - cor0.col0 col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
-58
-59
18

query I rowsort
SELECT ALL + 14 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
14
14
14

query I rowsort
SELECT DISTINCT - cor0.col2 + - ( - 48 ) FROM tab1 AS cor0 GROUP BY col2
----
-23
3
40

query I rowsort
SELECT 24 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
24
24

query I rowsort
SELECT DISTINCT 94 FROM tab0 cor0 GROUP BY cor0.col0
----
94

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8878
SELECT - CAST( NULL AS SIGNED ) AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8878
SELECT - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8879
SELECT - CAST( NULL AS SIGNED ) FROM tab2 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8879
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 77 AS col0 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col2
----
77
77
77

query I rowsort
SELECT cor0.col0 * 3 FROM tab0 AS cor0 GROUP BY cor0.col0
----
129
249
78

query I rowsort
SELECT 51 - cor0.col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-28
-36
-7

query I rowsort
SELECT DISTINCT 16 FROM tab0 AS cor0 GROUP BY cor0.col2
----
16

query I rowsort
SELECT + 30 * 50 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
1500
1500
1500

query I rowsort
SELECT DISTINCT - 29 + col2 FROM tab0 GROUP BY col2
----
-5
50
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 30 col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-30
-30
-30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col2 - - 30 col2 FROM tab0 cor0 GROUP BY col2
----
109
54
68

query I rowsort
SELECT + ( NULLIF ( - cor0.col1, col1 ) ) FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-81
NULL

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY tab1.col1
----
-44
-57
-6

query I rowsort
SELECT + 94 + 31 FROM tab2 AS cor0 GROUP BY col2
----
125
125
125

query I rowsort
SELECT ALL - 80 - + 56 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-136
-136

query I rowsort
SELECT ALL + 6 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
6
6
6

query I rowsort
SELECT ALL 67 + tab1.col2 FROM tab1 GROUP BY tab1.col2
----
112
138
75

query I rowsort
SELECT DISTINCT cor0.col2 + cor0.col2 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
158
48
76

query I rowsort
SELECT 85 AS col2 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col1
----
85
85
85

query I rowsort
SELECT DISTINCT - cor0.col0 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-8897
SELECT cor0.col1 DIV 23 FROM tab0 cor0 GROUP BY cor0.col1
----
0
3

skipif mysql # not compatible
query I rowsort label-8897
SELECT cor0.col1 / 23 FROM tab0 cor0 GROUP BY cor0.col1
----
0
3

query I rowsort
SELECT + 90 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
90
90
90

query I rowsort
SELECT 95 FROM tab2 AS cor0 GROUP BY cor0.col2
----
95
95
95

query I rowsort
SELECT ALL 57 * 33 FROM tab1 AS cor0 GROUP BY cor0.col2
----
1881
1881
1881

query I rowsort
SELECT DISTINCT cor0.col0 - + 40 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-25
51
52

query I rowsort
SELECT + cor0.col0 * - 9 FROM tab2 AS cor0 GROUP BY col0
----
-135
-819
-828

query I rowsort
SELECT DISTINCT cor0.col0 * - 85 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
-1870
-2380
-6970

query I rowsort
SELECT ( + 65 ) FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
65
65
65

query I rowsort
SELECT ALL 86 + + cor0.col0 + cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, col1
----
112
169
210

query I rowsort
SELECT DISTINCT - 23 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
-23

query I rowsort
SELECT DISTINCT + + 14 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
14

query I rowsort
SELECT DISTINCT 62 + 95 FROM tab1 AS cor0 GROUP BY col2
----
157

query I rowsort
SELECT 3 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

query I rowsort
SELECT NULLIF ( cor0.col1 + - cor0.col2, 55 ) FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-17
-20
-26

query I rowsort
SELECT 94 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
94
94
94

query I rowsort
SELECT ALL + 50 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
50
50
50

query I rowsort
SELECT DISTINCT + - cor0.col1 FROM tab1, tab1 cor0 GROUP BY cor0.col1
----
-44
-57
-6

query I rowsort
SELECT ALL cor0.col1 + 29 AS col2 FROM tab2, tab2 cor0 GROUP BY cor0.col1
----
70
88
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 63 * + 5 * cor0.col1 col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
0
0
25515

query I rowsort
SELECT ALL 66 * col1 AS col1 FROM tab0 cor0 GROUP BY cor0.col1
----
0
5346

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 24 col2 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
24
24
24

query I rowsort
SELECT ALL + 22 FROM tab0 AS cor0 GROUP BY col0
----
22
22
22

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8919
SELECT CAST( NULL AS DECIMAL ) + tab1.col1 FROM tab1 GROUP BY tab1.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8919
SELECT CAST ( NULL AS REAL ) + tab1.col1 FROM tab1 GROUP BY tab1.col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( - 31 ) - cor0.col2 col2 FROM tab1 cor0 GROUP BY cor0.col0, col2
----
-102
-39
-76

query I rowsort
SELECT DISTINCT + 80 AS col2 FROM tab2, tab0 AS cor0 GROUP BY cor0.col1
----
80

query I rowsort
SELECT + 77 FROM tab2 cor0 GROUP BY cor0.col1
----
77
77
77

query I rowsort
SELECT 31 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
----
31
31
31

onlyif mysql # DIV for integer division: 
query I rowsort label-8924
SELECT 53 DIV 32 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8924
SELECT 53 / 32 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1
1
1

query I rowsort
SELECT ( - 4 ) FROM tab0 AS cor0 GROUP BY col1, col0
----
-4
-4
-4

query I rowsort
SELECT ALL 48 AS col0 FROM tab2 cor0 GROUP BY cor0.col0
----
48
48
48

query I rowsort
SELECT DISTINCT 73 FROM tab1 cor0 GROUP BY cor0.col2
----
73

onlyif mysql # DIV for integer division: 
query I rowsort label-8928
SELECT cor0.col0 * - 80 DIV - 10 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
120
728
736

skipif mysql # not compatible
query I rowsort label-8928
SELECT cor0.col0 * - 80 / - 10 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
120
728
736

query I rowsort
SELECT cor0.col2 * + 62 FROM tab1 cor0 GROUP BY col2
----
2790
4402
496

query I rowsort
SELECT ALL + cor0.col0 AS col2 FROM tab2, tab0 cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT + 40 * + 69 FROM tab0 GROUP BY col1
----
2760
2760

onlyif mysql # DIV for integer division: 
query I rowsort label-8932
SELECT + 63 DIV - 39 FROM tab0, tab1 cor0, tab0 AS cor1 GROUP BY cor0.col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8932
SELECT + 63 / - 39 FROM tab0, tab1 cor0, tab0 AS cor1 GROUP BY cor0.col1
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-8933
SELECT + cor0.col1 DIV + 40 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8933
SELECT + cor0.col1 / + 40 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1
1
1

query I rowsort
SELECT DISTINCT 3 FROM tab1 AS cor0 GROUP BY cor0.col0
----
3

query I rowsort
SELECT 52 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
52
52
52

query I rowsort
SELECT DISTINCT - 1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8937
SELECT - col1 + CAST( NULL AS SIGNED ) * + ( - 12 ) FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8937
SELECT - col1 + CAST ( NULL AS INTEGER ) * + ( - 12 ) FROM tab0 GROUP BY col1
----
NULL
NULL

query I rowsort
SELECT ( - cor0.col1 ) + - cor0.col1 FROM tab0 AS cor0 GROUP BY col0, cor0.col1, cor0.col0
----
-162
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 68 * - cor0.col2 col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3060
4828
544

query I rowsort
SELECT - 69 FROM tab2 cor0 GROUP BY col0
----
-69
-69
-69

query I rowsort
SELECT DISTINCT - 35 + 51 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
16

query I rowsort
SELECT + + cor0.col1 * - 55 FROM tab2, tab0 AS cor0 GROUP BY cor0.col1
----
-4455
0

query I rowsort
SELECT - 25 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-25
-25
-25

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 17 * - tab0.col2 col2 FROM tab0 GROUP BY tab0.col2
----
1343
408
646

query I rowsort
SELECT ALL cor0.col0 * 41 - 75 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
1073
3287
827

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8946
SELECT - CAST( NULL AS SIGNED ) FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8946
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 74 col1 FROM tab1 cor0 GROUP BY cor0.col1
----
74

query I rowsort
SELECT 31 AS col0 FROM tab2 GROUP BY col2
----
31
31
31

query I rowsort
SELECT 91 FROM tab0 AS cor0 GROUP BY cor0.col0
----
91
91
91

query I rowsort
SELECT + cor0.col0 * + 56 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
5096
5152
840

query I rowsort
SELECT ALL col0 * - cor0.col0 AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
-484
-6724
-784

query I rowsort
SELECT - 0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT DISTINCT - 32 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-32

query I rowsort
SELECT - 70 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-70
-70
-70

query I rowsort
SELECT ALL 74 + + cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
155
74

query I rowsort
SELECT DISTINCT - 60 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, col0
----
-60

query I rowsort
SELECT - 60 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-60
-60

query I rowsort
SELECT ALL + cor0.col1 + 64 FROM tab1 AS cor0 GROUP BY cor0.col1
----
108
121
70

query I rowsort
SELECT + 77 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
77
77

query I rowsort
SELECT ALL 31 FROM tab2 AS cor0 GROUP BY cor0.col2
----
31
31
31

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 GROUP BY cor0.col2
----
45
71
8

query I rowsort
SELECT DISTINCT + cor0.col0 FROM tab1 AS cor0 GROUP BY col0, cor0.col2
----
22
28
82

query I rowsort
SELECT cor0.col2 + cor0.col2 + + 47 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
137
189
63

onlyif mysql # DIV for integer division: 
query I rowsort label-8964
SELECT cor0.col0 + col0 DIV - cor0.col0 + - 98 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-17
-71
-77

skipif mysql # not compatible
query I rowsort label-8964
SELECT cor0.col0 + col0 / - cor0.col0 + - 98 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-17
-71
-77

onlyif mysql # DIV for integer division: 
query I rowsort label-8965
SELECT ALL 0 DIV 62 col0 FROM tab2, tab0 AS cor0, tab0 cor1 GROUP BY cor0.col2
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8965
SELECT ALL 0 / 62 col0 FROM tab2, tab0 AS cor0, tab0 cor1 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT - 35 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-35
-35

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + ( cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT 50 * - col0 FROM tab2 cor0 GROUP BY cor0.col0
----
-4550
-4600
-750

query I rowsort
SELECT ( - 49 ) * - cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
2842
3871
4263

query I rowsort
SELECT + 91 + 92 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
183
183
183

query I rowsort
SELECT DISTINCT 4 + 57 * - cor0.col1 * - 39 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
126715
13342
97816

query I rowsort
SELECT ALL - 56 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-56
-56
-56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8974
SELECT DISTINCT + 50 + - 51 * cor0.col2 * + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL

skipif mysql # not compatible
query I rowsort label-8974
SELECT DISTINCT + 50 + - 51 * cor0.col2 * + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL

query I rowsort
SELECT cor0.col2 * - 94 + + cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-5394
-7347
-8091

query I rowsort
SELECT cor0.col1 + + cor0.col1 FROM tab0 cor0 GROUP BY cor0.col1
----
0
162

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8977
SELECT ALL CAST( NULL AS SIGNED ) * + 1 AS col2 FROM tab0 cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8977
SELECT ALL CAST ( NULL AS INTEGER ) * + 1 AS col2 FROM tab0 cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT + 98 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
98
98
98

query I rowsort
SELECT ALL - 71 FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
-71
-71
-71

query I rowsort
SELECT ALL 88 FROM tab1 cor0 GROUP BY cor0.col2
----
88
88
88

query I rowsort
SELECT 61 FROM tab1 AS cor0 GROUP BY cor0.col0
----
61
61
61

query I rowsort
SELECT DISTINCT 80 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
80

query I rowsort
SELECT + ( + 43 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
43
43
43

query I rowsort
SELECT 91 FROM tab1 AS cor0 GROUP BY col0, cor0.col0, cor0.col0
----
91
91
91

query I rowsort
SELECT - 20 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
-20
-20
-20

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8986
SELECT + CAST( NULL AS SIGNED ) + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8986
SELECT + CAST ( NULL AS INTEGER ) + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT cor0.col1 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col1 * - cor0.col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1936
-3249
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( 90 ) * 75 col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
6750

query I rowsort
SELECT + cor0.col2 + ( 1 ) * + 25 FROM tab0 AS cor0 GROUP BY cor0.col2
----
104
49
63

query I rowsort
SELECT - cor0.col1 * + 4 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-324
0
0

query I rowsort
SELECT DISTINCT cor0.col0 * - 86 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col0
----
-2236
-3698
-7138

query I rowsort
SELECT 2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
2
2
2

query I rowsort
SELECT - 68 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-68
-68
-68

query I rowsort
SELECT + cor0.col0 FROM tab1 AS cor0 GROUP BY col0, cor0.col2
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT + cor0.col1 + + 86 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
127
145
147

query I rowsort
SELECT ALL + 90 FROM tab1 AS cor0 GROUP BY col0
----
90
90
90

query I rowsort
SELECT 16 FROM tab2 AS cor0 GROUP BY cor0.col0
----
16
16
16

query I rowsort
SELECT ALL + 56 FROM tab0 AS cor0 GROUP BY cor0.col1
----
56
56

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, cor0.col2
----
26
43
83

query I rowsort
SELECT - + 93 FROM tab1, tab1 cor0 GROUP BY cor0.col2
----
-93
-93
-93

query I rowsort
SELECT ALL 62 FROM tab1 AS cor0 GROUP BY cor0.col1
----
62
62
62

query I rowsort
SELECT DISTINCT cor0.col1 + 50 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
131
50

query I rowsort
SELECT DISTINCT - - 22 FROM tab2 GROUP BY tab2.col1
----
22

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 68 col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
68
68
68

onlyif mysql # DIV for integer division: 
query I rowsort label-9007
SELECT ALL 87 * - cor0.col1 + cor0.col1 DIV col1 FROM tab2 cor0 GROUP BY cor0.col1
----
-3566
-5132
-5306

skipif mysql # not compatible
query I rowsort label-9007
SELECT ALL 87 * - cor0.col1 + cor0.col1 / col1 FROM tab2 cor0 GROUP BY cor0.col1
----
-3566
-5132
-5306

query I rowsort
SELECT - ( + 59 ) + cor1.col0 AS col1 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
-31
-37
23

query I rowsort
SELECT DISTINCT + 82 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
82

query I rowsort
SELECT + 82 FROM tab2 AS cor0 GROUP BY cor0.col2
----
82
82
82

query I rowsort
SELECT DISTINCT 39 * + cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
2262
3081
3393

query I rowsort
SELECT ALL cor0.col0 + - ( + cor0.col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT ALL + 37 FROM tab0 AS cor0 GROUP BY cor0.col1
----
37
37

query I rowsort
SELECT DISTINCT 24 + 53 FROM tab2 AS cor0 GROUP BY cor0.col1
----
77

query I rowsort
SELECT ALL - 7 FROM tab1 cor0 GROUP BY cor0.col0, col1
----
-7
-7
-7

query I rowsort
SELECT ALL 39 AS col1 FROM tab0 cor0 GROUP BY cor0.col1
----
39
39

query I rowsort
SELECT DISTINCT + 88 AS col2 FROM tab2 cor0 GROUP BY col1
----
88

query I rowsort
SELECT - + cor0.col0 FROM tab0, tab2 cor0 GROUP BY cor0.col0
----
-15
-91
-92

query I rowsort
SELECT ALL - 34 FROM tab0 AS cor0 GROUP BY col2, cor0.col1
----
-34
-34
-34

query I rowsort
SELECT + + 19 AS col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
19
19
19

query I rowsort
SELECT - cor0.col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + cor1.col1 * ( cor1.col1 ) * + 58 col0 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col1
----
112288
188442
2088

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 8 col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
8

query I rowsort
SELECT - + 96 AS col1 FROM tab0, tab2 cor0 GROUP BY tab0.col0
----
-96
-96
-96

query I rowsort
SELECT DISTINCT - 67 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-67

query I rowsort
SELECT DISTINCT 60 FROM tab0 GROUP BY col0
----
60

query I rowsort
SELECT 49 FROM tab1 GROUP BY tab1.col1
----
49
49
49

query I rowsort
SELECT 99 FROM tab2 AS cor0 GROUP BY cor0.col1
----
99
99
99

query I rowsort
SELECT 32 * 50 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1600
1600
1600

query I rowsort
SELECT - 6 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-6
-6
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 0 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
0

query I rowsort
SELECT ALL 15 FROM tab0 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor1.col0, cor1.col2
----
15
15
15

query I rowsort
SELECT ALL - tab1.col0 + - 60 AS col1 FROM tab1 GROUP BY col0
----
-142
-82
-88

query I rowsort
SELECT ALL 72 FROM tab1, tab2 AS cor0 GROUP BY cor0.col2
----
72
72
72

query I rowsort
SELECT DISTINCT col2 * - 60 + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, cor0.col1, cor0.col2
----
-2655
-4189
-472

query I rowsort
SELECT 65 * 31 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
2015
2015
2015

query I rowsort
SELECT DISTINCT cor0.col2 * + 12 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
288
456
948

query I rowsort
SELECT DISTINCT 5 AS col2 FROM tab1 cor0 GROUP BY cor0.col0
----
5

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 5 col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
5
5
5

query I rowsort
SELECT cor0.col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
142
16
90

query I rowsort
SELECT - col2 + - 1 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col1
----
-25
-39
-80

query I rowsort
SELECT DISTINCT + + 13 AS col1 FROM tab1, tab0 cor0 GROUP BY cor0.col2
----
13

query I rowsort
SELECT - 77 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-77
-77
-77

query I rowsort
SELECT DISTINCT 18 FROM tab1 AS cor0 GROUP BY cor0.col1
----
18

query I rowsort
SELECT DISTINCT 83 FROM tab0 AS cor0 GROUP BY col1
----
83

query I rowsort
SELECT + 5 * - 17 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-85
-85
-85

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9047
SELECT col2 * CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9047
SELECT col2 * CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT - 26 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-26
-26
-26

query I rowsort
SELECT - + 45 FROM tab2, tab2 cor0 GROUP BY tab2.col1
----
-45
-45
-45

query I rowsort
SELECT 10 AS col0 FROM tab0 cor0 GROUP BY cor0.col2
----
10
10
10

query I rowsort
SELECT ALL + ( cor0.col2 ) FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
45
71
8

query I rowsort
SELECT - ( - col1 ) AS col2 FROM tab1 GROUP BY tab1.col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9053
SELECT - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY tab0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9053
SELECT - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY tab0.col1
----
NULL
NULL

query I rowsort
SELECT ALL - 73 + + 86 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
13
13
13

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1, cor0.col2
----
44
57
6

query I rowsort
SELECT DISTINCT - - 18 + tab1.col2 FROM tab1 GROUP BY tab1.col2
----
26
63
89

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 68 col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
68
68
68

query I rowsort
SELECT DISTINCT 13 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
13

query I rowsort
SELECT + 0 FROM tab0, tab0 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT DISTINCT - 68 + + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-23
-60
3

query I rowsort
SELECT DISTINCT + cor0.col1 + - 35 + 63 * col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
3660
5001
5507

query I rowsort
SELECT ALL + 89 FROM tab0 GROUP BY tab0.col0
----
89
89
89

query I rowsort
SELECT ALL - 64 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-64
-64
-64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 37 col1 FROM tab2 cor0 GROUP BY col2
----
-37
-37
-37

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 27 col2 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
27

query I rowsort
SELECT cor0.col0 * 85 FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
1870
2380
6970

query I rowsort
SELECT - 0 + - cor0.col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL ( + 53 ) + - cor0.col2 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
-26
-34
-5

query I rowsort
SELECT DISTINCT 51 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
51

query I rowsort
SELECT 50 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
50
50
50

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9071
SELECT CAST( - col1 AS SIGNED ) FROM tab0 cor0 GROUP BY cor0.col1
----
-81
0

skipif mysql # not compatible
query I rowsort label-9071
SELECT CAST ( - col1 AS INTEGER ) FROM tab0 cor0 GROUP BY cor0.col1
----
-81
0

query I rowsort
SELECT DISTINCT + 48 * cor0.col0 FROM tab1 cor0 GROUP BY col0
----
1056
1344
3936

query I rowsort
SELECT DISTINCT - 32 FROM tab0 AS cor0 GROUP BY col2
----
-32

query I rowsort
SELECT 68 FROM tab0 AS cor0 GROUP BY col2
----
68
68
68

query I rowsort
SELECT + ( - 11 * 64 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-704
-704
-704

query I rowsort
SELECT + 95 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
95
95
95

query I rowsort
SELECT ALL tab1.col1 AS col0 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - 22 AS col1 FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
----
-22
-22
-22

query I rowsort
SELECT 25 * cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1100
1425
150

query I rowsort
SELECT 34 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
34
34
34

query I rowsort
SELECT ( + cor0.col2 ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - 44 AS col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-44
-44
-44

query I rowsort
SELECT 23 - + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1
-15
-56

query I rowsort
SELECT 1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
1
1
1

query I rowsort
SELECT - 47 AS col0 FROM tab2 GROUP BY tab2.col1
----
-47
-47
-47

query I rowsort
SELECT ALL 95 FROM tab0 AS cor0 GROUP BY col2
----
95
95
95

query I rowsort
SELECT DISTINCT + 81 FROM tab1 AS cor0 GROUP BY cor0.col0
----
81

query I rowsort
SELECT + 22 FROM tab0, tab2 AS cor0, tab2 AS cor1 GROUP BY cor0.col0
----
22
22
22

query I rowsort
SELECT ALL 1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT DISTINCT 49 FROM tab0 cor0 GROUP BY cor0.col0
----
49

query I rowsort
SELECT ALL + 23 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
23
23
23

query I rowsort
SELECT 81 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
81
81
81

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9094
SELECT CAST( NULL AS DECIMAL ) AS col2 FROM tab2 cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9094
SELECT CAST ( NULL AS REAL ) AS col2 FROM tab2 cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 52 FROM tab1 GROUP BY col2
----
52
52
52

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9096
SELECT DISTINCT + col0 + CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL

skipif mysql # not compatible
query I rowsort label-9096
SELECT DISTINCT + col0 + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9097
SELECT ALL CAST( NULL AS SIGNED ) + 64 / 21 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9097
SELECT ALL CAST ( NULL AS INTEGER ) + 64 / 21 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT DISTINCT - cor0.col0 + 52 * + 66 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
3340
3341
3417

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 46 + - cor0.col1 col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-35
46
46

query I rowsort
SELECT 36 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
36
36
36

query I rowsort
SELECT - 73 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-73
-73
-73

query I rowsort
SELECT ALL + 36 * + cor0.col0 + 29 * cor0.col0 - - cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
1452
1848
5412

query I rowsort
SELECT ALL - 71 FROM tab0 GROUP BY col0
----
-71
-71
-71

query I rowsort
SELECT DISTINCT + + 91 FROM tab0 GROUP BY tab0.col2
----
91

query I rowsort
SELECT + ( 61 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
61
61
61

query I rowsort
SELECT 91 FROM tab0 cor0 GROUP BY cor0.col1
----
91
91

query I rowsort
SELECT cor0.col0 * + 34 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
3094
3128
510

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 26 col2 FROM tab0 cor0 GROUP BY cor0.col0
----
26
26
26

query I rowsort
SELECT ALL - ( cor0.col2 ) FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
-58
-79
-87

query I rowsort
SELECT - 51 - cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-110
-112
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 97 col0 FROM tab1 cor0 GROUP BY cor0.col1
----
97
97
97

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col0 + 8 * 1 col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
34
51
91

query I rowsort
SELECT 48 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
48
48
48

query I rowsort
SELECT DISTINCT + cor0.col2 * - cor0.col2 - cor0.col2 * cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-10082
-128
-4050

query I rowsort
SELECT - cor0.col1 * 19 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
-1083
-114
-836

query I rowsort
SELECT ALL + cor0.col2 + 64 FROM tab0 AS cor0 GROUP BY cor0.col2
----
102
143
88

query I rowsort
SELECT DISTINCT - col0 * - 65 FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
5915
5980
975

query I rowsort
SELECT DISTINCT - 23 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-23

query I rowsort
SELECT 63 + col2 + - cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col2, cor0.col1
----
63
63
63

query I rowsort
SELECT ( + 29 ) * col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
1102
2291
696

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9121
SELECT - CAST( NULL AS DECIMAL ) AS col1 FROM tab1 GROUP BY tab1.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9121
SELECT - CAST ( NULL AS REAL ) AS col1 FROM tab1 GROUP BY tab1.col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 46 + + 45 FROM tab2, tab0 AS cor0 GROUP BY cor0.col1
----
91
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 54 col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
54
54
54

query I rowsort
SELECT 98 + cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
106
143
169

query I rowsort
SELECT - 10 FROM tab1, tab1 AS cor0 GROUP BY cor0.col2
----
-10
-10
-10

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - cor0.col1 * + col1 AS col2 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - 55 - cor0.col2 FROM tab1 AS cor0 GROUP BY col2, cor0.col0
----
-100
-126
-63

query I rowsort
SELECT DISTINCT cor0.col0 + cor0.col0 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
182
184
30

query I rowsort
SELECT 44 AS col1 FROM tab1, tab1 AS cor0 GROUP BY tab1.col1
----
44
44
44

query I rowsort
SELECT + 67 FROM tab1, tab1 cor0 GROUP BY cor0.col0
----
67
67
67

query I rowsort
SELECT tab0.col1 + - 97 FROM tab0 GROUP BY tab0.col1
----
-16
-97

query I rowsort
SELECT ( 3 ) AS col0 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
3
3
3

query I rowsort
SELECT 66 FROM tab2 AS cor0 GROUP BY cor0.col2
----
66
66
66

query I rowsort
SELECT ALL ( + cor0.col0 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
15
91
92

query I rowsort
SELECT ( + 76 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
76
76
76

query I rowsort
SELECT DISTINCT - 5 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-5

query I rowsort
SELECT - + 86 AS col2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col2
----
-86
-86
-86

query I rowsort
SELECT 67 * + tab1.col2 + + 19 FROM tab1 GROUP BY col2
----
3034
4776
555

query I rowsort
SELECT - 38 * + 14 FROM tab2 GROUP BY tab2.col1
----
-532
-532
-532

onlyif mysql # DIV for integer division: 
query I rowsort label-9141
SELECT ( + cor0.col1 ) DIV cor0.col0 col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col2
----
0
0
4

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9141
SELECT ( + cor0.col1 ) / cor0.col0 col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col2
----
0
0
4

query I rowsort
SELECT - - 83 * 1 AS col0 FROM tab0 GROUP BY col1
----
83
83

query I rowsort
SELECT DISTINCT - 4 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-4

query I rowsort
SELECT DISTINCT - cor0.col0 * 10 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
-150
-910
-920

query I rowsort
SELECT 89 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
89
89
89

query I rowsort
SELECT + cor0.col0 - 97 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-5
-6
-82

query I rowsort
SELECT + + 6 AS col1 FROM tab2, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
6
6
6

query I rowsort
SELECT - cor0.col2 * + cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-2025
-5041
-64

query I rowsort
SELECT 62 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
62
62
62

query I rowsort
SELECT + cor0.col0 * 10 FROM tab2 AS cor0 GROUP BY cor0.col0
----
150
910
920

query I rowsort
SELECT ALL + - 31 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
-31
-31
-31

query I rowsort
SELECT + ( cor0.col0 * cor0.col0 ) FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL + 63 FROM tab0 AS cor0 GROUP BY col1
----
63
63

query I rowsort
SELECT - ( + cor0.col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + 66 - 30 * 31 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-864
-864
-864

query I rowsort
SELECT ALL 85 AS col0 FROM tab1 GROUP BY tab1.col2
----
85
85
85

query I rowsort
SELECT + 22 FROM tab2 AS cor0 GROUP BY col0
----
22
22
22

query I rowsort
SELECT DISTINCT + cor0.col1 * + 75 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
0
6075

query I rowsort
SELECT ALL + + 35 * + 61 FROM tab1, tab2 cor0, tab1 AS cor1 GROUP BY cor0.col2
----
2135
2135
2135

query I rowsort
SELECT + ( 24 ) FROM tab0 cor0 GROUP BY col0, cor0.col1
----
24
24
24

query I rowsort
SELECT DISTINCT 67 AS col0 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0, cor1.col2
----
67

query I rowsort
SELECT DISTINCT + 40 AS col0 FROM tab1, tab1 cor0, tab1 AS cor1 GROUP BY cor0.col2
----
40

query I rowsort
SELECT + 54 FROM tab0 AS cor0 GROUP BY cor0.col1
----
54
54

query I rowsort
SELECT ALL + tab1.col0 + - tab1.col0 FROM tab1 GROUP BY tab1.col0
----
0
0
0

query I rowsort
SELECT 14 * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
574
826
854

query I rowsort
SELECT - 59 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-59
-59
-59

onlyif mysql # DIV for integer division: 
query I rowsort label-9167
SELECT + cor0.col2 + cor0.col2 * cor0.col2 DIV cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
142
16
90

skipif mysql # not compatible
query I rowsort label-9167
SELECT + cor0.col2 + cor0.col2 * cor0.col2 / cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
142
16
90

query I rowsort
SELECT DISTINCT tab0.col0 * - 83 AS col2 FROM tab0 GROUP BY tab0.col0
----
-2158
-3569
-6889

query I rowsort
SELECT DISTINCT 12 FROM tab2 AS cor0 GROUP BY cor0.col0
----
12

query I rowsort
SELECT ALL - 68 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-68
-68

onlyif mysql # DIV for integer division: 
query I rowsort label-9171
SELECT ALL - ( - 25 ) DIV - cor0.col1 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9171
SELECT ALL - ( - 25 ) / - cor0.col1 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT + cor0.col1 - - cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
102
115
14

query I rowsort
SELECT ALL - + cor0.col2 * - cor0.col2 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT 60 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
60

query I rowsort
SELECT ALL + 73 FROM tab1 AS cor0 GROUP BY cor0.col2
----
73
73
73

query I rowsort
SELECT + cor0.col1 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT 80 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
80

query I rowsort
SELECT DISTINCT + 24 FROM tab1, tab1 cor0 GROUP BY cor0.col0
----
24

onlyif mysql # DIV for integer division: 
query I rowsort label-9179
SELECT DISTINCT + 71 DIV - 65 col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9179
SELECT DISTINCT + 71 / - 65 col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1

query I rowsort
SELECT 25 + 68 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
93
93
93

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 36 col1 FROM tab0, tab0 AS cor0, tab0 AS cor1 GROUP BY tab0.col1
----
36
36

query I rowsort
SELECT 82 FROM tab0 AS cor0 GROUP BY cor0.col0
----
82
82
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9183
SELECT + CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9183
SELECT + CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 11 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
11
11
11

query I rowsort
SELECT DISTINCT cor0.col2 * - cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, col1
----
-2025
-5041
-64

onlyif mysql # DIV for integer division: 
query I rowsort label-9186
SELECT DISTINCT 79 DIV 53 + cor0.col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col1, col0
----
45
58
7

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9186
SELECT DISTINCT 79 / 53 + cor0.col1 col1 FROM tab1 AS cor0 GROUP BY cor0.col1, col0
----
45
58
7

query I rowsort
SELECT ALL + cor0.col1 * cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
0
0
6561

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9188
SELECT DISTINCT CAST( 20 AS SIGNED ) DIV + col0 FROM tab2 cor0 GROUP BY cor0.col0
----
0
1

skipif mysql # not compatible
query I rowsort label-9188
SELECT DISTINCT CAST ( 20 AS INTEGER ) / + col0 FROM tab2 cor0 GROUP BY cor0.col0
----
0
1

query I rowsort
SELECT ALL + 80 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
80
80
80

query I rowsort
SELECT + 74 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
74
74
74

query I rowsort
SELECT DISTINCT - 44 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-44

query I rowsort
SELECT DISTINCT + 0 - - cor0.col1 AS col2 FROM tab2 cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT + col0 + + cor0.col0 * 42 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
3913
3956
645

query I rowsort
SELECT ALL 44 FROM tab0 AS cor0 GROUP BY col2
----
44
44
44

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - cor0.col0 * + 21 FROM tab2 cor0 GROUP BY cor0.col0, col0
----
-1911
-1932
-315

query I rowsort
SELECT DISTINCT + + tab1.col1 * - 63 AS col0 FROM tab1 GROUP BY tab1.col1
----
-2772
-3591
-378

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9198
SELECT + CAST( NULL AS DECIMAL ) - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9198
SELECT + CAST ( NULL AS REAL ) - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT + ( 28 ) AS col1 FROM tab0 GROUP BY tab0.col1
----
28
28

query I rowsort
SELECT ALL - 10 AS col1 FROM tab2, tab2 AS cor0, tab1 AS cor1 GROUP BY cor1.col0
----
-10
-10
-10

query I rowsort
SELECT + 89 FROM tab1 AS cor0 GROUP BY cor0.col0
----
89
89
89

query I rowsort
SELECT 92 * + 5 FROM tab1 AS cor0 GROUP BY cor0.col1
----
460
460
460

query I rowsort
SELECT ALL 43 FROM tab1 AS cor0 GROUP BY cor0.col1
----
43
43
43

query I rowsort
SELECT 0 * cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT DISTINCT cor0.col0 * col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - cor0.col2 + 64 * 58 col1 FROM tab1, tab0 AS cor0, tab0 AS cor1 GROUP BY cor0.col2
----
3736
3750
3791

onlyif mysql # DIV for integer division: 
query I rowsort label-9207
SELECT - - 64 DIV cor0.col2 AS col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
0
1
2

skipif mysql # not compatible
query I rowsort label-9207
SELECT - - 64 / cor0.col2 AS col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
0
1
2

query I rowsort
SELECT ALL - 1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1
-1
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9209
SELECT + col0 + CAST( 89 AS SIGNED ) FROM tab1 GROUP BY tab1.col0
----
111
117
171

skipif mysql # not compatible
query I rowsort label-9209
SELECT + col0 + CAST ( 89 AS INTEGER ) FROM tab1 GROUP BY tab1.col0
----
111
117
171

query I rowsort
SELECT 92 FROM tab0 AS cor0 GROUP BY cor0.col2
----
92
92
92

query I rowsort
SELECT DISTINCT 11 * - col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-242
-308
-902

query I rowsort
SELECT + cor0.col1 * cor0.col1 + - ( - col2 + 82 ) FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col1
----
-3
-44
6503

query I rowsort
SELECT 76 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
76
76
76

query I rowsort
SELECT ALL - cor0.col2 + + 98 * - cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-2376
-3762
-7821

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9215
SELECT CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9215
SELECT CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - + 90 AS col2 FROM tab0, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
-90

query I rowsort
SELECT DISTINCT cor0.col0 + 75 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
103
157
97

query I rowsort
SELECT DISTINCT 81 AS col2 FROM tab2, tab2 AS cor0 GROUP BY cor0.col1
----
81

query I rowsort
SELECT - cor0.col2 + 11 FROM tab2 cor0 GROUP BY cor0.col2
----
-47
-68
-76

query I rowsort
SELECT + 82 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
82
82
82

query I rowsort
SELECT + 95 AS col2 FROM tab1, tab0 AS cor0 GROUP BY cor0.col0
----
95
95
95

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - ( 1 ) + - col0 col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-16
-92
-93

query I rowsort
SELECT ALL - 91 + 97 FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
----
6
6
6

query I rowsort
SELECT + 92 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
92
92
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9225
SELECT - 30 DIV cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9225
SELECT - 30 / cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT ALL 93 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
93
93
93

query I rowsort
SELECT 14 - + cor0.col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
14
6575

query I rowsort
SELECT 97 * cor0.col0 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
2134
2716
7954

query I rowsort
SELECT - 45 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-45
-45
-45

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - cor0.col1 - 0 col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-41
-59
-61

query I rowsort
SELECT - 85 FROM tab2 GROUP BY tab2.col2
----
-85
-85
-85

query I rowsort
SELECT DISTINCT - 87 AS col0 FROM tab0, tab1 AS cor0 GROUP BY tab0.col2
----
-87

query I rowsort
SELECT DISTINCT NULLIF ( 79, - tab1.col0 ) FROM tab1 GROUP BY tab1.col0
----
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT cor0.col2 col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 70 col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-70
-70
-70

onlyif mysql # DIV for integer division: 
query I rowsort label-9236
SELECT NULLIF ( cor0.col0, cor0.col0 * 78 ) + + col0 DIV - cor0.col0 col1 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
21
27
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9236
SELECT NULLIF ( cor0.col0, cor0.col0 * 78 ) + + col0 / - cor0.col0 col1 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
21
27
81

query I rowsort
SELECT DISTINCT + 59 FROM tab0 cor0 GROUP BY col1
----
59

onlyif mysql # DIV for integer division: 
query I rowsort label-9238
SELECT ALL + cor0.col0 + + cor0.col2 DIV 29 FROM tab2 AS cor0 GROUP BY cor0.col0, col2
----
18
93
94

skipif mysql # not compatible
query I rowsort label-9238
SELECT ALL + cor0.col0 + + cor0.col2 / 29 FROM tab2 AS cor0 GROUP BY cor0.col0, col2
----
18
93
94

query I rowsort
SELECT ALL cor0.col1 * 10 * cor0.col1 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col2, col1, col0
----
16851
34869
37271

query I rowsort
SELECT 25 AS col2 FROM tab1 GROUP BY tab1.col1
----
25
25
25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9241
SELECT ALL cor0.col2 + + CAST( + 88 AS SIGNED ) col1 FROM tab1 cor0 GROUP BY col2
----
133
159
96

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9241
SELECT ALL cor0.col2 + + CAST ( + 88 AS INTEGER ) col1 FROM tab1 cor0 GROUP BY col2
----
133
159
96

query I rowsort
SELECT ( tab0.col2 ) AS col2 FROM tab0 GROUP BY tab0.col2
----
24
38
79

query I rowsort
SELECT ALL 23 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
23
23
23

query I rowsort
SELECT tab1.col0 * + tab1.col0 + 34 AS col0 FROM tab1 GROUP BY col0
----
518
6758
818

query I rowsort
SELECT 19 FROM tab2 cor0 GROUP BY cor0.col2
----
19
19
19

query I rowsort
SELECT cor0.col2 * + 66 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1584
2508
5214

query I rowsort
SELECT - ( 52 ) AS col1 FROM tab2, tab1 cor0 GROUP BY cor0.col1
----
-52
-52
-52

query I rowsort
SELECT DISTINCT + 88 - 99 AS col0 FROM tab0 GROUP BY col2
----
-11

query I rowsort
SELECT - 22 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-22
-22
-22

query I rowsort
SELECT DISTINCT + cor0.col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - - 73 + + 77 AS col2 FROM tab1, tab1 AS cor0, tab0 AS cor1 GROUP BY cor1.col0
----
150
150
150

query I rowsort
SELECT 3 AS col1 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col0
----
3
3
3

query I rowsort
SELECT cor0.col0 * + cor0.col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - 34 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-34

query I rowsort
SELECT DISTINCT cor0.col1 * + 87 FROM tab1 cor0 GROUP BY cor0.col1
----
3828
4959
522

query I rowsort
SELECT + cor0.col1 * + cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1681
3481
3721

query I rowsort
SELECT + 16 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
16
16
16

query I rowsort
SELECT ALL 86 FROM tab0 AS cor0 GROUP BY cor0.col0
----
86
86
86

query I rowsort
SELECT - 76 FROM tab2 GROUP BY tab2.col0
----
-76
-76
-76

query I rowsort
SELECT + 95 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
95
95
95

query I rowsort
SELECT 69 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
69
69
69

query I rowsort
SELECT DISTINCT 39 + + col2 FROM tab1 GROUP BY tab1.col2
----
110
47
84

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 26, + cor0.col2 + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-26
-26
-26

query I rowsort
SELECT - 76 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-76
-76
-76

query I rowsort
SELECT 59 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
59
59
59

query I rowsort
SELECT ALL cor0.col0 + + ( cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 87 col2 FROM tab0 AS cor0 GROUP BY col1
----
-87

query I rowsort
SELECT ALL - 12 FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
-12
-12
-12

query I rowsort
SELECT 47 * cor0.col1 FROM tab0 cor0 GROUP BY cor0.col1
----
0
3807

query I rowsort
SELECT + 31 * col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
2821
2852
465

query I rowsort
SELECT DISTINCT + 35 + 19 FROM tab2, tab0 AS cor0 GROUP BY cor0.col1
----
54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 48 * col2 col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
2784
3792
4176

query I rowsort
SELECT ALL - 54 + 49 AS col1 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
-5
-5

query I rowsort
SELECT - 69 - - cor0.col2 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-11
10
18

query I rowsort
SELECT DISTINCT + 40 * - col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1520
-3160
-960

query I rowsort
SELECT ALL cor0.col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9277
SELECT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9277
SELECT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - cor0.col2 + - 91 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
-115
-129
-170

query I rowsort
SELECT ALL 7 + cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
65
86
94

query I rowsort
SELECT ALL - 6 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-6
-6
-6

query I rowsort
SELECT ALL - 0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
0

query I rowsort
SELECT ALL 90 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
90
90
90

query I rowsort
SELECT ALL 56 FROM tab2 AS cor0 GROUP BY cor0.col0
----
56
56
56

query I rowsort
SELECT DISTINCT 81 AS col2 FROM tab2 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor0.col2
----
81

query I rowsort
SELECT + 27 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
27
27
27

query I rowsort
SELECT ALL ( + 72 ) + cor0.col0 * + cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, cor0.col0
----
297
8353
8536

query I rowsort
SELECT DISTINCT 61 + 76 FROM tab1 GROUP BY tab1.col0
----
137

query I rowsort
SELECT ALL 53 AS col0 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col0
----
53
53
53

query I rowsort
SELECT DISTINCT 60 * - 74 AS col2 FROM tab2 GROUP BY tab2.col2
----
-4440

query I rowsort
SELECT 89 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
89
89

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9291
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9291
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT ALL + NULLIF ( + cor0.col2, cor0.col1 ) AS col2 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
58
79
87

query I rowsort
SELECT - ( cor0.col2 ) + - 6 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-30
-44
-85

query I rowsort
SELECT DISTINCT 85 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
85

query I rowsort
SELECT - COALESCE ( tab2.col0, - tab2.col0 ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - 45 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-45
-45
-45

query I rowsort
SELECT cor1.col1 AS col0 FROM tab1 cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col1
----
41
59
61

query I rowsort
SELECT 56 * cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
2296
3304
3416

query I rowsort
SELECT DISTINCT - 86 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 26 col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - cor0.col2 - cor0.col1 col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col2
----
-105
-38
-79

query I rowsort
SELECT DISTINCT ( 44 ) FROM tab2 cor0 GROUP BY cor0.col1
----
44

query I rowsort
SELECT DISTINCT - cor0.col0 * - cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

query I rowsort
SELECT ALL 55 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
55
55
55

query I rowsort
SELECT ALL - 64 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-64
-64
-64

query I rowsort
SELECT + 83 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
83
83

query I rowsort
SELECT + 7 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
7
7

query I rowsort
SELECT ALL + 61 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
61
61
61

query I rowsort
SELECT + 4 FROM tab1 AS cor0 GROUP BY col0
----
4
4
4

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 56 * - 95 col0 FROM tab1, tab1 AS cor0 GROUP BY tab1.col2
----
-5320
-5320
-5320

query I rowsort
SELECT + cor0.col1 * cor0.col1 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT - 97 AS col1 FROM tab2 cor0 GROUP BY col2, col1
----
-97

query I rowsort
SELECT ALL 15 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
15
15
15

query I rowsort
SELECT ALL 72 FROM tab2 cor0 GROUP BY cor0.col2
----
72
72
72

query I rowsort
SELECT + 37 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
37
37
37

query I rowsort
SELECT 68 FROM tab2 AS cor0 GROUP BY cor0.col0
----
68
68
68

query I rowsort
SELECT - cor0.col2 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT cor0.col1 + 7 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
7
7
88

query I rowsort
SELECT ALL + 1 * cor0.col1 - col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - cor0.col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL - 42 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-42
-42
-42

query I rowsort
SELECT ALL - 73 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-73
-73
-73

query I rowsort
SELECT 84 FROM tab2 AS cor0 GROUP BY cor0.col0
----
84
84
84

query I rowsort
SELECT 51 FROM tab2 GROUP BY tab2.col2
----
51
51
51

onlyif mysql # DIV for integer division: 
query I rowsort label-9325
SELECT ALL + 32 DIV cor0.col2 + cor0.col2 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
58
79
87

skipif mysql # not compatible
query I rowsort label-9325
SELECT ALL + 32 / cor0.col2 + cor0.col2 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
58
79
87

query I rowsort
SELECT + cor0.col2 + - 29 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-5
50
9

query I rowsort
SELECT 48 FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
48
48

query I rowsort
SELECT ( - 65 ) + + cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-24
-4
-6

query I rowsort
SELECT ALL 24 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
24
24
24

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 31 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-31

query I rowsort
SELECT cor0.col2 * cor0.col1 + - cor0.col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-38
-79
1920

query I rowsort
SELECT cor0.col0 * + cor0.col0 + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1892
6972
702

query I rowsort
SELECT DISTINCT + col1 * + ( - 28 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1232
-1596
-168

query I rowsort
SELECT 45 FROM tab1, tab2 cor0 GROUP BY cor0.col0
----
45
45
45

query I rowsort
SELECT DISTINCT + cor0.col0 - + cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-9336
SELECT ALL - cor0.col0 DIV cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9336
SELECT ALL - cor0.col0 / cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1
-1
-1

query I rowsort
SELECT - 42 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-42
-42
-42

query I rowsort
SELECT + 43 FROM tab2 cor0 GROUP BY cor0.col0
----
43
43
43

query I rowsort
SELECT + 24 FROM tab2 cor0 GROUP BY col1
----
24
24
24

query I rowsort
SELECT ALL 97 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
97
97
97

onlyif mysql # DIV for integer division: 
query I rowsort label-9341
SELECT ALL - 34 + cor0.col2 + + col2 DIV 89 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-10
4
45

skipif mysql # not compatible
query I rowsort label-9341
SELECT ALL - 34 + cor0.col2 + + col2 / 89 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-10
4
45

query I rowsort
SELECT ALL - cor0.col2 + 47 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-32
23
9

query I rowsort
SELECT ALL 48 FROM tab1 AS cor0 GROUP BY cor0.col0
----
48
48
48

query I rowsort
SELECT cor0.col0 * - cor0.col0 + + 79 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-1770
-597
-6810

query I rowsort
SELECT ALL cor0.col1 + cor0.col1 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
114
12
88

query I rowsort
SELECT ALL - cor0.col2 AS col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-24
-38
-79

query I rowsort
SELECT - 8 AS col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-8
-8
-8

query I rowsort
SELECT 98 + ( + 63 ) AS col2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col2
----
161
161
161

query I rowsort
SELECT ALL 35 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
35
35
35

query I rowsort
SELECT ALL + 38 FROM tab2 cor0 GROUP BY cor0.col0
----
38
38
38

query I rowsort
SELECT ALL 68 + - col1 + cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
68
68
68

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col0 col1 FROM tab2 cor0 GROUP BY col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9353
SELECT DISTINCT + col0 DIV cor0.col0 + + 0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1

skipif mysql # not compatible
query I rowsort label-9353
SELECT DISTINCT + col0 / cor0.col0 + + 0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1

query I rowsort
SELECT ALL 46 FROM tab2 GROUP BY col1
----
46
46
46

query I rowsort
SELECT 14 FROM tab0 AS cor0 GROUP BY cor0.col0
----
14
14
14

query I rowsort
SELECT DISTINCT 0 + + 72 FROM tab0 GROUP BY col2
----
72

query I rowsort
SELECT ALL cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
41
59
61

query I rowsort
SELECT DISTINCT cor0.col1 - - 47 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
128
47

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col1 col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT ALL - 23 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-23
-23
-23

query I rowsort
SELECT + 80 * 20 * - col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-132800
-41600
-68800

query I rowsort
SELECT 7 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
7
7
7

query I rowsort
SELECT cor0.col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 87 col1 FROM tab2 GROUP BY tab2.col2
----
-87
-87
-87

query I rowsort
SELECT - - 28 AS col2 FROM tab2, tab1 cor0 GROUP BY cor0.col0
----
28
28
28

query I rowsort
SELECT 7 * - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-567
0

query I rowsort
SELECT DISTINCT + 62 FROM tab2 AS cor0 GROUP BY cor0.col2
----
62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9368
SELECT ALL CAST( NULL AS SIGNED ) * + cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9368
SELECT ALL CAST ( NULL AS INTEGER ) * + cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 21 FROM tab0 cor0 GROUP BY cor0.col0
----
-21

query I rowsort
SELECT 47 - col0 FROM tab1 cor0 GROUP BY cor0.col0, cor0.col2
----
-35
19
25

query I rowsort
SELECT + 27 FROM tab2 AS cor0 GROUP BY col0
----
27
27
27

query I rowsort
SELECT ALL - 99 FROM tab1 cor0 GROUP BY col1
----
-99
-99
-99

query I rowsort
SELECT 62 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
62
62
62

query I rowsort
SELECT ( + 11 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
11
11

query I rowsort
SELECT DISTINCT - 79 FROM tab2 AS cor0 GROUP BY col0
----
-79

query I rowsort
SELECT DISTINCT + - 16 AS col2 FROM tab2, tab2 AS cor0, tab0 AS cor1 GROUP BY cor1.col2
----
-16

query I rowsort
SELECT DISTINCT - 42 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-42

query I rowsort
SELECT cor0.col1 * + 12 + cor0.col0 AS col0 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col0
----
1015
26
83

query I rowsort
SELECT + cor0.col0 AS col0 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
15
91
92

query I rowsort
SELECT DISTINCT + ( + 84 * cor0.col1 ) AS col2 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col1
----
0
6804

query I rowsort
SELECT DISTINCT - ( 34 ) AS col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
-34

query I rowsort
SELECT DISTINCT 10 FROM tab1 cor0 GROUP BY cor0.col0
----
10

query I rowsort
SELECT DISTINCT 8 FROM tab1 AS cor0 GROUP BY col0
----
8

query I rowsort
SELECT cor0.col0 - NULLIF ( + cor0.col0 * + cor0.col2, - cor0.col0 ) FROM tab2 cor0 GROUP BY cor0.col0, col2
----
-1290
-5244
-7098

query I rowsort
SELECT DISTINCT cor0.col0 + 44 FROM tab1 cor0 GROUP BY cor0.col0, cor0.col0
----
126
66
72

query I rowsort
SELECT DISTINCT 0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0

query I rowsort
SELECT DISTINCT 66 FROM tab0 AS cor0 GROUP BY cor0.col0
----
66

query I rowsort
SELECT DISTINCT cor0.col0 + - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT 74 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
74
74

query I rowsort
SELECT + 80 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
80
80
80

query I rowsort
SELECT ALL + 76 AS col0 FROM tab2 cor0 GROUP BY cor0.col2
----
76
76
76

query I rowsort
SELECT cor0.col2 * - NULLIF ( - cor0.col2, - cor0.col2 ) / cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 30 AS col1 FROM tab0 AS cor0 CROSS JOIN tab0 cor1 GROUP BY cor0.col2
----
30
30
30

query I rowsort
SELECT DISTINCT 75 FROM tab1 AS cor0 GROUP BY cor0.col1
----
75

query I rowsort
SELECT + 29 AS col2 FROM tab0 cor0 GROUP BY cor0.col2
----
29
29
29

query I rowsort
SELECT DISTINCT 3 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3

query I rowsort
SELECT DISTINCT - 53 * + cor0.col0 AS col2 FROM tab0, tab2 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
-4823
-4876
-795

query I rowsort
SELECT ALL + 92 FROM tab2 cor0 GROUP BY col2
----
92
92
92

query I rowsort
SELECT 35 AS col0 FROM tab1, tab1 AS cor0 GROUP BY tab1.col2
----
35
35
35

query I rowsort
SELECT ALL - 54 FROM tab0 GROUP BY tab0.col1
----
-54
-54

query I rowsort
SELECT - 5 FROM tab2 AS cor0 GROUP BY col2
----
-5
-5
-5

query I rowsort
SELECT - cor0.col2 AS col1 FROM tab1 cor0 GROUP BY col2, cor0.col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - 48 FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
-48

query I rowsort
SELECT DISTINCT - 34 FROM tab0 cor0 GROUP BY cor0.col0
----
-34

query I rowsort
SELECT DISTINCT 48 + cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
130
70
76

query I rowsort
SELECT DISTINCT 54 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 65 * - cor0.col1 col1 FROM tab2 cor0 GROUP BY cor0.col1, cor0.col1
----
-2665
-3835
-3965

query I rowsort
SELECT DISTINCT - 15 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-15

query I rowsort
SELECT ALL + 73 FROM tab1 AS cor0 GROUP BY cor0.col1, col0
----
73
73
73

query I rowsort
SELECT cor0.col1 * 68 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2992
3876
408

query I rowsort
SELECT - 63 FROM tab1 GROUP BY tab1.col1
----
-63
-63
-63

query I rowsort
SELECT - ( - cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - COALESCE ( - cor0.col0, - cor0.col0 * - 11 ) + + cor0.col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT 97 AS col0 FROM tab2 cor0 GROUP BY cor0.col2, col1
----
97

query I rowsort
SELECT - 11 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-11
-11
-11

query I rowsort
SELECT + cor0.col0 * cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

query I rowsort
SELECT 0 FROM tab1, tab0 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT ALL 33 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
33
33
33

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col1 * - cor0.col1 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-6561
0

query I rowsort
SELECT DISTINCT + cor0.col2 * + col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0
1944

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 92 * 55 * + 78 col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
394680
394680
394680

query I rowsort
SELECT DISTINCT 52 FROM tab0 AS cor0 GROUP BY cor0.col2
----
52

query I rowsort
SELECT - 80 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-3280
-4720
-4880

query I rowsort
SELECT DISTINCT + 25 AS col2 FROM tab1, tab2 cor0 GROUP BY cor0.col0
----
25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9425
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY tab1.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9425
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY tab1.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT cor0.col1 * cor0.col2 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, col2
----
0
1944

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 81 col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col0, cor0.col2
----
81
81
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9428
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab2, tab2 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9428
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab2, tab2 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + ( cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0, col0, col1
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-9431
SELECT ALL - 39 - col1 DIV ( 54 + + cor0.col1 ) col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-39
-39

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9431
SELECT ALL - 39 - col1 / ( 54 + + cor0.col1 ) col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-39
-39

query I rowsort
SELECT + 11 FROM tab2 AS cor0 GROUP BY col2, cor0.col1
----
11
11
11

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9433
SELECT ALL + CAST( NULL AS DECIMAL ) AS col0 FROM tab1, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9433
SELECT ALL + CAST ( NULL AS REAL ) AS col0 FROM tab1, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 99 AS col2 FROM tab0 AS cor0 CROSS JOIN tab0 cor1 GROUP BY cor1.col2
----
99
99
99

query I rowsort
SELECT DISTINCT cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1, col0
----
0
81

query I rowsort
SELECT ALL 60 FROM tab1, tab0 AS cor0, tab0 AS cor1 GROUP BY cor1.col2
----
60
60
60

query I rowsort
SELECT ALL 7 + col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
13
51
64

query I rowsort
SELECT + 38 FROM tab1, tab2 cor0 GROUP BY cor0.col2
----
38
38
38

query I rowsort
SELECT ALL 61 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
61
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * ( - 54 ) col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-1296
-2052
-4266

query I rowsort
SELECT + 1 FROM tab2, tab0 AS cor0 GROUP BY tab2.col2
----
1
1
1

query I rowsort
SELECT DISTINCT - ( - 70 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
70

query I rowsort
SELECT - 55 + 54 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1
-1
-1

query I rowsort
SELECT 4 * + 66 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
264
264
264

query I rowsort
SELECT DISTINCT 40 FROM tab2 AS cor0 GROUP BY cor0.col0
----
40

query I rowsort
SELECT ALL - ( 15 ) AS col2 FROM tab1 cor0 GROUP BY col0, cor0.col0
----
-15
-15
-15

query I rowsort
SELECT + cor0.col1 * ( - 16 ) FROM tab1, tab2 AS cor0, tab2 AS cor1 GROUP BY cor0.col1
----
-656
-944
-976

query I rowsort
SELECT DISTINCT 40 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col1
----
40

query I rowsort
SELECT DISTINCT + 91 - col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
12
33
4

query I rowsort
SELECT DISTINCT + 59 FROM tab2 cor0 GROUP BY cor0.col0
----
59

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 80, col0 ) * + cor0.col1 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
-3280
-4720
-4880

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + tab0.col2 col0 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - 79 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
-79
-79
-79

query I rowsort
SELECT DISTINCT 12 * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
492
708
732

onlyif mysql # DIV for integer division: 
query I rowsort label-9455
SELECT cor0.col1 + + cor0.col2 DIV - cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
40
58
60

skipif mysql # not compatible
query I rowsort label-9455
SELECT cor0.col1 + + cor0.col2 / - cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
40
58
60

query I rowsort
SELECT ALL + ( cor0.col2 ) + - 28 AS col0 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
-20
17
43

query I rowsort
SELECT ALL + cor0.col0 + ( - 55 ) AS col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
-40
36
37

query I rowsort
SELECT DISTINCT ( cor0.col2 ) * cor0.col1 AS col0 FROM tab0 cor0 GROUP BY cor0.col1, col2
----
0
1944

query I rowsort
SELECT ALL 72 + col1 + cor0.col0 FROM tab1 cor0 GROUP BY cor0.col0, cor0.col1
----
100
157
198

query I rowsort
SELECT DISTINCT 53 + - col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1, cor0.col2
----
-4
47
9

query I rowsort
SELECT - 36 AS col1 FROM tab2 GROUP BY tab2.col0
----
-36
-36
-36

onlyif mysql # DIV for integer division: 
query I rowsort label-9462
SELECT ALL cor0.col1 DIV + cor0.col1 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-9462
SELECT ALL cor0.col1 / + cor0.col1 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
1
1
1

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY cor0.col0
----
-15
-91
-92

query I rowsort
SELECT + 46 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2, col0
----
46
46
46

query I rowsort
SELECT ALL 11 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
11
11
11

query I rowsort
SELECT 79 AS col1 FROM tab1 AS cor0 GROUP BY col2, cor0.col2
----
79
79
79

query I rowsort
SELECT DISTINCT 72 FROM tab1 AS cor0 GROUP BY cor0.col0
----
72

query I rowsort
SELECT + 20 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
20
20
20

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9469
SELECT CAST( NULL AS SIGNED ) * + cor0.col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9469
SELECT CAST ( NULL AS INTEGER ) * + cor0.col0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 46 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
46
46
46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9471
SELECT DISTINCT CAST( NULL AS SIGNED ) / cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9471
SELECT DISTINCT CAST ( NULL AS INTEGER ) / cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT - 99 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-99
-99
-99

query I rowsort
SELECT - 97 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-97
-97
-97

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 58 + 84 col2 FROM tab1 GROUP BY tab1.col1
----
26
26
26

query I rowsort
SELECT - ( - col1 ) AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - 23 * cor0.col2 * NULLIF ( 29, cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-16008
-25346
-52693

query I rowsort
SELECT - ( + 62 + cor0.col2 ) * + cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-4815
-560
-9443

query I rowsort
SELECT cor0.col1 * col1 + cor0.col0 + - 53 AS col1 FROM tab2 AS cor0 GROUP BY col1, cor0.col0, col0
----
1720
3519
3683

query I rowsort
SELECT - 52 + ( - cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
-134
-74
-80

onlyif mysql # DIV for integer division: 
query I rowsort label-9480
SELECT ALL - + 45 DIV + 86 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9480
SELECT ALL - + 45 / + 86 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT ALL + + cor0.col1 + 0 AS col2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT DISTINCT + 40 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
40

query I rowsort
SELECT - cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-81
0
0

query I rowsort
SELECT DISTINCT - cor0.col2 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

query I rowsort
SELECT 94 FROM tab0 AS cor0 GROUP BY cor0.col1
----
94
94

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9486
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-9486
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col2
----
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-9487
SELECT cor0.col2 DIV - 57 AS col1 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-9487
SELECT cor0.col2 / - 57 AS col1 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
-1
0
0

query I rowsort
SELECT 41 AS col2 FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
41
41
41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9489
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY tab2.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9489
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY tab2.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 66 AS col2 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
66
66
66

query I rowsort
SELECT 1 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT 76 AS col1 FROM tab2, tab1 cor0 GROUP BY tab2.col0
----
76
76
76

query I rowsort
SELECT + 7 AS col0 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
7
7
7

query I rowsort
SELECT ALL cor0.col0 + cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
164
44
56

query I rowsort
SELECT + 95 FROM tab2 AS cor0 GROUP BY col2
----
95
95
95

query I rowsort
SELECT DISTINCT 0 * + 76 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0

query I rowsort
SELECT - 89 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-89
-89
-89

query I rowsort
SELECT - 97 + + cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-15
-69
-75

query I rowsort
SELECT DISTINCT 78 FROM tab0 GROUP BY tab0.col2
----
78

query I rowsort
SELECT ALL cor0.col2 + + cor0.col1 * 53 + cor0.col2 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
2289
3285
3407

query I rowsort
SELECT 22 * 42 FROM tab2 cor0 GROUP BY col0
----
924
924
924

query I rowsort
SELECT 99 * + 99 FROM tab2 AS cor0 GROUP BY cor0.col2
----
9801
9801
9801

query I rowsort
SELECT ALL - 16 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-16
-16
-16

query I rowsort
SELECT cor0.col1 * - cor0.col1 + - cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1980
-3306
-42

query I rowsort
SELECT - 53 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-53
-53
-53

onlyif mysql # DIV for integer division: 
query I rowsort label-9506
SELECT cor0.col1 DIV 87 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-9506
SELECT cor0.col1 / 87 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 48 col1 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
48
48
48

query I rowsort
SELECT ALL 8 + + NULLIF ( cor0.col1, cor0.col1 ) FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 88 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
88

query I rowsort
SELECT DISTINCT 62 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 - - 80 * cor0.col0 col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1185
7189
7268

query I rowsort
SELECT ALL - + 31 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
-31
-31
-31

query I rowsort
SELECT 15 - + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-11
-28
-68

query I rowsort
SELECT ALL + 7 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
7
7
7

query I rowsort
SELECT DISTINCT 4 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
4

query I rowsort
SELECT DISTINCT + 72 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
72

query I rowsort
SELECT ALL - 2 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-2
-2
-2

onlyif mysql # DIV for integer division: 
query I rowsort label-9518
SELECT 73 + 66 DIV + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
73
74
75

skipif mysql # not compatible
query I rowsort label-9518
SELECT 73 + 66 / + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
73
74
75

query I rowsort
SELECT ALL + 51 + cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
142
143
66

query I rowsort
SELECT DISTINCT 21 - cor0.col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-23
-36
15

query I rowsort
SELECT + 82 FROM tab1 AS cor0 GROUP BY cor0.col2
----
82
82
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9522
SELECT + cor0.col0 * - CAST( NULL AS SIGNED ) + + 30 FROM tab0 AS cor0 GROUP BY cor0.col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9522
SELECT + cor0.col0 * - CAST ( NULL AS INTEGER ) + + 30 FROM tab0 AS cor0 GROUP BY cor0.col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + + 88 * + 83 AS col1 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
7304
7304
7304

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9524
SELECT - + CAST( NULL AS SIGNED ) FROM tab0, tab0 AS cor0 GROUP BY tab0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9524
SELECT - + CAST ( NULL AS INTEGER ) FROM tab0, tab0 AS cor0 GROUP BY tab0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT 10 + + cor0.col2 FROM tab0, tab2 cor0 GROUP BY cor0.col2
----
68
89
97

query I rowsort
SELECT + 67 + col2 + - cor0.col2 * cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2, cor0.col1
----
-3239
-6095
-7415

query I rowsort
SELECT - 67 FROM tab1, tab2 AS cor0 GROUP BY cor0.col2
----
-67
-67
-67

query I rowsort
SELECT cor0.col0 * 77 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
1694
2156
6314

query I rowsort
SELECT 80 FROM tab1 AS cor0 GROUP BY cor0.col1
----
80
80
80

query I rowsort
SELECT - + 94 FROM tab1, tab2 AS cor0 GROUP BY tab1.col2
----
-94
-94
-94

query I rowsort
SELECT ALL cor0.col2 * + cor0.col2 FROM tab2, tab2 AS cor0 GROUP BY cor0.col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 31 col1 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col2
----
-31
-31
-31

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT NULLIF ( 48, cor0.col1 ) + col1 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
129
48

query I rowsort
SELECT 45 AS col2 FROM tab2 cor0 GROUP BY cor0.col1
----
45
45
45

query I rowsort
SELECT + 5 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
5
5
5

query I rowsort
SELECT 37 FROM tab1 AS cor0 GROUP BY col1
----
37
37
37

query I rowsort
SELECT ALL - - tab0.col0 AS col1 FROM tab0 GROUP BY tab0.col0
----
26
43
83

query I rowsort
SELECT DISTINCT 55 FROM tab1 AS cor0 GROUP BY cor0.col0
----
55

query I rowsort
SELECT DISTINCT 38 FROM tab1 cor0 GROUP BY cor0.col1
----
38

query I rowsort
SELECT - + NULLIF ( 45, + 31 ) AS col1 FROM tab2 GROUP BY tab2.col0
----
-45
-45
-45

query I rowsort
SELECT DISTINCT - 32 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-32

query I rowsort
SELECT ALL 42 FROM tab2, tab1 AS cor0 GROUP BY cor0.col0
----
42
42
42

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 55 col1 FROM tab0 cor0 GROUP BY cor0.col1
----
-55
-55

query I rowsort
SELECT 62 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
62
62
62

query I rowsort
SELECT tab2.col2 * 53 AS col2 FROM tab2 GROUP BY col2
----
3074
4187
4611

query I rowsort
SELECT ALL + cor0.col1 + 36 AS col0 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
77
95
97

query I rowsort
SELECT + 89 FROM tab2 GROUP BY col0
----
89
89
89

query I rowsort
SELECT DISTINCT - 85 FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
-85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 43 col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
43

query I rowsort
SELECT - 26 * tab0.col2 FROM tab0 GROUP BY tab0.col2
----
-2054
-624
-988

query I rowsort
SELECT DISTINCT 50 * - ( - cor0.col0 ) + cor0.col0 + - 2 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
1120
1426
4180

onlyif mysql # DIV for integer division: 
query I rowsort label-9552
SELECT 51 DIV + cor0.col1 + 44 FROM tab2 AS cor0 GROUP BY cor0.col1
----
44
44
45

skipif mysql # not compatible
query I rowsort label-9552
SELECT 51 / + cor0.col1 + 44 FROM tab2 AS cor0 GROUP BY cor0.col1
----
44
44
45

query I rowsort
SELECT - + 43 AS col1 FROM tab2, tab0 cor0 GROUP BY tab2.col2
----
-43
-43
-43

query I rowsort
SELECT - 39 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-39
-39
-39

query I rowsort
SELECT ALL 78 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
78
78

query I rowsort
SELECT DISTINCT - 33 * 53 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-1749

query I rowsort
SELECT - cor0.col2 FROM tab0 cor0 GROUP BY col2, cor0.col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT 99 FROM tab1 cor0 GROUP BY cor0.col2
----
99

onlyif mysql # DIV for integer division: 
query I rowsort label-9559
SELECT ALL - 6 DIV 24 + cor1.col1 * cor0.col2 + cor0.col2 AS col1 FROM tab1 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col1, cor0.col2
----
9 values hashing to 299ea4b8e75a5514fe577f3f17cae34f

skipif mysql # not compatible
query I rowsort label-9559
SELECT ALL - 6 / 24 + cor1.col1 * cor0.col2 + cor0.col2 AS col1 FROM tab1 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col1, cor0.col2
----
9 values hashing to 299ea4b8e75a5514fe577f3f17cae34f

query I rowsort
SELECT - cor0.col0 + cor0.col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0, cor0.col1
----
45
71
8

query I rowsort
SELECT ( 5 ) FROM tab0 cor0 GROUP BY col2
----
5
5
5

query I rowsort
SELECT DISTINCT + 0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 30 col1 FROM tab0 GROUP BY tab0.col1
----
30
30

query I rowsort
SELECT 83 * cor0.col2 * - 95 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-189240
-299630
-622915

query I rowsort
SELECT DISTINCT + 23 * + 50 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1150

query I rowsort
SELECT DISTINCT 86 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
86

query I rowsort
SELECT 30 FROM tab2 GROUP BY tab2.col1
----
30
30
30

query I rowsort
SELECT ALL - 52 + - col0 FROM tab2 cor0 GROUP BY cor0.col0
----
-143
-144
-67

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9570
SELECT col2 + CAST( NULL AS SIGNED ) + - 44 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9570
SELECT col2 + CAST ( NULL AS INTEGER ) + - 44 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 77 * 45 + + cor0.col2 FROM tab1 cor0 GROUP BY cor0.col2
----
3473
3510
3536

query I rowsort
SELECT DISTINCT - 39 FROM tab1 AS cor0 GROUP BY col1, cor0.col1
----
-39

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 98 col2 FROM tab1 GROUP BY tab1.col1
----
-98

query I rowsort
SELECT ( + 90 ) FROM tab2 cor0 GROUP BY cor0.col2, cor0.col0
----
90
90
90

query I rowsort
SELECT DISTINCT - 51 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-51

onlyif mysql # DIV for integer division: 
query I rowsort label-9576
SELECT + 57 DIV + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
1
1
9

skipif mysql # not compatible
query I rowsort label-9576
SELECT + 57 / + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
1
1
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 95 * 20 col0 FROM tab0, tab1 cor0 GROUP BY cor0.col0
----
1900
1900
1900

query I rowsort
SELECT cor0.col2 * - 54 AS col2 FROM tab2 cor0 GROUP BY col2
----
-3132
-4266
-4698

query I rowsort
SELECT - 51 + col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-13
-27
28

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9580
SELECT ALL cor0.col0 * CAST( NULL AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9580
SELECT ALL cor0.col0 * CAST ( NULL AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 72 * cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-1080
-6552
-6624

query I rowsort
SELECT ALL - cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-45
-71
-8

query I rowsort
SELECT + ( + 99 ) + + cor0.col0 AS col0 FROM tab2, tab1 cor0 GROUP BY cor0.col0
----
121
127
181

query I rowsort
SELECT + 69 FROM tab2 AS cor0 GROUP BY cor0.col1
----
69
69
69

query I rowsort
SELECT ALL - 35 AS col1 FROM tab2 cor0 GROUP BY cor0.col1
----
-35
-35
-35

query I rowsort
SELECT DISTINCT + - 59 FROM tab1, tab0 AS cor0 GROUP BY tab1.col1
----
-59

query I rowsort
SELECT ALL 25 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
25
25
25

onlyif mysql # DIV for integer division: 
query I rowsort label-9588
SELECT ALL + cor0.col1 DIV + 9 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
9

skipif mysql # not compatible
query I rowsort label-9588
SELECT ALL + cor0.col1 / + 9 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
9

query I rowsort
SELECT DISTINCT + cor0.col1 + + COALESCE ( - cor0.col1, - cor0.col1 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0

query I rowsort
SELECT 17 FROM tab2 AS cor0 GROUP BY cor0.col2
----
17
17
17

query I rowsort
SELECT ALL + 29 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
29
29
29

query I rowsort
SELECT + 59 FROM tab2 AS cor0 GROUP BY cor0.col0
----
59
59
59

query I rowsort
SELECT DISTINCT + cor0.col0 + + ( 14 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
105
106
29

query I rowsort
SELECT 86 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
86
86
86

query I rowsort
SELECT 75 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
75
75
75

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9596
SELECT col1 + + CAST( cor0.col1 AS SIGNED ) - cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-9596
SELECT col1 + + CAST ( cor0.col1 AS INTEGER ) - cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 83 - cor1.col0 col2 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0
----
-174
-175
-98

query I rowsort
SELECT ALL + 99 + - 54 * cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-4275
99
99

query I rowsort
SELECT + col2 * cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, col1
----
2025
5041
64

query I rowsort
SELECT ALL 84 + col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
125
143
145

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9601
SELECT - CAST( NULL AS SIGNED ) - + 40 * - 80 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9601
SELECT - CAST ( NULL AS INTEGER ) - + 40 * - 80 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT cor0.col2 - 57 FROM tab1 AS cor0 GROUP BY col2
----
-12
-49
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9603
SELECT ALL + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9603
SELECT ALL + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 92 + cor0.col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
107
183
184

onlyif mysql # DIV for integer division: 
query I rowsort label-9605
SELECT ALL - cor0.col1 DIV - 19 FROM tab2 AS cor0 GROUP BY cor0.col1
----
2
3
3

skipif mysql # not compatible
query I rowsort label-9605
SELECT ALL - cor0.col1 / - 19 FROM tab2 AS cor0 GROUP BY cor0.col1
----
2
3
3

query I rowsort
SELECT DISTINCT + cor0.col1 * 1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + 95 * - cor0.col2 + + cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-4230
-6674
-752

query I rowsort
SELECT 25 FROM tab0 cor0 GROUP BY cor0.col2
----
25
25
25

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL ( 57 ) col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
57
57
57

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - cor0.col2 - - ( 22 ) col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-16
-2
-57

query I rowsort
SELECT ALL 81 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
122
140
142

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
15
91
92

query I rowsort
SELECT - + tab2.col1 + - tab2.col1 * col1 FROM tab2 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT ALL + 29 FROM tab0 cor0 GROUP BY col1
----
29
29

query I rowsort
SELECT - 89 AS col0 FROM tab2, tab1 AS cor0 GROUP BY cor0.col0
----
-89
-89
-89

query I rowsort
SELECT - 1 FROM tab2 GROUP BY tab2.col0
----
-1
-1
-1

query I rowsort
SELECT ALL - 99 * + 67 * cor0.col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-298485
-470943
-53064

query I rowsort
SELECT - cor0.col1 * + cor0.col1 * + 32 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-209952
0

query I rowsort
SELECT 30 + + 60 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
90
90
90

onlyif mysql # DIV for integer division: 
query I rowsort label-9620
SELECT DISTINCT + cor0.col0 DIV 66 AS col2 FROM tab1 cor0 GROUP BY col0
----
0
1

skipif mysql # not compatible
query I rowsort label-9620
SELECT DISTINCT + cor0.col0 / 66 AS col2 FROM tab1 cor0 GROUP BY col0
----
0
1

query I rowsort
SELECT DISTINCT + NULLIF ( cor0.col0, 75 ) + cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
182
184
30

query I rowsort
SELECT DISTINCT - + 73 AS col2 FROM tab0 GROUP BY tab0.col0
----
-73

query I rowsort
SELECT + NULLIF ( - cor0.col1, - cor0.col1 ) + - cor0.col2 * - cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 77 AS col2 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2, cor0.col1
----
-77

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9625
SELECT + col1 + - NULLIF ( - 88, cor0.col1 ) - + col1 / - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9625
SELECT + col1 + - NULLIF ( - 88, cor0.col1 ) - + col1 / - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT - 24 + - col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
-103
-48
-62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 43 col2 FROM tab0 cor0 GROUP BY cor0.col2
----
43
43
43

query I rowsort
SELECT + - 1 AS col1 FROM tab2, tab2 AS cor0, tab2 cor1 GROUP BY cor1.col1
----
-1
-1
-1

query I rowsort
SELECT cor0.col0 * - col0 * - 14 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
10976
6776
94136

query I rowsort
SELECT + + 20 FROM tab1, tab0 cor0 GROUP BY cor0.col2
----
20
20
20

query I rowsort
SELECT DISTINCT 31 FROM tab2 AS cor0 GROUP BY col0
----
31

query I rowsort
SELECT DISTINCT cor0.col1 + - 86 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-25
-27
-45

query I rowsort
SELECT ALL + 7 FROM tab2 AS cor0 GROUP BY cor0.col2
----
7
7
7

query I rowsort
SELECT ALL 3 FROM tab1 GROUP BY tab1.col2
----
3
3
3

query I rowsort
SELECT + 45 + + cor0.col2 + + cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
135
187
61

query I rowsort
SELECT + 55 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
55
55
55

query I rowsort
SELECT DISTINCT + tab2.col2 + 16 FROM tab2 GROUP BY tab2.col2
----
103
74
95

query I rowsort
SELECT DISTINCT + 21 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
21

query I rowsort
SELECT - 97 FROM tab1 cor0 GROUP BY cor0.col1
----
-97
-97
-97

query I rowsort
SELECT DISTINCT - ( + cor0.col2 ) AS col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

query I rowsort
SELECT 83 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
83
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 60 col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-60
-60
-60

query I rowsort
SELECT 53 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
53
53
53

query I rowsort
SELECT + 58 FROM tab2 AS cor0 GROUP BY cor0.col1
----
58
58
58

query I rowsort
SELECT 87 * + cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
5046
6873
7569

query I rowsort
SELECT cor0.col0 * cor0.col0 AS col1 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col0
----
1849
676
6889

query I rowsort
SELECT - + 33 AS col2 FROM tab2, tab2 AS cor0, tab1 AS cor1 GROUP BY cor0.col2
----
-33
-33
-33

query I rowsort
SELECT 83 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
83
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 80 col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-80
-80

query I rowsort
SELECT cor0.col1 * 78 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, col0
----
3198
4602
4758

query I rowsort
SELECT ALL - 66 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-66
-66
-66

query I rowsort
SELECT 13 FROM tab0 AS cor0 GROUP BY cor0.col1
----
13
13

query I rowsort
SELECT 60 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
60
60
60

query I rowsort
SELECT DISTINCT - col1 + - ( col1 ) AS col0 FROM tab1 cor0 GROUP BY col1, cor0.col0
----
-114
-12
-88

query I rowsort
SELECT DISTINCT 70 * cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
1540
1960
5740

query I rowsort
SELECT DISTINCT + 72 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
72

query I rowsort
SELECT ALL - 87 * cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-1305
-7917
-8004

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9658
SELECT ALL col1 + CAST( cor0.col1 * + col1 AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1722
3540
3782

skipif mysql # not compatible
query I rowsort label-9658
SELECT ALL col1 + CAST ( cor0.col1 * + col1 AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1722
3540
3782

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + cor0.col1 col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
118
122
82

query I rowsort
SELECT ALL - 39 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-39
-39
-39

query I rowsort
SELECT - 9 FROM tab1 GROUP BY tab1.col0
----
-9
-9
-9

query I rowsort
SELECT - 31 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-31
-31
-31

query I rowsort
SELECT 5 FROM tab2 AS cor0 GROUP BY cor0.col2
----
5
5
5

query I rowsort
SELECT 34 + - 94 AS col1 FROM tab0 GROUP BY tab0.col0
----
-60
-60
-60

query I rowsort
SELECT + 90 FROM tab2 cor0 GROUP BY cor0.col2
----
90
90
90

query I rowsort
SELECT + cor0.col2 - + 72 * - 95 FROM tab0 AS cor0 GROUP BY cor0.col2
----
6864
6878
6919

query I rowsort
SELECT - - 16 FROM tab1, tab2 AS cor0, tab1 AS cor1 GROUP BY cor1.col0
----
16
16
16

query I rowsort
SELECT - 77 * 21 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2, cor0.col2
----
-1617
-1617
-1617

query I rowsort
SELECT - 62 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-62
-62

query I rowsort
SELECT - 29 FROM tab1 GROUP BY tab1.col1
----
-29
-29
-29

query I rowsort
SELECT + cor0.col2 * + 50 * + cor0.col2 AS col0 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col2
----
168200
312050
378450

query I rowsort
SELECT + 69 FROM tab0 AS cor0 GROUP BY cor0.col2
----
69
69
69

query I rowsort
SELECT ALL 23 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
23
23
23

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL cor0.col2 * NULLIF ( + col2, cor0.col2 ) col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9675
SELECT - - CAST( NULL AS SIGNED ) FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9675
SELECT - - CAST ( NULL AS INTEGER ) FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 42 FROM tab0 AS cor0 GROUP BY cor0.col2
----
42

query I rowsort
SELECT DISTINCT + 33 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
33

query I rowsort
SELECT DISTINCT 10 FROM tab2 AS cor0 GROUP BY cor0.col2
----
10

query I rowsort
SELECT ALL - col2 * + 70 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-4060
-5530
-6090

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
58
79
87

query I rowsort
SELECT ( 85 ) + cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
111
128
168

query I rowsort
SELECT DISTINCT - col0 * cor0.col0 - 42 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1, cor0.col1
----
-1891
-6931
-718

query I rowsort
SELECT ALL 43 FROM tab0 GROUP BY tab0.col0
----
43
43
43

query I rowsort
SELECT DISTINCT - 10 * - col2 FROM tab0 GROUP BY tab0.col2
----
240
380
790

onlyif mysql # DIV for integer division: 
query I rowsort label-9685
SELECT 18 DIV + 45 col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9685
SELECT 18 / + 45 col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT + cor0.col1 * 97 FROM tab1 AS cor0 GROUP BY cor0.col1
----
4268
5529
582

onlyif mysql # DIV for integer division: 
query I rowsort label-9687
SELECT ALL + 36 DIV col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9687
SELECT ALL + 36 / col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT ALL - 30 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-30
-30
-30

query I rowsort
SELECT 74 FROM tab2, tab1 AS cor0, tab0 AS cor1 GROUP BY cor0.col1
----
74
74
74

query I rowsort
SELECT DISTINCT 71 FROM tab2 AS cor0 GROUP BY cor0.col1
----
71

query I rowsort
SELECT cor0.col2 + 78 FROM tab1 AS cor0 GROUP BY cor0.col2
----
123
149
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9692
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL

skipif mysql # not compatible
query I rowsort label-9692
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL

query I rowsort
SELECT - 62 * + 15 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-930
-930

query I rowsort
SELECT ALL cor0.col1 + + cor0.col2 FROM tab1 cor0 GROUP BY col1, cor0.col2, cor0.col2
----
102
115
14

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 78 col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-78
-78
-78

query I rowsort
SELECT DISTINCT - 73 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-73

query I rowsort
SELECT 37 AS col1 FROM tab2 cor0 GROUP BY cor0.col1
----
37
37
37

query I rowsort
SELECT + 74 FROM tab0 AS cor0 GROUP BY cor0.col1
----
74
74

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9699
SELECT ALL - + CAST( NULL AS SIGNED ) AS col1 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9699
SELECT ALL - + CAST ( NULL AS INTEGER ) AS col1 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 26 FROM tab2, tab2 AS cor0, tab0 AS cor1 GROUP BY tab2.col2
----
26
26
26

query I rowsort
SELECT 99 + cor0.col1 * - cor0.col1 FROM tab1 AS cor0 GROUP BY col1
----
-1837
-3150
63

query I rowsort
SELECT ALL - 50 AS col0 FROM tab0 cor0 GROUP BY cor0.col2
----
-50
-50
-50

query I rowsort
SELECT ALL 26 FROM tab1 AS cor0 GROUP BY cor0.col1
----
26
26
26

query I rowsort
SELECT - col0 + 94 AS col1 FROM tab1 GROUP BY tab1.col0
----
12
66
72

query I rowsort
SELECT DISTINCT + 56 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
56

query I rowsort
SELECT 19 FROM tab1 AS cor0 GROUP BY cor0.col0
----
19
19
19

query I rowsort
SELECT ALL ( - cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-24
-38
-79

query I rowsort
SELECT ALL - 48 FROM tab0, tab2 AS cor0 GROUP BY tab0.col2
----
-48
-48
-48

query I rowsort
SELECT - 41 * 18 AS col0 FROM tab0 cor0 GROUP BY cor0.col1
----
-738
-738

onlyif mysql # DIV for integer division: 
query I rowsort label-9710
SELECT cor0.col0 DIV - 57 + - 58 FROM tab1 AS cor0 GROUP BY col0
----
-58
-58
-59

skipif mysql # not compatible
query I rowsort label-9710
SELECT cor0.col0 / - 57 + - 58 FROM tab1 AS cor0 GROUP BY col0
----
-58
-58
-59

query I rowsort
SELECT DISTINCT cor0.col0 - 44 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
-29
47
48

query I rowsort
SELECT ALL - 55 FROM tab1, tab2 AS cor0 GROUP BY tab1.col0
----
-55
-55
-55

query I rowsort
SELECT ALL + 56 * cor0.col0 FROM tab1, tab0 cor0 GROUP BY cor0.col0
----
1456
2408
4648

query I rowsort
SELECT DISTINCT - col1 * col2 FROM tab1 AS cor0 GROUP BY col2, cor0.col1, cor0.col1
----
-2565
-3124
-48

query I rowsort
SELECT DISTINCT 92 FROM tab2 AS cor0 GROUP BY cor0.col1
----
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9716
SELECT - cor0.col0 - cor0.col0 DIV ( 35 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-26
-44
-85

skipif mysql # not compatible
query I rowsort label-9716
SELECT - cor0.col0 - cor0.col0 / ( 35 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-26
-44
-85

query I rowsort
SELECT ALL - col1 + 61 FROM tab1 AS cor0 GROUP BY cor0.col1
----
17
4
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9718
SELECT ALL col2 * - CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9718
SELECT ALL col2 * - CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col0
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 + 59 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
117
138
146

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
22
28
82

query I rowsort
SELECT DISTINCT + 91 FROM tab1 AS cor0 GROUP BY cor0.col2
----
91

query I rowsort
SELECT DISTINCT - ( - 96 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
96

query I rowsort
SELECT ALL 24 FROM tab1 AS cor0 GROUP BY cor0.col0
----
24
24
24

query I rowsort
SELECT - cor0.col2 * - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL ( 83 ) AS col1 FROM tab0 cor0 GROUP BY cor0.col1
----
83
83

query I rowsort
SELECT 38 FROM tab0 AS cor0 GROUP BY cor0.col2
----
38
38
38

query I rowsort
SELECT ALL cor0.col2 * + 12 FROM tab0 AS cor0 GROUP BY cor0.col2
----
288
456
948

query I rowsort
SELECT DISTINCT + 68 FROM tab1 AS cor0 GROUP BY cor0.col0
----
68

query I rowsort
SELECT DISTINCT cor0.col0 + col0 * cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
506
6806
812

query I rowsort
SELECT ALL cor0.col1 + + 77 FROM tab2 AS cor0 GROUP BY cor0.col1, col0
----
118
136
138

query I rowsort
SELECT 47 FROM tab1 AS cor0 GROUP BY cor0.col0
----
47
47
47

query I rowsort
SELECT DISTINCT - 35 * - 76 * cor0.col1 FROM tab2 cor0 GROUP BY cor0.col1
----
109060
156940
162260

query I rowsort
SELECT ALL - 78 AS col2 FROM tab2 GROUP BY tab2.col1
----
-78
-78
-78

query I rowsort
SELECT cor0.col0 * + cor0.col2 * + ( 73 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2, cor0.col2
----
12848
425006
91980

query I rowsort
SELECT 55 FROM tab1 AS cor0 GROUP BY cor0.col0
----
55
55
55

query I rowsort
SELECT 45 FROM tab0 AS cor0 GROUP BY cor0.col0, col0
----
45
45
45

query I rowsort
SELECT 92 FROM tab2 AS cor0 GROUP BY cor0.col1
----
92
92
92

query I rowsort
SELECT ALL - - 37 + + 92 AS col0 FROM tab0, tab2 AS cor0 GROUP BY tab0.col0
----
129
129
129

query I rowsort
SELECT cor0.col2 + - cor0.col2 AS col2 FROM tab1 cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT - 27 * cor0.col1 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-1107
-1593
-1647

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - cor0.col2 col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT 51 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
51

query I rowsort
SELECT 67 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
67
67
67

query I rowsort
SELECT ALL tab2.col2 + + 87 FROM tab2 GROUP BY tab2.col2
----
145
166
174

query I rowsort
SELECT - cor0.col1 + - cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-114
-12
-88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( + cor0.col2 ) + - cor0.col2 col1 FROM tab2, tab1 cor0 GROUP BY cor0.col2
----
0

query I rowsort
SELECT 48 * - cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-2160
-3408
-384

query I rowsort
SELECT - 54 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-54
-54
-54

query I rowsort
SELECT - 53 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-53
-53
-53

query I rowsort
SELECT ALL cor0.col1 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col2, cor0.col1
----
0
0
81

query I rowsort
SELECT + 88 * cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1320
8008
8096

query I rowsort
SELECT DISTINCT 68 FROM tab0 AS cor0 GROUP BY cor0.col1
----
68

query I rowsort
SELECT - cor0.col1 + cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
0
0
0

query I rowsort
SELECT DISTINCT 82 + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
127
153
90

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9756
SELECT ALL - CAST( NULL AS DECIMAL ) + 12 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9756
SELECT ALL - CAST ( NULL AS REAL ) + 12 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - ( + 93 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-93

query I rowsort
SELECT ( cor0.col1 ) FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
44
57
6

query I rowsort
SELECT - 60 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-60
-60
-60

query I rowsort
SELECT DISTINCT - tab2.col1 AS col2 FROM tab2, tab2 AS cor0 GROUP BY tab2.col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT cor0.col1 * cor0.col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
0
6561

query I rowsort
SELECT 79 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
79
79
79

query I rowsort
SELECT cor0.col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 57 col1 FROM tab1 cor0 GROUP BY cor0.col1
----
-57
-57
-57

query I rowsort
SELECT DISTINCT - 92 * - cor0.col1 FROM tab1 AS cor0 GROUP BY col1
----
4048
5244
552

query I rowsort
SELECT ALL 2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col2
----
2
2
2

query I rowsort
SELECT 92 + + 93 FROM tab1 AS cor0 GROUP BY cor0.col2, col0
----
185
185
185

query I rowsort
SELECT ALL + 6 * - 27 AS col1 FROM tab1 cor0 GROUP BY cor0.col2
----
-162
-162
-162

query I rowsort
SELECT ALL + 67 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
67
67
67

query I rowsort
SELECT 52 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
52
52
52

query I rowsort
SELECT ALL 34 FROM tab1 AS cor0 GROUP BY cor0.col1
----
34
34
34

query I rowsort
SELECT ALL 4 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
4
4
4

query I rowsort
SELECT + 88 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
88
88
88

query I rowsort
SELECT ALL cor0.col2 + + 40 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
119
127
98

query I rowsort
SELECT ALL 62 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
62
62
62

query I rowsort
SELECT DISTINCT 35 FROM tab0 AS cor0 GROUP BY cor0.col2
----
35

query I rowsort
SELECT DISTINCT cor1.col0 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col1, cor1.col0
----
22
28
82

query I rowsort
SELECT DISTINCT + 30 FROM tab1 AS cor0 GROUP BY col2
----
30

onlyif mysql # DIV for integer division: 
query I rowsort label-9779
SELECT ALL cor0.col1 + - 80 * 15 DIV cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-15
-31
31

skipif mysql # not compatible
query I rowsort label-9779
SELECT ALL cor0.col1 + - 80 * 15 / cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-15
-31
31

query I rowsort
SELECT cor0.col0 FROM tab2, tab0 AS cor0, tab2 AS cor1 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT DISTINCT - ( 39 ) * - cor0.col2 FROM tab0, tab0 cor0 GROUP BY cor0.col2
----
1482
3081
936

query I rowsort
SELECT + 10 * cor0.col2 * - col2 AS col2 FROM tab0 cor0 GROUP BY cor0.col2
----
-14440
-5760
-62410

query I rowsort
SELECT ALL - cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-26
-43
-83

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT 1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1

query I rowsort
SELECT - ( - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
58
79
87

query I rowsort
SELECT 64 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
105
123
125

query I rowsort
SELECT DISTINCT + - cor0.col1 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
-81
0

onlyif mysql # DIV for integer division: 
query I rowsort label-9789
SELECT tab1.col0 * 52 + + tab1.col0 DIV tab1.col0 FROM tab1 GROUP BY tab1.col0
----
1145
1457
4265

skipif mysql # not compatible
query I rowsort label-9789
SELECT tab1.col0 * 52 + + tab1.col0 / tab1.col0 FROM tab1 GROUP BY tab1.col0
----
1145
1457
4265

query I rowsort
SELECT ALL cor0.col1 * - col1 * - 29 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1044
56144
94221

query I rowsort
SELECT col1 + - cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT 43 * cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1032
1634
3397

query I rowsort
SELECT ALL 85 FROM tab2 AS cor0 GROUP BY cor0.col1
----
85
85
85

query I rowsort
SELECT 10 FROM tab2 GROUP BY col2
----
10
10
10

query I rowsort
SELECT DISTINCT 70 FROM tab1 AS cor0 GROUP BY cor0.col1
----
70

query I rowsort
SELECT ALL - + 11 FROM tab0, tab1 cor0 GROUP BY tab0.col2
----
-11
-11
-11

query I rowsort
SELECT 4 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1
----
4
4
4

query I rowsort
SELECT + 86 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, col0
----
86
86
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 70 col0 FROM tab1 AS cor0 GROUP BY col2
----
70

query I rowsort
SELECT - 68 AS col1 FROM tab0 cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
----
-68
-68

query I rowsort
SELECT 5 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
5
5
5

query I rowsort
SELECT 33 * col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
1485
2343
264

query I rowsort
SELECT DISTINCT - + 27 + - 68 AS col1 FROM tab2, tab2 AS cor0 GROUP BY tab2.col0
----
-95

query I rowsort
SELECT 72 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
72
72
72

query I rowsort
SELECT ALL col0 - 92 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-10
-64
-70

query I rowsort
SELECT DISTINCT cor0.col1 * 75 FROM tab2, tab1 AS cor0, tab2 AS cor1 GROUP BY cor0.col1
----
3300
4275
450

query I rowsort
SELECT + - 79 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-79
-79
-79

query I rowsort
SELECT + 61 AS col1 FROM tab2 GROUP BY tab2.col1
----
61
61
61

query I rowsort
SELECT DISTINCT - 4 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col0, cor0.col1
----
-4

query I rowsort
SELECT ALL + 2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2
2
2

query I rowsort
SELECT + 39 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
39
39

query I rowsort
SELECT ALL - 37 AS col2 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
-37
-37
-37

query I rowsort
SELECT DISTINCT + 51 AS col2 FROM tab0, tab2 AS cor0, tab1 cor1 GROUP BY tab0.col2
----
51

query I rowsort
SELECT DISTINCT + 40 + + cor0.col1 AS col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
46
84
97

query I rowsort
SELECT - 94 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-94
-94
-94

query I rowsort
SELECT DISTINCT + 89 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2
----
89

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9817
SELECT DISTINCT cor0.col2 / + CAST( NULL AS SIGNED ) AS col1 FROM tab1 cor0 GROUP BY cor0.col2
----
NULL

skipif mysql # not compatible
query I rowsort label-9817
SELECT DISTINCT cor0.col2 / + CAST ( NULL AS INTEGER ) AS col1 FROM tab1 cor0 GROUP BY cor0.col2
----
NULL

query I rowsort
SELECT DISTINCT - cor0.col2 - 7 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-65
-86
-94

query I rowsort
SELECT DISTINCT - cor0.col1 * 16 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-704
-912
-96

query I rowsort
SELECT col1 * col1 + cor0.col1 AS col1 FROM tab0 cor0 GROUP BY cor0.col1
----
0
6642

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 76 col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
76
76
76

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9822
SELECT ALL CAST( - 51 AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-51
-51
-51

skipif mysql # not compatible
query I rowsort label-9822
SELECT ALL CAST ( - 51 AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-51
-51
-51

query I rowsort
SELECT ALL - 84 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
-84
-84
-84

query I rowsort
SELECT ALL col2 * - 59 FROM tab1 AS cor0 GROUP BY col2
----
-2655
-4189
-472

query I rowsort
SELECT DISTINCT - 6 AS col0 FROM tab0 cor0 GROUP BY cor0.col1
----
-6

query I rowsort
SELECT ALL - - 78 FROM tab2 GROUP BY tab2.col2
----
78
78
78

query I rowsort
SELECT DISTINCT 79 FROM tab0 AS cor0 GROUP BY cor0.col1
----
79

onlyif mysql # DIV for integer division: 
query I rowsort label-9828
SELECT DISTINCT + cor0.col2 DIV 77 col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
0
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9828
SELECT DISTINCT + cor0.col2 / 77 col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
0
1

query I rowsort
SELECT DISTINCT 79 FROM tab1 GROUP BY tab1.col0
----
79

query I rowsort
SELECT DISTINCT 4 + 10 + 45 FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
----
59

query I rowsort
SELECT + 82 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
82
82

query I rowsort
SELECT ALL 56 + 49 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
105
105
105

query I rowsort
SELECT - 4 + cor0.col0 + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
162
48
82

query I rowsort
SELECT + 21 AS col2 FROM tab1 GROUP BY tab1.col2
----
21
21
21

onlyif mysql # DIV for integer division: 
query I rowsort label-9835
SELECT ALL + 52 DIV - cor1.col1 FROM tab2, tab2 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-9835
SELECT ALL + 52 / - cor1.col1 FROM tab2, tab2 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
-1
0
0

query I rowsort
SELECT + ( 67 ) FROM tab2 AS cor0 GROUP BY col0
----
67
67
67

query I rowsort
SELECT ( cor0.col2 ) * cor0.col2 FROM tab0, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - 48 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-48

query I rowsort
SELECT + 96 * 97 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
9312
9312
9312

query I rowsort
SELECT DISTINCT - 15 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-15

query I rowsort
SELECT 32 FROM tab0 cor0 GROUP BY cor0.col0
----
32
32
32

query I rowsort
SELECT ALL - cor0.col0 + + ( cor0.col0 ) + cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT ALL + cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
26
43
83

query I rowsort
SELECT ALL 59 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
59
59

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 54 col2 FROM tab2, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
-54

query I rowsort
SELECT - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + 81 AS col2 FROM tab1 cor0 GROUP BY cor0.col1
----
81

onlyif mysql # DIV for integer division: 
query I rowsort label-9848
SELECT + 80 DIV - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-1
-1
0

skipif mysql # not compatible
query I rowsort label-9848
SELECT + 80 / - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-1
-1
0

query I rowsort
SELECT ALL - 70 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-70
-70
-70

query I rowsort
SELECT DISTINCT cor0.col0 * - 65 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-5915
-5980
-975

query I rowsort
SELECT DISTINCT cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
15
91
92

query I rowsort
SELECT DISTINCT - cor0.col0 - 45 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-128
-71
-88

query I rowsort
SELECT 21 AS col1 FROM tab1 cor0 GROUP BY cor0.col2
----
21
21
21

query I rowsort
SELECT 44 FROM tab0 AS cor0 GROUP BY cor0.col1
----
44
44

query I rowsort
SELECT 52 FROM tab2 AS cor0 GROUP BY cor0.col2
----
52
52
52

query I rowsort
SELECT DISTINCT + ( 43 ) FROM tab0 cor0 GROUP BY cor0.col0
----
43

query I rowsort
SELECT DISTINCT - 31 AS col1 FROM tab0, tab2 cor0 GROUP BY cor0.col1
----
-31

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - cor0.col1 + 92 col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
35
48
86

query I rowsort
SELECT cor0.col1 * 72 FROM tab1 AS cor0 GROUP BY cor0.col1
----
3168
4104
432

query I rowsort
SELECT ALL 64 * - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-5184
0

query I rowsort
SELECT ALL - 41 FROM tab0 GROUP BY tab0.col0
----
-41
-41
-41

query I rowsort
SELECT - 59 + cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2, col2
----
-1
20
28

query I rowsort
SELECT 92 FROM tab2 AS cor0 GROUP BY col0
----
92
92
92

query I rowsort
SELECT ALL 10 AS col2 FROM tab2 cor0 GROUP BY col2, cor0.col0
----
10
10
10

query I rowsort
SELECT ALL + col1 + 99 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
180
99
99

query I rowsort
SELECT 16 FROM tab0 AS cor0 GROUP BY cor0.col0
----
16
16
16

query I rowsort
SELECT + 6 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
6
6
6

query I rowsort
SELECT ALL + - 0 FROM tab2 GROUP BY tab2.col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 6 + + 39 col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
45
45
45

query I rowsort
SELECT DISTINCT 8 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
8

query I rowsort
SELECT DISTINCT - 57 * cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1368
-2166
-4503

query I rowsort
SELECT ALL cor0.col0 * - cor0.col0 * - 22 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
14872
151558
40678

query I rowsort
SELECT DISTINCT ( - 99 ) AS col2 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col0
----
-99

query I rowsort
SELECT ( col1 ) FROM tab1 GROUP BY tab1.col1
----
44
57
6

query I rowsort
SELECT ALL + cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, cor0.col1
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-9876
SELECT DISTINCT + 99 DIV cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1
2

skipif mysql # not compatible
query I rowsort label-9876
SELECT DISTINCT + 99 / cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1
2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 1 col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-1
-1
-1

query I rowsort
SELECT 44 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
44
44
44

query I rowsort
SELECT ALL - col2 * - col2 + - 28 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col1
----
1997
36
5013

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + cor0.col2 col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
45
71
8

query I rowsort
SELECT 84 FROM tab1 cor0 GROUP BY cor0.col2
----
84
84
84

query I rowsort
SELECT DISTINCT - 73 + + cor0.col2 * + 59 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
1343
2169
4588

query I rowsort
SELECT ALL + + 88 AS col1 FROM tab2 GROUP BY tab2.col1
----
88
88
88

query I rowsort
SELECT cor0.col0 * + 75 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1950
3225
6225

query I rowsort
SELECT ALL 5 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
5
5

query I rowsort
SELECT DISTINCT + 89 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
89

query I rowsort
SELECT DISTINCT 71 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
71

query I rowsort
SELECT 76 * - cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-3116
-4484
-4636

query I rowsort
SELECT DISTINCT cor0.col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, cor0.col0
----
26
43
83

query I rowsort
SELECT 9 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
9
9
9

query I rowsort
SELECT DISTINCT 88 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
88

query I rowsort
SELECT DISTINCT - cor0.col0 * cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-225
-8281
-8464

query I rowsort
SELECT ALL - 28 + + 72 FROM tab1 GROUP BY col2
----
44
44
44

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9894
SELECT ALL + cor0.col0 + - CAST( NULL AS DECIMAL ) FROM tab0 AS cor0 GROUP BY cor0.col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9894
SELECT ALL + cor0.col0 + - CAST ( NULL AS REAL ) FROM tab0 AS cor0 GROUP BY cor0.col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT cor0.col0 + + 20 + - col0 FROM tab2 cor0 GROUP BY cor0.col0
----
20

query I rowsort
SELECT + NULLIF ( - tab1.col1, tab1.col1 ) FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + cor0.col0 * 98 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1470
8918
9016

query I rowsort
SELECT DISTINCT - 67 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-67

query I rowsort
SELECT - + ( cor0.col0 ) FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9900
SELECT - col2 + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9900
SELECT - col2 + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 2 AS col0 FROM tab0 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col1
----
2
2

query I rowsort
SELECT DISTINCT 12 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
12

query I rowsort
SELECT 55 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
55
55
55

query I rowsort
SELECT ALL NULLIF ( 73, cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
73
73

query I rowsort
SELECT + 42 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
42
42
42

query I rowsort
SELECT - 46 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-46
-46

query I rowsort
SELECT DISTINCT + cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - 21 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-21
-21
-21

query I rowsort
SELECT - cor0.col0 + + 77 * 3 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
149
203
209

query I rowsort
SELECT - col1 + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-57
38
79

query I rowsort
SELECT ALL 53 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
53
53
53

query I rowsort
SELECT ALL cor0.col1 + 50 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
107
56
94

query I rowsort
SELECT DISTINCT + - ( - 86 ) FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
86

query I rowsort
SELECT ALL 9 FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
9
9
9

query I rowsort
SELECT DISTINCT + cor0.col0 + - 53 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-25
-31
29

onlyif mysql # DIV for integer division: 
query I rowsort label-9916
SELECT ALL cor0.col2 * cor0.col0 DIV - 62 + - cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, col2
----
-178
-206
-36

skipif mysql # not compatible
query I rowsort label-9916
SELECT ALL cor0.col2 * cor0.col0 / - 62 + - cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, col2
----
-178
-206
-36

query I rowsort
SELECT DISTINCT + 51 AS col0 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
51

query I rowsort
SELECT DISTINCT cor0.col1 * + 77 FROM tab1 AS cor0 GROUP BY cor0.col0, col1
----
3388
4389
462

query I rowsort
SELECT 47 FROM tab1 AS cor0 GROUP BY cor0.col2
----
47
47
47

query I rowsort
SELECT 99 FROM tab1 cor0 GROUP BY cor0.col0
----
99
99
99

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9921
SELECT - CAST( NULL AS DECIMAL ) col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9921
SELECT - CAST ( NULL AS REAL ) col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT + 25 * - cor0.col1 - + 15 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-1040
-1490
-1540

query I rowsort
SELECT DISTINCT + cor0.col0 + - 24 FROM tab0 AS cor0 GROUP BY cor0.col0
----
19
2
59

query I rowsort
SELECT ALL - cor0.col2 AS col1 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col2, cor1.col1, cor1.col0
----
9 values hashing to 976cc931872319f6c60dc588d08fa95d

query I rowsort
SELECT - cor0.col2 * + 26 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1170
-1846
-208

query I rowsort
SELECT DISTINCT + cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-9927
SELECT DISTINCT + 48 + cor0.col0 DIV 77 col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
48
49

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9927
SELECT DISTINCT + 48 + cor0.col0 / 77 col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
48
49

query I rowsort
SELECT + 94 AS col0 FROM tab2, tab0 AS cor0 GROUP BY tab2.col2
----
94
94
94

query I rowsort
SELECT DISTINCT cor0.col2 + + 82 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
140
161
169

query I rowsort
SELECT ALL + 8 FROM tab2 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
8
8
8

query I rowsort
SELECT 98 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
98
98
98

query I rowsort
SELECT DISTINCT + 25 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
25

query I rowsort
SELECT 7 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
7
7
7

query I rowsort
SELECT ALL - 26 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-26
-26
-26

query I rowsort
SELECT - cor0.col0 + 36 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-47
-7
10

query I rowsort
SELECT ALL + 72 FROM tab1 GROUP BY tab1.col2
----
72
72
72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col0 - 99 * + cor0.col0 col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2156
-2744
-8036

query I rowsort
SELECT ALL cor0.col0 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 53 + + cor0.col0 col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
136
79
96

query I rowsort
SELECT - - 39 FROM tab0 GROUP BY tab0.col1
----
39
39

query I rowsort
SELECT 78 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
78
78
78

query I rowsort
SELECT + 45 * - cor0.col0 FROM tab2 AS cor0 GROUP BY col0
----
-4095
-4140
-675

query I rowsort
SELECT DISTINCT col0 - 7 * - 94 FROM tab0 AS cor0 GROUP BY cor0.col0
----
684
701
741

query I rowsort
SELECT ALL - 74 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-74
-74
-74

query I rowsort
SELECT DISTINCT cor0.col2 - 17 * col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-1264
-384
-608

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9946
SELECT - + CAST( NULL AS SIGNED ) FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9946
SELECT - + CAST ( NULL AS INTEGER ) FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT 55 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
55
55
55

query I rowsort
SELECT cor0.col1 * - 54 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-2214
-3186
-3294

query I rowsort
SELECT ALL - 17 + - cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-25
-62
-88

query I rowsort
SELECT cor0.col0 + 34 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
125
126
49

query I rowsort
SELECT 1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
1
1
1

query I rowsort
SELECT + ( - cor0.col2 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

query I rowsort
SELECT - 43 + - 4 - - 32 AS col1 FROM tab0, tab2 AS cor0 GROUP BY cor0.col0
----
-15
-15
-15

query I rowsort
SELECT 15 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
15
15
15

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9955
SELECT DISTINCT + CAST( 58 AS SIGNED ) + + col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
103
129
66

skipif mysql # not compatible
query I rowsort label-9955
SELECT DISTINCT + CAST ( 58 AS INTEGER ) + + col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
103
129
66

query I rowsort
SELECT ALL - cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-81
0
0

query I rowsort
SELECT + 43 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, col2
----
43
43
43

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 80 + 85 col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
5

query I rowsort
SELECT ALL + cor0.col2 * 50 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2, col1
----
2250
3550
400

query I rowsort
SELECT - cor0.col1 + 89 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
32
45
83

query I rowsort
SELECT 86 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
127
145
147

query I rowsort
SELECT + 5 FROM tab2 cor0 GROUP BY cor0.col1, col2, cor0.col2
----
5
5
5

query I rowsort
SELECT DISTINCT - cor0.col1 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
0

query I rowsort
SELECT - 44 * - 1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
44
44
44

onlyif mysql # DIV for integer division: 
query I rowsort label-9965
SELECT cor0.col1 * col1 DIV + 60 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
32
54

skipif mysql # not compatible
query I rowsort label-9965
SELECT cor0.col1 * col1 / + 60 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
32
54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 26 col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-26
-26
-26

query I rowsort
SELECT ALL cor0.col1 * 93 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
3813
5487
5673

query I rowsort
SELECT + 17 AS col0 FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
17
17
17

query I rowsort
SELECT - 11 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-11
-11

query I rowsort
SELECT - - 37 AS col2 FROM tab0, tab1 AS cor0, tab2 AS cor1 GROUP BY cor0.col2
----
37
37
37

query I rowsort
SELECT - 87 * col1 FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
-3567
-5133
-5307

query I rowsort
SELECT DISTINCT 27 - cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-11
-52
3

query I rowsort
SELECT DISTINCT + tab2.col2 * 85 FROM tab2 GROUP BY tab2.col2
----
4930
6715
7395

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9974
SELECT tab0.col0 + - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY tab0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9974
SELECT tab0.col0 + - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY tab0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT col0 - 37 FROM tab1 AS cor0 GROUP BY col0
----
-15
-9
45

onlyif mysql # DIV for integer division: 
query I rowsort label-9976
SELECT DISTINCT col1 DIV + cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
1

skipif mysql # not compatible
query I rowsort label-9976
SELECT DISTINCT col1 / + cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
1

query I rowsort
SELECT 63 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
63
63
63

query I rowsort
SELECT + cor0.col0 AS col0 FROM tab0, tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT DISTINCT - 48 * + 51 + + cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-2369
-2410
-2424

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9980
SELECT ALL CAST( 93 AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
93
93

skipif mysql # not compatible
query I rowsort label-9980
SELECT ALL CAST ( 93 AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
93
93

query I rowsort
SELECT - + 96 AS col0 FROM tab1, tab1 cor0 GROUP BY cor0.col1
----
-96
-96
-96

query I rowsort
SELECT ALL 61 FROM tab0 cor0 GROUP BY cor0.col2
----
61
61
61

query I rowsort
SELECT ALL 14 FROM tab0 AS cor0 GROUP BY col2
----
14
14
14

query I rowsort
SELECT ALL + ( 31 + - 94 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
-63
-63
-63

query I rowsort
SELECT + 5 * cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0
----
130
215
415

onlyif mysql # DIV for integer division: 
query I rowsort label-9986
SELECT + 6 DIV + 7 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-9986
SELECT + 6 / + 7 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT ALL - cor0.col1 * 3 + 37 * 26 * - col1 FROM tab1 cor0 GROUP BY cor0.col1
----
-42460
-55005
-5790

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9988
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab1, tab1 cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9988
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab1, tab1 cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT cor0.col1 * col2 + cor0.col1 * - 34 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-810
0
0

query I rowsort
SELECT 76 * - 94 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-7144
-7144
-7144

query I rowsort
SELECT DISTINCT - 83 AS col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
-83

query I rowsort
SELECT ALL cor0.col2 + cor0.col2 * 56 FROM tab1 AS cor0 GROUP BY cor0.col2
----
2565
4047
456

query I rowsort
SELECT DISTINCT 25 * + cor0.col1 * + cor0.col0 AS col2 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col0, cor0.col1
----
0
87075

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9994
SELECT - CAST( NULL AS SIGNED ) + - 29 FROM tab2, tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9994
SELECT - CAST ( NULL AS INTEGER ) + - 29 FROM tab2, tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 49 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
49

query I rowsort
SELECT ALL 36 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
36
36

query I rowsort
SELECT DISTINCT cor0.col1 + 79 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
123
136
85

query I rowsort
SELECT - 63 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-63
-63
-63

query I rowsort
SELECT DISTINCT + cor0.col0 + + cor0.col0 * cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
506
6806
812

