sqllogictest
Artifact Content
Not logged in

Artifact baf2eb9478313e6ddaff9d0fcda0b19b3c00407c:


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 r