sqllogictest

Artifact [adbe54ece2]
Login

Artifact adbe54ece24238c13994d304704f6a22f1324803:


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)

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

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

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2 HAVING - + col2 >= - - col2
----

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

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

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING - + col0 >= 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 NOT ( NOT col2 IS NOT NULL )
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 * + - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
1681
3481
3721

query I rowsort
SELECT DISTINCT - col2 * - col2 * - - col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
2085136
331776
38950081

query II rowsort
SELECT col1, + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
71
57
45
6
8

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

query I rowsort
SELECT ALL - AVG ( ALL - - col2 ) * - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL <= NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

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

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 WHERE NOT + col2 / + col1 > NULL GROUP BY col2
----

query I rowsort
SELECT - col2 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) IS NULL
----
0
0
0

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

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

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

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 AS cor0 WHERE col0 IS NULL GROUP BY col0, col2
----

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

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

query I rowsort
SELECT + col2 * - col0 FROM tab1 WHERE NULL <= NULL GROUP BY col2, col0
----

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 col0 * - - col1 * + col0 AS col0 FROM tab1 GROUP BY col1, col0
----
2904
295856
44688

query I rowsort
SELECT - col1 * - + col1 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-185193
-216
-85184

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

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

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

query I rowsort
SELECT ALL col0 + col0 AS col2 FROM tab1 GROUP BY col0
----
164
44
56

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

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

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 - col1 * + + col1 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

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

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

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

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

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NOT col1 BETWEEN col2 * + col2 AND NULL )
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

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

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

query I rowsort
SELECT ALL + + col0 - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
105
121
67

query II rowsort
SELECT + col2 * col1 AS col0, - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
-57
3124
-44
48
-6

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - col0 * - - col2 AND + + col0 * - col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-45
SELECT ALL col2 DIV - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-45
SELECT ALL col2 / - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

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

query I rowsort
SELECT DISTINCT - - col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col2 * col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
2025
5041
64

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

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

query I rowsort
SELECT + col1 + + col0 FROM tab0 GROUP BY col1, col0, col2
----
124
26
83

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

onlyif mysql # DIV for integer division: 
query I rowsort label-54
SELECT col0 * - col0 DIV - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-54
SELECT col0 * - col0 / - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col0 - - col0 AS col0 FROM tab1 GROUP BY col0
----
164
44
56

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

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

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col1, col0, col0
----
-26
-43
-83

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

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

onlyif mysql # DIV for integer division: 
query I rowsort label-64
SELECT col0 DIV + col0 FROM tab1 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-64
SELECT col0 / + col0 FROM tab1 GROUP BY col1, col0
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-65
SELECT + col2 DIV - col2 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-65
SELECT + col2 / - col2 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL - col2 + col0 FROM tab2 GROUP BY col0, col2, col1
----
-72
12
34

query I rowsort
SELECT DISTINCT - col0 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 + + col2 col2 FROM tab0 GROUP BY col1, col1, col2
----
105
38
79

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

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

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

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

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

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

query I rowsort
SELECT col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-78
SELECT DISTINCT + col1 DIV - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1

skipif mysql # not compatible
query I rowsort label-78
SELECT DISTINCT + col1 / - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 * - col0 * col0 FROM tab1 GROUP BY col0
----
10648
21952
551368

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT - col2 * + col2 * col1 FROM tab2 GROUP BY col2, col1
----
-137924
-368219
-461709

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

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

query I rowsort
SELECT DISTINCT col2 * - col2 AS col1 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL col2 AS col0, + col2 FROM tab2 GROUP BY col2, col2 HAVING col0 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 * - col0 * col0 FROM tab2 GROUP BY col0
----
3375
753571
778688

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col2 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 GROUP BY col0, col0
----
26
43
83

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

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

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

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

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
22
28
82

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

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

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

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

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

query II rowsort
SELECT - col0, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

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

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

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

query I rowsort
SELECT + col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
-6561
0

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

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

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

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

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING ( NULL ) IS NULL
----
58
79
87

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-114
SELECT col0 DIV - col0 + + col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-114
SELECT col0 / - col0 + + col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 * - + col1 - - col1 FROM tab1 cor0 GROUP BY col1
----
1980
3306
42

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

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col1, col1 HAVING + col1 IS NOT NULL
----
24
38
79

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

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

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

query I rowsort
SELECT DISTINCT + col0 FROM tab2 cor0 WHERE NOT ( + col2 ) IS NOT NULL GROUP BY col1, col0
----

query II rowsort
SELECT col1, - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
-41
59
-59
61
-61

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

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

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

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

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

query I rowsort
SELECT ALL - col2 * col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

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

query I rowsort
SELECT col1 AS col1 FROM tab0 WHERE - col1 >= NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 * - + col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

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

query I rowsort
SELECT DISTINCT col1 * col1 FROM tab1 GROUP BY col1, col2
----
1936
3249
36

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

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

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

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 WHERE + + col2 IS NOT NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2, col1 HAVING ( NULL ) BETWEEN NULL AND + col1
----

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

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

query I rowsort
SELECT ALL + AVG ( - col2 ) AS col1 FROM tab1 AS cor0 WHERE ( NULL ) >= - col1 * + + col0 GROUP BY col2
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

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

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

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

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

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - AVG ( + + col1 ) IS NULL
----
15
91
92

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

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

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

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

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

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

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

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

skipif mysql # not compatible
query I rowsort label-159
SELECT DISTINCT + col2 / - + col1 AS col0 FROM tab1 GROUP BY col2, col1
----
-1
0

query I rowsort
SELECT DISTINCT + - col2 * col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 <> ( NULL )
----

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

query I rowsort
SELECT DISTINCT + - col0 + + + AVG ( ALL - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

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

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

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

query II rowsort
SELECT col0 AS col1, col0 FROM tab0 GROUP BY col0, col2
----
26
26
43
43
83
83

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

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

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

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

query I rowsort
SELECT ALL + col0 * - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

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

query I rowsort
SELECT ALL col0 + + col0 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL OR NOT ( NULL ) NOT BETWEEN ( NULL ) AND NULL GROUP BY col0
----
166
52
86

onlyif mysql # DIV for integer division: 
query I rowsort label-174
SELECT col2 DIV + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-174
SELECT col2 / + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

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

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

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

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

query I rowsort
SELECT + col2 * - col1 FROM tab0 GROUP BY col2, col1
----
-1944
0
0

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

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

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

query I rowsort
SELECT col2 + + col2 FROM tab1 GROUP BY col2, col0
----
142
16
90

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL <= + col0
----

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

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

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

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT col0 AS col0 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

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

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

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

query I rowsort
SELECT col2 / + + col2 FROM tab0 AS cor0 WHERE NOT ( ( NOT NULL IS NOT NULL ) ) GROUP BY col2
----

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

query II rowsort
SELECT DISTINCT col0, + col1 AS col2 FROM tab0 GROUP BY col0, col1, col0
----
26
0
43
81
83
0

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

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

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col0, col1, col1 HAVING NOT NULL <= ( NULL )
----

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

query I rowsort
SELECT ALL - col1 * col0 FROM tab2 GROUP BY col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT col0 FROM tab0 WHERE NOT + col2 IS NULL GROUP BY col0, col1, col1
----
26
43
83

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

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

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

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

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

query I rowsort
SELECT col2 * - col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-1032
-2054
-3154

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

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

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

query II rowsort
SELECT col1, - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * + col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - - col0 * col1 + col0 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
3864
5460
930

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

query I rowsort
SELECT + - col2 FROM tab1 cor0 GROUP BY col2 HAVING ( ( + - col2 <> NULL ) )
----

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-225
SELECT - col0 DIV col0 FROM tab1 WHERE NOT + col0 IS NULL GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-225
SELECT - col0 / col0 FROM tab1 WHERE NOT + col0 IS NULL GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT - col1 * - col1 FROM tab1 GROUP BY col2, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT col0 * - col0 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-10648
-21952
-551368

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

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

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

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

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

query I rowsort
SELECT ALL - col1 FROM tab1 cor0 GROUP BY col1, col1, col2 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - + col2 IS NOT NULL
----
24
38
79

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

query I rowsort
SELECT + col1 * + col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
132
1596
3608

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT col0 IS NULL
----
3364
6241
7569

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

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

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

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

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

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

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

query II rowsort
SELECT DISTINCT + col1, col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT - col2 - + col2 FROM tab2 cor0 GROUP BY col1, col2 HAVING - col1 IS NOT NULL
----
-116
-158
-174

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

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

query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-116
-158
-174

query I rowsort
SELECT col1 * col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL < NULL
----

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

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

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

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

query I rowsort
SELECT AVG ( col0 ) / col2 - - + col2 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 / + col0 AS 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 ALL col0 * + col0 + - - col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
506
6806
812

query I rowsort
SELECT col0 FROM tab1 WHERE NOT + col0 < + col2 GROUP BY col0, col0
----
22
82

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

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT DISTINCT + col0 + col1, col0 * + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col1, col0 HAVING NULL IS NULL
----
133
8464
150
8281
76
225

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

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

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

query I rowsort
SELECT col2 FROM tab1 GROUP BY col1, col0, col2 HAVING - - AVG ( ALL - - col2 ) + AVG ( ALL col1 ) IS NOT NULL
----
45
71
8

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

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

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

query I rowsort
SELECT - col0 * - col0 / - AVG ( + col0 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 AS cor0 WHERE col2 = NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL >= NULL
----

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

query I rowsort
SELECT col2 + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
142
16
90

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

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab1 GROUP BY col2
----
0

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

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 * + - col1 >= ( NULL )
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

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

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> NULL
----

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

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

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

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL col1 + col1 FROM tab0 GROUP BY col0, col1
----
0
0
162

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

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL BETWEEN - col2 AND NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 cor0 GROUP BY col0 HAVING ( NOT NULL > NULL )
----

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

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

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

query I rowsort
SELECT ALL - col0 * + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

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

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
15
91
92

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col0 * + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col1 AND NULL
----

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

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

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

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col1, col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + - col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT AVG ( + + col1 ) FROM tab0 WHERE NOT ( NULL ) BETWEEN ( col1 ) AND + col0 GROUP BY col1
----

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

query I rowsort
SELECT DISTINCT col1 + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
105
38
79

query I rowsort
SELECT ALL + col1 + - col1 FROM tab1 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 / + AVG ( DISTINCT - col0 ) col2 FROM tab2 AS cor0 WHERE NOT + col2 <> + col1 GROUP BY col0
----

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

query I rowsort
SELECT - col1 AS col1 FROM tab2 WHERE NULL = NULL GROUP BY col1
----

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

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

query I rowsort
SELECT - col2 - + + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-105
-121
-67

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

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

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

query I rowsort
SELECT DISTINCT + col1 * + - col1 * col1 FROM tab0 GROUP BY col1, col1
----
-531441
0

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

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) NOT BETWEEN ( NULL ) AND NULL
----

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

query I rowsort
SELECT DISTINCT + col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL <= NULL
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NULL OR NULL IS NULL
----
22
28
82

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - col0 + col0 * col0 AS col2 FROM tab1 GROUP BY col0
----
462
6642
756

query I rowsort
SELECT - col0 + + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col1 * + col1 + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

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

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
158
48
76

query I rowsort
SELECT col0 + + + col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT col0 + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col1 HAVING NULL > NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
44
57
6

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

query I rowsort
SELECT ALL col0 * - + col1 FROM tab2 GROUP BY col1, col0, col1
----
-3772
-5369
-915

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 AS col1, + col1 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
44
57
57
6
6

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
58
79
87

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 AS col0, col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT + col2 IS NULL
----
-58
58
-79
79
-87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

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

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL > NULL )
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

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

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

query I rowsort
SELECT - - col0 FROM tab0 WHERE NULL NOT BETWEEN NULL AND - col1 GROUP BY col0, col1
----

query I rowsort
SELECT - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

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

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

query I rowsort
SELECT DISTINCT col0 * + - col0 * + col0 - - col0 FROM tab0 GROUP BY col0, col0
----
-17550
-571704
-79464

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

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

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

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

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

query II rowsort
SELECT ALL - AVG ( - col1 ) AS col2, col1 AS col2 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

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

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

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

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

query I rowsort
SELECT ALL - col2 * - col1 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
2378
4661
5307

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

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

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

query I rowsort
SELECT ALL - col0 + - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 col2, - col2 * - col2 FROM tab0 GROUP BY col1, col2
----
24
576
38
1444
79
6241

query I rowsort
SELECT DISTINCT col1 FROM tab1 cor0 WHERE col0 * + col1 >= NULL GROUP BY col1, col0, col1
----

query I rowsort
SELECT ALL - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

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

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

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col1, col2
----
44
57
6

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

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

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 WHERE col1 IS NULL GROUP BY col0
----

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-422
SELECT - col2 DIV col2 FROM tab2 GROUP BY col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-422
SELECT - col2 / col2 FROM tab2 GROUP BY col2, col0
----
-1
-1
-1

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

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

query I rowsort
SELECT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + + col2 IS NULL
----
-24
-38
-79

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

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

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

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

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

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

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

query I rowsort
SELECT ALL col1 + + + col1 FROM tab0 GROUP BY col1, col1
----
0
162

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

query I rowsort
SELECT col0 * - col0 * - col0 AS col0 FROM tab1 GROUP BY col0, col0, col0
----
10648
21952
551368

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79

query I rowsort
SELECT - col1 * + - col2 FROM tab0 GROUP BY col1, col2, col1
----
0
0
1944

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL BETWEEN NULL AND + + col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-22
-28
-82

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

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

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

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

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 * + col2 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
1482
600
6320

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
158
48
76

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 NULL NOT BETWEEN NULL AND + + col1
----

query I rowsort
SELECT + - col2 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING + AVG ( ALL - col1 ) <= NULL
----

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

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

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col1, col2, col1 HAVING NULL IS NULL
----
-45
-71
-8

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

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
44
57
6

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

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

query I rowsort
SELECT DISTINCT col1 * - col1 AS col1 FROM tab0 GROUP BY col1
----
-6561
0

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 - - col2 col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT col2 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query II rowsort
SELECT col0 AS col1, col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab1 GROUP BY col1
----
44
57
6

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

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

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

query I rowsort
SELECT col0 * - col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-475
SELECT - col0 DIV + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-475
SELECT - col0 / + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL col1 * - + col1 AS col0 FROM tab0 GROUP BY col1
----
-6561
0

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

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

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 WHERE NOT NULL <= NULL GROUP BY col2
----

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

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

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

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

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

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

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

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

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col0 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1, - col1 col2 FROM tab2 GROUP BY col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 WHERE col1 IS NOT NULL GROUP BY col0
----
15
91
92

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

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

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

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

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

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

query II rowsort
SELECT ALL col2 AS col0, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 GROUP BY col1, col0, col2
----
22
28
82

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT - - col1 <> NULL GROUP BY col1, col0, col0
----

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

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT col0 + col0 FROM tab0 GROUP BY col0
----
166
52
86

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col0, col1
----
-44
-57
-6

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

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL + - col1 * + - col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
1722
3540
3782

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-511
SELECT ALL - col0 - + + col0 DIV - col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-90
-90

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-511
SELECT ALL - col0 - + + col0 / - col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-90
-90

query I rowsort
SELECT - - col2 * + - col2 * - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
13824
493039
54872

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

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - col1 >= NULL
----

query II rowsort
SELECT DISTINCT col2, col2 + + - col2 AS col1 FROM tab0 GROUP BY col2
----
24
0
38
0
79
0

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

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

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

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

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

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col0, col1, col2 HAVING NOT + col1 BETWEEN NULL AND col0
----
-81

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

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING NULL > col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-524
SELECT DISTINCT + col1 DIV + col1 FROM tab1 GROUP BY col1, col1
----
1

skipif mysql # not compatible
query I rowsort label-524
SELECT DISTINCT + col1 / + col1 FROM tab1 GROUP BY col1, col1
----
1

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 WHERE ( + col2 ) BETWEEN NULL AND col2 GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 - - col2 FROM tab0 GROUP BY col2
----
158
48
76

onlyif mysql # DIV for integer division: 
query I rowsort label-527
SELECT ALL col2 DIV + col0 - + - col0 - col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-527
SELECT ALL col2 / + col0 - + - col0 - col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
0
0
1

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

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

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

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

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 - col2 * + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

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

query I rowsort
SELECT + col0 - col0 AS col2 FROM tab2 GROUP BY col0
----
0
0
0

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

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

query I rowsort
SELECT col1 + + col0 FROM tab2 GROUP BY col1, col0, col1
----
133
150
76

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

query I rowsort
SELECT DISTINCT - AVG ( ALL + + col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

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

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

query I rowsort
SELECT DISTINCT - col2 - - + col2 AS col2 FROM tab0 GROUP BY col2
----
0

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

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

query I rowsort
SELECT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col1 * - + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6642
0

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

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

query I rowsort
SELECT + col2 * + col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col0 + - + col0 FROM tab0 GROUP BY col0 HAVING AVG ( ALL - - col1 ) IS NULL
----

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

query II rowsort
SELECT ALL + col0 * + + col2 AS col0, col0 AS col1 FROM tab0 GROUP BY col2, col0 HAVING ( NULL IS NULL )
----
1032
43
2054
26
3154
83

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) <= col2
----

query II rowsort
SELECT + col0, col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

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

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

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

query I rowsort
SELECT col1 FROM tab2 GROUP BY col2, col1, col1 HAVING ( NULL ) IS NULL
----
41
59
61

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

query I rowsort
SELECT - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab1 GROUP BY col2
----
45
71
8

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

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

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

query I rowsort
SELECT DISTINCT + AVG ( ALL + col2 ) AS col1 FROM tab0 WHERE NOT - + col0 <= NULL GROUP BY col2
----

query II rowsort
SELECT DISTINCT col2, col2 + + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
116
79
158
87
174

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

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

query I rowsort
SELECT col2 FROM tab1 WHERE NULL <> NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - + col0 + - col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( NOT NULL IS NULL )
----
-133
-150
-76

query I rowsort
SELECT - col1 + - col1 FROM tab0 GROUP BY col1, col1
----
-162
0

query I rowsort
SELECT ALL + - col2 * - col2 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL IS NOT NULL )
----
-26
-43
-83

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

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

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

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

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

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

query I rowsort
SELECT col0 + + col0 AS col0 FROM tab0 GROUP BY col0, col0
----
166
52
86

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

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + + AVG ( ALL + col1 ) <= ( col2 )
----
58
79
87

query I rowsort
SELECT ALL col2 + + + col2 FROM tab1 GROUP BY col1, col2
----
142
16
90

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab1 GROUP BY col2, col0, col1
----
45
71
8

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

query I rowsort
SELECT DISTINCT col0 - + col0 FROM tab1 GROUP BY col0
----
0

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

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

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2 HAVING NULL IS NULL
----
44
57
6

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

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

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

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

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

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query II rowsort
SELECT col0, - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - - col2 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
138
148
99

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 ( NULL ) BETWEEN NULL AND ( col1 )
----

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

query I rowsort
SELECT ALL + col0 * - + col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query II rowsort
SELECT DISTINCT - + col1 + - + col0 AS col0, + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-133
41
-150
59
-76
61

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

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

query I rowsort
SELECT ALL - col2 * + col2 FROM tab0 GROUP BY col2 HAVING NULL < NULL
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col0 col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

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

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

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

query I rowsort
SELECT ALL - col0 - + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-166
-52
-86

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

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 WHERE - col2 > NULL GROUP BY col2, col0 HAVING ( + col0 ) > ( NULL )
----

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab2 GROUP BY col0 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
58
79
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING + col0 >= NULL
----

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

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

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

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

query II rowsort
SELECT col0 AS col0, col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + col1 * - + col0 + - col1 IS NULL
----
22
6
28
57
82
44

query II rowsort
SELECT - col1 * - col1, col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
41
3481
59
3721
61

query III rowsort
SELECT + col1 AS col2, col1 * col1 - - + col1, - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
9 values hashing to 701222dcab36e57ecd3c39eb7ce67804

query I rowsort
SELECT - col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
6561

query I rowsort
SELECT - - col0 FROM tab0 cor0 GROUP BY col0, col0, col1 HAVING - col1 IS NOT NULL
----
26
43
83

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

query I rowsort
SELECT + col0 + col0 + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
273
276
45

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

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

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

query I rowsort
SELECT ALL - col2 FROM tab0 cor0 GROUP BY col2, col2, col2
----
-24
-38
-79

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

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

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-653
SELECT + col0 DIV + col0 + - col0 FROM tab1 GROUP BY col0
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-653
SELECT + col0 / + col0 + - col0 FROM tab1 GROUP BY col0
----
-21
-27
-81

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

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

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING - col1 <= col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query II rowsort label-657
SELECT - col2 AS col1, col1 DIV col1 + + col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-58
59
-79
80
-87
88

skipif mysql # not compatible
query II rowsort label-657
SELECT - col2 AS col1, col1 / col1 + + col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-58
59
-79
80
-87
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + col2 AS col2 FROM tab0 WHERE col0 <= col0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

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

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

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

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

query I rowsort
SELECT ALL + col0 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
153
30
73

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

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NOT NULL = NULL
----

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2, col0, col1 HAVING ( NULL ) IS NULL
----
-58
-79
-87

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

query I rowsort
SELECT ALL col2 - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
0
0
0

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 AS col0, col1 col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
41
-59
59
-61
61

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( col0 + + col0 ) <= NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab2 GROUP BY col1, col1, col1
----
118
122
82

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

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

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

query I rowsort
SELECT ALL col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL > NULL
----

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

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - col2 * col0 IS NULL
----
-58
-79
-87

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT col1, col1 AS col0 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

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

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

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
41
59
61

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

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

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

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

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL < NULL
----

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-725
SELECT DISTINCT + col0 DIV + + col0 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-725
SELECT DISTINCT + col0 / + + col0 FROM tab0 GROUP BY col0
----
1

query I rowsort
SELECT ALL col2 + col2 AS col0 FROM tab1 GROUP BY col2
----
142
16
90

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

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

query I rowsort
SELECT col2 + col2 FROM tab1 GROUP BY col2
----
142
16
90

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

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL > NULL
----

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

query I rowsort
SELECT ALL col2 * - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-1944
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NOT ( - col2 ) IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2 HAVING NOT + col1 - col1 IS NULL
----
41
59
61

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) <= NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

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

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

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

query I rowsort
SELECT DISTINCT + col0 * col1 FROM tab2 GROUP BY col0, col1
----
3772
5369
915

query II rowsort
SELECT ALL - col2 AS col2, col2 FROM tab2 GROUP BY col2
----
-58
58
-79
79
-87
87

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

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

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-750
SELECT col1 DIV + col1 FROM tab2 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-750
SELECT col1 / + col1 FROM tab2 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT DISTINCT + col2 + col1 FROM tab1 GROUP BY col2, col1 HAVING NOT - col1 + + AVG ( - - col1 ) IS NULL
----
102
115
14

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

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

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

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

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

query I rowsort
SELECT ALL col0 - - col0 * + col0 FROM tab1 GROUP BY col0
----
506
6806
812

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

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

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

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

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

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

query I rowsort
SELECT DISTINCT col1 + + - col1 AS col0 FROM tab0 GROUP BY col1
----
0

query I rowsort
SELECT ALL col0 * + col0 FROM tab2 GROUP BY col0
----
225
8281
8464

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

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

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

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

query I rowsort
SELECT col0 + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT col0 AS col0 FROM tab2 WHERE - + col0 IS NULL GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-774
SELECT + col1 DIV - col1 col0 FROM tab1 cor0 GROUP BY col2, col1
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-774
SELECT + col1 / - col1 col0 FROM tab1 cor0 GROUP BY col2, col1
----
-1
-1
-1

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT + col2 + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

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

query I rowsort
SELECT col0 + col0 FROM tab2 GROUP BY col0 HAVING NOT + col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 GROUP BY col2, col0
----
45
71
8

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col0 col1 FROM tab1 GROUP BY col0
----
484
6724
784

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

query I rowsort
SELECT DISTINCT col2 + - col2 * - col2 FROM tab2 GROUP BY col1, col2
----
3422
6320
7656

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

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

query I rowsort
SELECT + col1 + + col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT ALL col2 * + col2 FROM tab0 GROUP BY col2 HAVING NULL <> NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

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

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

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

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

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

query I rowsort
SELECT - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT NULL <= - col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL + col1 * + col1 * - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-185193
-216
-85184

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

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

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

query I rowsort
SELECT ALL + col0 * + - col0 FROM tab0 GROUP BY col0, col0 HAVING ( NOT ( NULL ) IS NOT NULL )
----
-1849
-676
-6889

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

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col1 HAVING NULL <= ( NULL )
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL + col1 FROM tab2 WHERE NOT col1 IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col0 AS col2 FROM tab2 WHERE NOT ( NULL ) = NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + col2 * + col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab2 WHERE + col2 <= ( NULL ) GROUP BY col0, col0 HAVING NOT NULL <= NULL
----

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

query I rowsort
SELECT col1 * col2 AS col2 FROM tab2 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT ALL col1 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

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

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

query II rowsort
SELECT DISTINCT + - col0, + col0 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
225
-91
8281
-92
8464

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

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

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

query I rowsort
SELECT - col0 * + + col0 + - - col0 FROM tab2 cor0 GROUP BY col0, col2
----
-210
-8190
-8372

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

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

query I rowsort
SELECT ALL col0 * - col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING AVG ( DISTINCT + col0 ) IS NULL
----

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

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query II rowsort
SELECT DISTINCT col2, col2 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
58
79
79
87
87

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

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

query I rowsort
SELECT ALL AVG ( + col2 ) FROM tab1 GROUP BY col2 HAVING NULL <> NULL
----

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

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

query I rowsort
SELECT DISTINCT + col1 * + col1 + - col0 FROM tab0 GROUP BY col0, col1, col0, col2
----
-26
-83
6518

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

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

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

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

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

query II rowsort
SELECT - col0 + - col0 AS col1, col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
83
-52
26
-86
43

query I rowsort
SELECT ALL + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NOT - col2 >= col1 GROUP BY col2
----
-24
-38
-79

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

query I rowsort
SELECT + col0 * col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

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

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

query I rowsort
SELECT DISTINCT col2 + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
116
158
174

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

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 WHERE + col0 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( col2 )
----

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

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col1, col2, col1
----
41
59
61

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

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

query I rowsort
SELECT DISTINCT col2 * - - col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col2 * col2 * col2 FROM tab2 GROUP BY col2
----
195112
493039
658503

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

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

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING col2 = NULL
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

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

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= + col0
----

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

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

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

query I rowsort
SELECT ALL + col2 + col2 FROM tab1 GROUP BY col2
----
142
16
90

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 * - col2 FROM tab0 GROUP BY col0, col2
----
-1032
-2054
-3154

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

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

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

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

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

query II rowsort
SELECT DISTINCT - + col1 + col0 AS col0, + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-38
81
26
0
83
0

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING + col1 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL >= col1 GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-885
SELECT col2 DIV + col2 AS col1 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-885
SELECT col2 / + col2 AS col1 FROM tab0 GROUP BY col2
----
1
1
1

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + + col0 + - col0 FROM tab0 WHERE NOT - + col1 <= NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col0 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL >= + - col0
----

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

query II rowsort
SELECT ALL + col2, + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
92
79
91
87
15

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

query II rowsort
SELECT + col1, col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

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

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

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

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

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

query I rowsort
SELECT ALL - + col1 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-81
0
0

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

query I rowsort
SELECT ALL col2 * col2 FROM tab2 GROUP BY col1, col2
----
3364
6241
7569

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1 HAVING NOT AVG ( DISTINCT + - col1 ) IS NULL
----
41
59
61

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

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

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

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

query I rowsort
SELECT ALL col1 * col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN col1 AND NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

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

query I rowsort
SELECT col2 - + + col2 AS col0 FROM tab2 GROUP BY col2
----
0
0
0

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

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

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

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

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

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

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1 HAVING NOT - + col1 > NULL
----

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

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

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

query II rowsort
SELECT - col1 AS col2, col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

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

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col2 HAVING - + AVG ( col1 ) IS NULL
----

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

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

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

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

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE NULL = ( NULL ) GROUP BY col2, col0
----

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

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

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 DISTINCT + col0 * + col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
484
6724
784

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

query II rowsort
SELECT DISTINCT col2, col2 FROM tab0 cor0 GROUP BY col2
----
24
24
38
38
79
79

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-944
SELECT - col2 DIV col2 FROM tab2 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-944
SELECT - col2 / col2 FROM tab2 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT NULL < NULL GROUP BY col0
----

query I rowsort
SELECT - - col0 - - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
182
184
30

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * + - col0 col2 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

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

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

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT AVG ( ALL - + col2 ) + + col0 BETWEEN col2 AND - col0 / + col2
----
-26
-43
-83

query I rowsort
SELECT - col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING ( NULL ) IS NULL
----
-45
-71
-8

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

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

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

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

query I rowsort
SELECT col2 + + col2 AS col1 FROM tab1 GROUP BY col2
----
142
16
90

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

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

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

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

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL <= NULL
----

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

query I rowsort
SELECT - col0 + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-11
-14
17

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

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

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

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

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

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

query II rowsort
SELECT col0, - col0 * - col0 AS col2 FROM tab2 GROUP BY col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NULL = - col0
----

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-980
SELECT + col0 DIV col0 * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-980
SELECT + col0 / col0 * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

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

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

query I rowsort
SELECT ALL col2 * + col2 AS col2 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL >= + AVG ( ALL + col0 )
----

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

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

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

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

query I rowsort
SELECT DISTINCT - col1 * + col1 * col1 AS col0 FROM tab1 GROUP BY col1 HAVING ( - col1 ) < NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

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

onlyif mysql # DIV for integer division: 
query I rowsort label-997
SELECT col1 DIV + + col1 FROM tab2 GROUP BY col1, col2 HAVING - - col2 NOT BETWEEN col2 AND col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-997
SELECT col1 / + + col1 FROM tab2 GROUP BY col1, col2 HAVING - - col2 NOT BETWEEN col2 AND col1
----
1
1
1

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

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

query II rowsort
SELECT ALL col1 * - col1 AS col1, - col1 FROM tab2 GROUP BY col1
----
-1681
-41
-3481
-59
-3721
-61

query II rowsort
SELECT DISTINCT - col1 - - col1 * col1, - col1 + col1 * col1 FROM tab0 GROUP BY col1, col1
----
0
0
6480
6480

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

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

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
0
0
0

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

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

query I rowsort
SELECT - col2 * - col1 FROM tab2 cor0 GROUP BY col2, col1
----
2378
4661
5307

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

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

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NOT NULL >= + col0 GROUP BY col1
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT - col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-58
-79
-87

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col1 + + col2 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
138
148
99

query I rowsort
SELECT DISTINCT - - col2 - - col2 AS col0 FROM tab1 cor0 GROUP BY col2, col0
----
142
16
90

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + - col1 > - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
116
158
174

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col0 col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col1 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

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

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

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL < NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, + col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT AVG ( DISTINCT col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

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

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 FROM tab1 WHERE NOT - col0 >= NULL GROUP BY col0
----

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col2 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0, col0 * - col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-915
-91
-5369
-92
-3772

query II rowsort
SELECT ALL - + col2, col2 + + + col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1, col0 HAVING ( NULL ) NOT IN ( + col0 + col2 )
----

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

query I rowsort
SELECT DISTINCT + col0 + col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
133
150
76

query I rowsort
SELECT DISTINCT + col1 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1, col2
----
44
57
6

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

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

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

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

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

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT col0 FROM tab1 GROUP BY col2, col0 HAVING NULL <= + - col0
----

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

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

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 WHERE NOT + col0 <> NULL GROUP BY col2
----

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

query I rowsort
SELECT + + col0 + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col0, col2, col1
----
0
0
81

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 * - AVG ( ALL + col2 ) AS col0 FROM tab2 WHERE - + col2 IS NULL GROUP BY col2
----

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

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

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

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

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

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

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

query I rowsort
SELECT - col0 + col0 AS col2 FROM tab0 GROUP BY col0, col0, col2
----
0
0
0

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

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

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

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

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

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

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

query II rowsort
SELECT - col2, col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
43
-38
83
-79
26

query II rowsort
SELECT col1, + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING col1 = NULL
----

query II rowsort
SELECT DISTINCT col1, col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 WHERE NOT + col2 * col2 IS NULL GROUP BY col1
----
-41
-59
-61

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

query I rowsort
SELECT col0 / col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING AVG ( - col2 ) - - col0 IS NULL
----

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

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

query II rowsort
SELECT ALL + col2, col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
58
58
79
79
87
87

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

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

query II rowsort
SELECT ALL col2, col2 - - col2 FROM tab0 GROUP BY col2
----
24
48
38
76
79
158

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

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

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

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

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

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

query I rowsort
SELECT AVG ( DISTINCT - col2 ) AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

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

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

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

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 col2, + col2 FROM tab1 GROUP BY col2, col0
----
45
45
71
71
8
8

query I rowsort
SELECT + col0 * - col0 * + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-35280
-3872
-477404

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

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab2 GROUP BY col0
----
225
8281
8464

onlyif mysql # DIV for integer division: 
query I rowsort label-1116
SELECT ALL col1 DIV - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

skipif mysql # not compatible
query I rowsort label-1116
SELECT ALL col1 / - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

query I rowsort
SELECT col1 + + col1 - + - col1 FROM tab2 cor0 GROUP BY col0, col1, col1
----
123
177
183

query I rowsort
SELECT col2 + - col2 AS col0 FROM tab0 GROUP BY col0, col2
----
0
0
0

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

query II rowsort
SELECT + + col2, + col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - col0 IS NULL
----
164
44
56

query I rowsort
SELECT - col0 + + col0 * + - col0 AS col1 FROM tab0 GROUP BY col0
----
-1892
-6972
-702

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

query II rowsort
SELECT - col0, col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-22
22
-28
28
-82
82

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

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

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

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

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col1, col0 HAVING col0 < NULL
----

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

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

query I rowsort
SELECT DISTINCT AVG ( col2 ) FROM tab1 GROUP BY col2, col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col1 - + + col1 AS col2 FROM tab0 GROUP BY col1
----
0
0

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

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

query II rowsort
SELECT ALL + col2 * col2, col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
45
5041
71
64
8

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

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

query I rowsort
SELECT DISTINCT col2 * + col2 FROM tab1 GROUP BY col2
----
2025
5041
64

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

query II rowsort
SELECT DISTINCT + + col1 AS col2, col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

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

query I rowsort
SELECT col1 AS col2 FROM tab1 WHERE NOT NULL NOT BETWEEN ( NULL ) AND NULL AND col2 <> NULL GROUP BY col1
----

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL OR ( - col2 >= col2 )
----
45
71
8

query I rowsort
SELECT ALL + col1 + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
138
148
99

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

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

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

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

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

query II rowsort
SELECT ALL - + col0, col0 AS col1 FROM tab0 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
-41
-59
-61

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

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

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND col2
----

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

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

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

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-41
-59
-61

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

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

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

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

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL IS NULL )
----
22
28
82

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

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

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

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

query I rowsort
SELECT col0 * + + col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

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

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col0 HAVING + AVG ( ALL - col0 ) IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

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

query I rowsort
SELECT DISTINCT - + col2 - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-138
-148
-99

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

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

query I rowsort
SELECT ALL + AVG ( - col1 ) FROM tab1 WHERE NOT NULL IS NOT NULL AND NULL NOT BETWEEN NULL AND NULL GROUP BY col1
----

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

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

query I rowsort
SELECT + col2 + + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
142
16
90

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

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

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

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

query I rowsort
SELECT ALL col2 - + + col2 FROM tab1 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

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

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

query I rowsort
SELECT col1 FROM tab1 WHERE NULL >= NULL GROUP BY col1, col1
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT - col2 = NULL
----

query I rowsort
SELECT DISTINCT col1 * + col1 + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

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

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

query I rowsort
SELECT DISTINCT col0 + col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col2 - col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING ( ( NULL IS NULL ) )
----
58
79
87

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

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - + col1 * + col1 FROM tab1 cor0 GROUP BY col1, col1, col0
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col1 * - + col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1936
-3249
-36

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

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 WHERE ( col2 ) IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

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

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

query I rowsort
SELECT ALL col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

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

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

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

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

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

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col1, col0
----
58
79
87

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - - col1 >= NULL
----

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-1216
SELECT - col1 DIV - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1216
SELECT - col1 / - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
1
1
1

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

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

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

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

query II rowsort
SELECT DISTINCT - col0 * + + col0, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL > ( NULL )
----

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT ( NULL ) IS NOT NULL )
----
24
38
79

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-1230
SELECT ALL + col2 DIV col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT ( + col2 ) IS NULL )
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1230
SELECT ALL + col2 / col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT ( + col2 ) IS NULL )
----
1
1
1

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 WHERE NOT col0 IS NULL GROUP BY col0
----
15
91
92

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

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

query I rowsort
SELECT col0 + + col0 AS col1 FROM tab2 GROUP BY col0
----
182
184
30

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

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

query I rowsort
SELECT + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 + + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
142
16
90

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

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

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

query I rowsort
SELECT + col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 col0, col1 + + + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

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

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
-81
0

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

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

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

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

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

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

query I rowsort
SELECT col2 * + - col0 * + col0 AS col2 FROM tab1 GROUP BY col0, col2, col2
----
-35280
-3872
-477404

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

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

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL - AVG ( DISTINCT col0 ) FROM tab0 GROUP BY col2, col2, col0 HAVING NOT NULL <= NULL
----

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

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

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

query I rowsort
SELECT - col2 - col1 AS col0 FROM tab1 GROUP BY col1, col2
----
-102
-115
-14

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

query I rowsort
SELECT col0 / + col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL + + AVG ( col0 ) / + + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

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

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

query I rowsort
SELECT col2 + + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-19
-45
53

query I rowsort
SELECT ALL - col0 * - col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

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

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE + col2 >= NULL GROUP BY col0
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query II rowsort
SELECT ALL + + col1 * + col1, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
1681
41
3481
59
3721
61

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

query I rowsort
SELECT DISTINCT col0 * col2 FROM tab0 GROUP BY col0, col2, col0
----
1032
2054
3154

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT col0 - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab1 GROUP BY col1 HAVING NOT ( col1 ) IS NULL
----
-1936
-3249
-36

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

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

query I rowsort
SELECT ALL col0 - - col0 AS col0 FROM tab0 GROUP BY col0, col0
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT + col1 FROM tab0 WHERE NOT NULL = ( NULL ) GROUP BY col1
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query II rowsort
SELECT ALL col2 AS col2, + col2 * - + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT - col1 <> + - col1
----
44
57
6

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT NULL <> NULL
----

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

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

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

query I rowsort
SELECT - + col0 - + col0 + - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-273
-276
-45

query I rowsort
SELECT + col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2
----
41
59
61

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

query I rowsort
SELECT DISTINCT + col2 * col2 AS col2 FROM tab2 AS cor0 WHERE col2 IS NOT NULL GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1, col1 HAVING NULL <= ( + col1 - col1 )
----

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

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

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab1 GROUP BY col2, col2, col2
----
142
16
90

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

query II rowsort
SELECT DISTINCT + - col0, col0 AS col0 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 + col0 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab2 GROUP BY col1, col2
----
58
79
87

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * - col1 col2 FROM tab1 GROUP BY col1 HAVING NULL > NULL
----

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

query I rowsort
SELECT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
0
0
81

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= + - AVG ( DISTINCT col1 )
----

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

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col2, col0 HAVING NULL <= NULL
----

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

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

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( ( NOT NULL IS NOT NULL ) )
----
58
79
87

query I rowsort
SELECT col0 / col0 FROM tab2 WHERE ( + col2 ) > NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1333
SELECT col1 DIV + col1 + + + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING col1 IS NOT NULL
----
46
72
9

skipif mysql # not compatible
query I rowsort label-1333
SELECT col1 / + col1 + + + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING col1 IS NOT NULL
----
46
72
9

query I rowsort
SELECT ALL + - col1 * + AVG ( ALL - - col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 * + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-484
-6724
-784

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1, + col1 col2 FROM tab1 GROUP BY col1, col1 HAVING col1 <> ( - + col1 )
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + + col0 * + + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

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

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

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

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

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING ( ( NULL ) NOT BETWEEN NULL AND + + AVG ( + col0 ) )
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT ( NOT NULL NOT BETWEEN ( NULL ) AND NULL )
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-1346
SELECT + col0 DIV + col0 + col0 AS col1 FROM tab1 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-1346
SELECT + col0 / + col0 + col0 AS col1 FROM tab1 GROUP BY col0
----
23
29
83

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

query I rowsort
SELECT - + col2 + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-116
-158
-174

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

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

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

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
26
43
83

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

query I rowsort
SELECT DISTINCT - - col0 * + col0 + - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
164
8222
8423

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

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

query I rowsort
SELECT + + col0 + col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 GROUP BY col0 HAVING col0 * col0 IS NULL
----

query I rowsort
SELECT col1 - - col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88

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

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

query I rowsort
SELECT ALL col1 + - col1 FROM tab0 WHERE NOT NULL > - col1 AND NULL IS NULL GROUP BY col1
----

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

query II rowsort
SELECT - col0 + - col0, col0 FROM tab2 GROUP BY col0
----
-182
91
-184
92
-30
15

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

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

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

query I rowsort
SELECT - col2 + - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NOT NULL <= NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 GROUP BY col1, col0, col2 HAVING NULL IS NULL
----
-81
0
0

query II rowsort
SELECT DISTINCT + - col1, col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col1, col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 + - + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-46
32
51

onlyif mysql # DIV for integer division: 
query I rowsort label-1379
SELECT ALL col1 DIV + - col1 col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1379
SELECT ALL col1 / + - col1 col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

query II rowsort
SELECT - col1, col2 * col2 * col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col2 HAVING - + col0 IS NOT NULL
----
26
43
83

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NULL <= col0 GROUP BY col1, col2
----

query I rowsort
SELECT + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT + col0 + + col0 * - col0 FROM tab0 GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + col2 - + col2 AS col0 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - + AVG ( col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 * - col2 + - col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - AVG ( - col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1391
SELECT col1 DIV + col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1391
SELECT col1 / + col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL = col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1393
SELECT ALL + col1 DIV + col1 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1393
SELECT ALL + col1 / + col1 FROM tab2 GROUP BY col1
----
1
1
1

query II rowsort
SELECT DISTINCT - col2 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT ALL + col1 * col1 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - - col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 * col1 col1 FROM tab0 GROUP BY col2, col1
----
0
0
6561

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + + + col0 col2 FROM tab0 GROUP BY col0
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col0 col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL < NULL )
----

query I rowsort
SELECT AVG ( col0 ) + + AVG ( col0 ) FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col0, col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col0 + - - col0 AS col1 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - col2 + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NOT col0 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1415
SELECT + col0 DIV - col0 + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
25
42
82

skipif mysql # not compatible
query I rowsort label-1415
SELECT + col0 / - col0 + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
25
42
82

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col2, col0 HAVING NOT + + AVG ( + col2 ) >= NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 WHERE NOT col1 <> NULL GROUP BY col2
----

query II rowsort
SELECT ALL + col2 AS col1, col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
10648
21952
551368

query II rowsort
SELECT + - col2 + col2, + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - - col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT AVG ( ALL + col0 ) + AVG ( ALL col2 ) IS NOT NULL
----

query I rowsort
SELECT + - col0 * - - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT + col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN - col0 AND NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 WHERE ( col0 IS NULL ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab1 GROUP BY col2, col0 HAVING NOT ( + col0 ) IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2, col0 HAVING - col0 < NULL
----

query I rowsort
SELECT + + col0 + - - col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT DISTINCT - col2 + + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-53
19
45

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col0, col2, col1
----
-26
-43
-83

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2, col2, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 / - + col0 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL <> ( NULL ) )
----

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + - - col2 * col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2070
5112
72

query I rowsort
SELECT DISTINCT + col1 + - - col1 FROM tab1 AS cor0 WHERE + col1 IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col0 + - col2 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NULL >= + + col2
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IN ( + + col2 )
----

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL <> - col0
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col0, col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * + col0 col0 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT + AVG ( - col0 ) <= NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col2, col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col0 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT AVG ( DISTINCT - - col1 ) FROM tab0 WHERE NULL BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col0 + - - col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col1 * col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 WHERE NOT NULL <= NULL GROUP BY col0 HAVING NOT - col0 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1464
SELECT DISTINCT - col1 DIV col1 FROM tab2 WHERE NOT ( + col1 ) IS NULL GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-1464
SELECT DISTINCT - col1 / col1 FROM tab2 WHERE NOT ( + col1 ) IS NULL GROUP BY col1
----
-1

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col1, col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 + - - col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col1, col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 * - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

onlyif mysql # DIV for integer division: 
query I rowsort label-1470
SELECT + + col2 DIV col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1470
SELECT + + col2 / col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL col2 - + + col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3306
-6162
-7482

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab0 WHERE NOT NULL > NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT - col0 * + col0 - - col0 * + + col0 * col0 AS col2 FROM tab0 GROUP BY col0
----
16900
564898
77658

query I rowsort
SELECT DISTINCT - col0 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
58
79
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NULL = - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - + col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + col2 AS col1 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab2 GROUP BY col1, col0, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT + col1 + + col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL col2 * + col2 + col1 AS col0 FROM tab1 GROUP BY col1, col2, col2
----
2082
5085
70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2, col2 col2 FROM tab2 GROUP BY col0, col2
----
58
58
79
79
87
87

query I rowsort
SELECT - col1 * + - col0 FROM tab2 GROUP BY col0, col1
----
3772
5369
915

query I rowsort
SELECT - col2 * + col1 * + - col1 AS col1 FROM tab2 GROUP BY col1, col2
----
274999
323727
97498

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 AS col0, + col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - + col0 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NULL
----
-41
-59
-61

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) <= NULL
----

query I rowsort
SELECT DISTINCT col2 + + col0 FROM tab2 GROUP BY col2, col0
----
102
150
170

query I rowsort
SELECT col0 + + - col0 FROM tab2 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1 HAVING col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL >= ( + col2 )
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 + + - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-1510
SELECT - + col2 DIV col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1510
SELECT - + col2 / col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1, col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( - col1 ) < ( NULL )
----

query I rowsort
SELECT col1 * - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0, col1 HAVING + + AVG ( DISTINCT + col0 ) BETWEEN NULL AND + col1
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * col0 FROM tab0 cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT col0 AS col1 FROM tab1 WHERE NULL <> NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col2, col1, col0
----
41
59
61

query I rowsort
SELECT ALL col2 - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT - col0 * - - AVG ( ALL + col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT ( ( NULL ) IS NULL )
----

query I rowsort
SELECT AVG ( ALL + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2, AVG ( ALL - col2 ) * - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= col1
----

query I rowsort
SELECT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query II rowsort
SELECT DISTINCT - + col1 AS col1, + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT ALL + + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 * - + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT + col1 * - col1 AS col1 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT - + col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-1533
SELECT ALL - col0 DIV + col1 + + - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-92
-94

skipif mysql # not compatible
query I rowsort label-1533
SELECT ALL - col0 / + col1 + + - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-92
-94

query II rowsort
SELECT ALL col1 - + - col1 AS col0, col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 + col1 FROM tab0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT ALL col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col2, col0, col1
----
0
0
81

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT ( ( NULL ) <> NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + - - col1 * + col1 col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 FROM tab2 cor0 WHERE NOT NULL NOT IN ( col2 * + col0 ) GROUP BY col2
----

query I rowsort
SELECT col0 - - col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL col2 - - col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT col0 + + - col0 FROM tab1 GROUP BY col0, col0
----
0

query I rowsort
SELECT DISTINCT + - col0 + - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE ( NULL > NULL ) GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col2 HAVING + col1 <= NULL
----

query II rowsort
SELECT ALL col2 AS col2, + col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * - - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - + col2 * - col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col2 FROM tab0 WHERE ( NULL ) = - col1 GROUP BY col2
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
22
28
82

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + + + col1 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col0 + - col0 + col0 * - col0 AS col2 FROM tab2 GROUP BY col0
----
-255
-8463
-8648

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1, col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab2 cor0 GROUP BY col1, col0, col1
----
41
59
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 + col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN col2 AND NULL
----

query I rowsort
SELECT ALL col1 * - + col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col1
----

query I rowsort
SELECT col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT ( NOT NULL IS NULL )
----
41
59
61

query I rowsort
SELECT + col2 FROM tab2 WHERE NULL <> - - col0 GROUP BY col1, col2
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING + + AVG ( ALL - col1 ) IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT col0 + - col0 - - col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col2, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col0 * + - col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NOT col1 >= + col1 GROUP BY col0, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT + - col0 FROM tab2 cor0 GROUP BY col1, col0, col1 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING ( NULL IS NULL )
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col2 + col1 FROM tab1 GROUP BY col1, col2
----
102
115
14

query II rowsort
SELECT ALL + col2 AS col1, - col2 AS col1 FROM tab2 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query II rowsort
SELECT - col2 AS col2, col2 FROM tab1 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
24
38
38
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - + col2 / col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT NULL >= ( - col1 ) GROUP BY col1, col1
----

query II rowsort
SELECT DISTINCT + col1, col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING NOT ( AVG ( col1 ) IS NOT NULL )
----

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL col1 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT + col0 + + col0 + - col0 FROM tab0 GROUP BY col0
----
26
43
83

query II rowsort
SELECT col0, col0 + - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
26
43
-38
83
83

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col0, col1, col1
----
0
81

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL > ( NULL ) )
----

query II rowsort
SELECT ALL col1 AS col2, col1 + - + col1 AS col2 FROM tab0 GROUP BY col1
----
0
0
81
0

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL - col1 + + col1 AS col2 FROM tab2 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT - col2 * col2 + - + col2 * + + col2 FROM tab0 AS cor0 WHERE NOT - col2 IS NULL OR ( + col0 ) IS NULL GROUP BY col2
----
-1152
-12482
-2888

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL BETWEEN NULL AND col0
----

query I rowsort
SELECT DISTINCT col0 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT + col1 * + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query II rowsort
SELECT DISTINCT col1, col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
44
57
57
6
6

query I rowsort
SELECT + col1 - - - col1 FROM tab2 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL <> + col1
----

query I rowsort
SELECT - - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT - col2 * - col2 * + + col2 FROM tab2 AS cor0 WHERE ( NULL ) BETWEEN ( NULL ) AND - col0 GROUP BY col2, col2
----

query I rowsort
SELECT ALL + col0 * + - col2 AS col2 FROM tab1 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - + col1 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col0 - + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col0 FROM tab1 WHERE NOT NULL <> NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - col0 + - col0 FROM tab0 cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-166
-52
-86

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col2, col0
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + col1 col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col0, col2, col2 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col0, - col0 AS col0 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( col1 ) IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 - col1 col2 FROM tab1 cor0 WHERE NULL <= ( NULL ) GROUP BY col1, col1 HAVING NOT + col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1, col1 * + col1 + - col1 col2 FROM tab0 GROUP BY col1
----
0
0
81
6480

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 * - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL - + col1 + + + col1 * - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT ( NULL IS NOT NULL )
----
22
28
82

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
-81
0
0

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col0, col1
----
41
59
61

query I rowsort
SELECT col0 FROM tab1 WHERE + col0 * + col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 + - col2 AS col1 FROM tab2 GROUP BY col2, col1, col2 HAVING NULL IS NULL
----
-17
-20
-26

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 WHERE NOT col0 + + col1 < NULL GROUP BY col2
----

query I rowsort
SELECT col0 + - col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT - + AVG ( ALL + col1 ) IS NOT NULL
----

query I rowsort
SELECT col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + col0 - - + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
182
184
30

query II rowsort
SELECT + col1 AS col1, + col1 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
0
0
81
81

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + - col0 FROM tab0 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col2 + + + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT col1 * col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 WHERE NOT NULL <= + col2 GROUP BY col2
----

query I rowsort
SELECT + col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col2 AS col0, col2 FROM tab0 GROUP BY col1, col2
----
24
24
38
38
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col0 + - + col1 FROM tab0 cor0 GROUP BY col1, col2, col0
----
-38
26
83

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col1 * - - col1 FROM tab1 GROUP BY col1 HAVING - col1 IN ( - col1 )
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT col1 * + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col2, col2, col0
----
-26
-43
-83

query I rowsort
SELECT - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 WHERE NOT NULL <> NULL GROUP BY col1
----

query I rowsort
SELECT - col1 + + + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( col0 IS NULL )
----
15
91
92

query I rowsort
SELECT ALL col0 * col0 AS col2 FROM tab2 GROUP BY col1, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

onlyif mysql # DIV for integer division: 
query II rowsort label-1712
SELECT - col2 DIV + + col2, col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-1
24
-1
38
-1
79

skipif mysql # not compatible
query II rowsort label-1712
SELECT - col2 / + + col2, col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-1
24
-1
38
-1
79

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col2, col1
----
58
79
87

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col0 - - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
-118
-122
-82

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 GROUP BY col1 HAVING ( NULL ) IS NULL OR NOT ( - AVG ( - col2 ) ) NOT BETWEEN NULL AND col1 * - AVG ( col1 )
----
44
57
6

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT + col1 - - + col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
0
0
81

query I rowsort
SELECT - col0 + - - col1 + + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
-10
107
27

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - + col2 IS NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( - - col0 ) > NULL
----

query I rowsort
SELECT DISTINCT col0 + - + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT + - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT + col2 * - col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) >= ( NULL )
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT + - col0 - - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-153
-30
-73

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT ( NOT NULL < col1 )
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query II rowsort
SELECT + col0 AS col0, + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col1 * + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 AS cor0 WHERE NULL IS NULL OR NOT NULL IS NULL GROUP BY col2
----
58
79
87

query II rowsort
SELECT - col2, col2 FROM tab1 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - col0 + - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT col2, - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
-58
79
-79
87
-87

query II rowsort
SELECT col0, + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-24
-38
-79

query II rowsort
SELECT DISTINCT + col1, col2 FROM tab1 GROUP BY col1, col2, col0
----
44
71
57
45
6
8

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - + col0 + - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT DISTINCT + col2, - col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT + AVG ( - col2 ) IN ( + col2 * col2 )
----
24
-24
38
-38
79
-79

query I rowsort
SELECT DISTINCT - col0 + + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
0

query I rowsort
SELECT col1 + + col0 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
126
28
85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 WHERE NOT + col2 + col0 IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query II rowsort
SELECT - col1, + col1 FROM tab0 GROUP BY col2, col1
----
-81
81
0
0
0
0

query I rowsort
SELECT col2 * col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query II rowsort
SELECT ALL - col2 AS col1, col2 AS col1 FROM tab0 GROUP BY col2, col1
----
-24
24
-38
38
-79
79

query I rowsort
SELECT ALL col0 - + col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-46
32
51

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - col0 * - + col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col0, col2, col1
----
-45
-71
-8

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1, col0, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT - - col0 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col2 - col1 FROM tab2 GROUP BY col2, col0, col1
----
17
20
26

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col1 * - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col0 * + AVG ( DISTINCT - - col2 ) FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col0
----

query I rowsort
SELECT + - col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-81
0
0

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 WHERE NULL >= col1 GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1792
SELECT DISTINCT + col2 DIV + + col2 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-1792
SELECT DISTINCT + col2 / + + col2 FROM tab2 GROUP BY col2
----
1

query I rowsort
SELECT DISTINCT col1 / - col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col0 col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col1 * - col1 FROM tab2 GROUP BY col1, col1 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT ALL col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT col0 FROM tab0 WHERE NOT ( NULL ) > NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col0 - col1 FROM tab0 WHERE - col2 >= ( col1 * col0 ) GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT - col1, + col1 FROM tab2 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT + + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query II rowsort
SELECT col1 AS col1, - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
81
-81

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0, col2, col1
----
22
28
82

query II rowsort
SELECT col0 AS col1, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL col0 AS col1 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 col0 AS col1 FROM tab1 GROUP BY col1, col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 - + col0 FROM tab0 GROUP BY col0, col1
----
-166
-52
-86

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + + col0 >= NULL
----

query I rowsort
SELECT ALL + col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 AS cor0 WHERE ( NULL ) <= - col0 GROUP BY col0 HAVING NOT NULL <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1823
SELECT ALL col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1823
SELECT ALL col1 / + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
1
1
1

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NOT ( NULL IS NOT NULL ) GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL + - col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + - col0 col0 FROM tab2 GROUP BY col0, col1
----
-225
-8281
-8464

query I rowsort
SELECT + col0 + - col0 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + + col1 * col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT + col0 + - col2 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT AVG ( + col1 ) AS col0 FROM tab0 WHERE ( NULL ) > ( - col1 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL - + col0 * col0 * - - col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-17602
-571870
-79550

query I rowsort
SELECT DISTINCT - col0 FROM tab1 WHERE NOT + col2 <> NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT col0 AS col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT AVG ( ALL col2 ) <> + + col0
----

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT col2 + + AVG ( - - col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT - + col0 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-126
-28
-85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 + + + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + col0 + - col0 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT col1 + col1 * - col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-1640
-3422
-3660

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) <= - col0 - - col0
----

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query II rowsort
SELECT + col0, col1 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
61
91
59
92
41

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query II rowsort
SELECT DISTINCT col2, col2 + + col2 AS col2 FROM tab1 GROUP BY col2
----
45
90
71
142
8
16

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-1854
SELECT DISTINCT col1 DIV - col1 + + col1 FROM tab2 GROUP BY col1
----
40
58
60

skipif mysql # not compatible
query I rowsort label-1854
SELECT DISTINCT col1 / - col1 + + col1 FROM tab2 GROUP BY col1
----
40
58
60

query I rowsort
SELECT DISTINCT col0 * - - col0 AS col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1 HAVING - col1 IS NOT NULL
----
0
81

query I rowsort
SELECT - col0 + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE + col0 * + - col1 IN ( - - col0 ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NOT col0 < NULL GROUP BY col0
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT ALL - col1 + - + col1 FROM tab0 GROUP BY col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-225
-8281
-8464

query I rowsort
SELECT + col0 * col0 FROM tab0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT - col2 * - col2 - col2 AS col0 FROM tab0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col1 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT DISTINCT col0 * - col1 FROM tab0 GROUP BY col1, col0, col1
----
-3483
0

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 WHERE - col1 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + + col2 + col0 AS col0 FROM tab2 cor0 GROUP BY col2, col0
----
102
150
170

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND + col1
----

query I rowsort
SELECT ALL - col0 FROM tab0 WHERE NOT ( NULL ) < ( NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING ( AVG ( DISTINCT col0 ) * col0 ) NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT DISTINCT - col2 - - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT - + col2 IS NULL
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 * - col1 AS col0 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NOT ( NOT NULL NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 + + col2 * - + col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT + + col2 - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 - + col0 FROM tab2 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT - AVG ( - col0 ) FROM tab2 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND - col0
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col1, col1, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT - col0 AS col0, - col0 FROM tab1 GROUP BY col0
----
-22
-22
-28
-28
-82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab0 cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT ( NULL = NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 GROUP BY col2, col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 AS col0, col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT - + col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + - col2 * - col2 FROM tab2 cor0 GROUP BY col0, col2
----
3364
6241
7569

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING ( NOT ( NULL ) NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT - col2 + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col1 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT ( + - col2 ) IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <> ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab2 GROUP BY col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query II rowsort
SELECT DISTINCT col2, + col2 FROM tab1 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT col1 + col2 AS col1 FROM tab1 GROUP BY col1, col2
----
102
115
14

query I rowsort
SELECT ALL + col0 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
1849
676
6889

query I rowsort
SELECT col1 + - + col1 FROM tab2 GROUP BY col1, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + col0 + - + col0 AS col1 FROM tab1 GROUP BY col0 HAVING - + col0 IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col2, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + AVG ( ALL - col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col1, col1 FROM tab0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col1, col2, col0
----
-26
-43
-83

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <= ( NULL )
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT + col0 IS NULL
----
-22
-28
-82

query II rowsort
SELECT - col0 AS col0, col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col2, col2, col0
----
24
38
79

query I rowsort
SELECT ALL - col2 + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-17
11
14

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 / col1 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col2 / + col2 FROM tab1 cor0 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query II rowsort
SELECT col2, col0 AS col1 FROM tab2 GROUP BY col2, col0
----
58
92
79
91
87
15

query I rowsort
SELECT ALL - + col0 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col1 / - + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1806
-650
-6806

query II rowsort
SELECT ALL + - col0 AS col2, col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + col1 * + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT + col1 - - col1 FROM tab2 GROUP BY col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 - col1 col0 FROM tab2 GROUP BY col2, col1
----
0
0
0

query I rowsort
SELECT ALL - col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query II rowsort
SELECT DISTINCT - col2, col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT col0 - + + col1 * col1 FROM tab2 GROUP BY col1, col0
----
-1589
-3390
-3706

query I rowsort
SELECT DISTINCT + col0 * + AVG ( - + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 / - col0 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
0
0
0

query II rowsort
SELECT col1, col1 * - - col1 AS col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col0 AS col2, + col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

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 col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL = - AVG ( - - col1 )
----

query I rowsort
SELECT ALL - col0 + - col1 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
-124
-26
-83

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) < ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING AVG ( - col1 ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 WHERE + - col0 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab2 GROUP BY col1, col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 * + - col0 - col0 AS col2 FROM tab1 GROUP BY col0
----
-506
-6806
-812

query I rowsort
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT - col0 * col0 FROM tab2 cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL + col1 + - + col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - col0 - + col0 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - AVG ( ALL + col0 ) * + col0 AS col2 FROM tab0 GROUP BY col0 HAVING AVG ( col1 ) IS NULL
----

query II rowsort
SELECT col2 AS col1, col2 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab2 GROUP BY col1, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT NULL >= NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query II rowsort
SELECT - col2, col2 FROM tab2 GROUP BY col2
----
-58
58
-79
79
-87
87

onlyif mysql # DIV for integer division: 
query I rowsort label-1992
SELECT - - col0 DIV + col1 FROM tab2 cor0 GROUP BY col1, col1, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-1992
SELECT - - col0 / + col1 FROM tab2 cor0 GROUP BY col1, col1, col0
----
0
1
2

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0, col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - AVG ( col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 - col1 FROM tab0 GROUP BY col1
----
-162
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2001
SELECT col0 DIV + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
0
1
3

skipif mysql # not compatible
query I rowsort label-2001
SELECT col0 / + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
0
1
3

query I rowsort
SELECT col0 * - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * + col1 col0 FROM tab2 GROUP BY col1
----
1681
3481
3721

query II rowsort
SELECT ALL + col1, col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2 HAVING col2 IS NOT NULL
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - col1 IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT AVG ( + col1 ) IS NULL
----
-26
-43
-83

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 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col2, + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
44
57
57
6
6

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2, col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col1 * - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
1681
3481
3721

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col1 col2 FROM tab2 GROUP BY col1, col2
----
17
20
26

onlyif mysql # DIV for integer division: 
query I rowsort label-2017
SELECT - col0 DIV col0 FROM tab1 cor0 GROUP BY col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2017
SELECT - col0 / col0 FROM tab1 cor0 GROUP BY col2, col0
----
-1
-1
-1

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col0 + - col0 * - col0 FROM tab0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 WHERE + + col1 NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT col0 - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT + + col1 + + + col1 * + - col1 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT - col1 > ( NULL )
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col2 * + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT - col1 + - + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
-118
-122
-82

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL >= AVG ( + col1 )
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2 HAVING ( - AVG ( + - col1 ) ) IS NULL
----

query II rowsort
SELECT + col0, + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NOT col0 NOT BETWEEN NULL AND - col0 + - col2 GROUP BY col0
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL col0 * - - col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NULL = NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING + - col2 > NULL
----

query I rowsort
SELECT ALL - + col2 + - + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
-105
-121
-67

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 WHERE NOT NULL = NULL GROUP BY col1, col0, col0 HAVING + AVG ( - col2 ) IS NOT NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT - - col1 AS col2 FROM tab2 WHERE col1 IS NOT NULL GROUP BY col1, col0, col0 HAVING NULL < + - col0
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT NULL <= + col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT - col1 * - AVG ( DISTINCT - + col1 ) FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col2, col2 HAVING NOT NULL <> - - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1
----
-81
0

query II rowsort
SELECT ALL col2, + col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL + col1 - + col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT AVG ( DISTINCT - col2 ) <= ( + col1 )
----

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-2054
SELECT + + col2 DIV + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2054
SELECT + + col2 / + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL col0 - + col0 FROM tab1 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

query II rowsort
SELECT AVG ( - col1 ), col1 - + col1 * col1 - + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= + - col1
----

query I rowsort
SELECT - - col0 * + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
225
8281
8464

query II rowsort
SELECT ALL col1, col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col1 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 DISTINCT col1 col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query II rowsort
SELECT col2 + + col2, - col2 AS col2 FROM tab1 GROUP BY col2
----
142
-71
16
-8
90
-45

query I rowsort
SELECT + col2 * + col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - + col2 + + + AVG ( DISTINCT + col1 ) IS NULL
----

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab1 AS cor0 WHERE ( col2 ) <= ( NULL ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2, col2, col0, col1
----
45
71
8

query II rowsort
SELECT ALL - col0 AS col2, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 WHERE col1 IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + col0 * + - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * + col2 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
1444
576
6241

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1 HAVING NOT + - col2 IS NOT NULL
----

query I rowsort
SELECT - col1 / + - col1 FROM tab2 WHERE NOT NULL = + - col1 GROUP BY col1
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT + col1 * - col1 AS col0 FROM tab0 GROUP BY col1, col1, col1
----
-6561
0

query I rowsort
SELECT col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 AS col0, + col1 * + col2 * col2 col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
137924
-59
368219
-61
461709

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) <> NULL
----

query I rowsort
SELECT + + col2 AS col2 FROM tab2 cor0 GROUP BY col2, col2, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query II rowsort
SELECT ALL - col0 AS col1, + col2 FROM tab2 GROUP BY col2, col0
----
-15
87
-91
79
-92
58

query II rowsort
SELECT ALL - + col0 * col0 + + + col0 AS col1, col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
-210
30
-8190
182
-8372
184

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col1 HAVING col0 <> NULL
----

query I rowsort
SELECT ALL + col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col2 - - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT AVG ( - col1 ) FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 + - - col0 AS col1 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab2 cor0 WHERE + col0 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab0 GROUP BY col0, col2
----
-1444
-576
-6241

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT ALL - col1 * - col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + AVG ( ALL col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - col1 BETWEEN - col1 AND - col2
----
-45

query I rowsort
SELECT ALL - col2 * - + col2 FROM tab1 GROUP BY col0, col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab1 WHERE NOT + - col2 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 WHERE + col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col2 HAVING NOT + col2 >= NULL
----

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL <= - col0
----

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
41
59
59
61
61

query I rowsort
SELECT - AVG ( - + col2 ) FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 cor0 WHERE ( NULL ) NOT IN ( + col0 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0 HAVING NOT - - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + + col0 - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
166
52
86

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col2, col1, col1
----
44
57
6

query II rowsort
SELECT ALL - - col0 AS col0, + col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
87
91
79
92
58

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0, col0 HAVING NULL = NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + AVG ( ALL col2 ) * - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 WHERE - col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 * col0 - - col0 AS col1 FROM tab1 cor0 GROUP BY col0, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT col2 + - col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
22
28
82

query II rowsort
SELECT + col0 AS col0, col0 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query II rowsort
SELECT ALL - col2 AS col2, col1 AS col1 FROM tab0 GROUP BY col2, col1
----
-24
81
-38
0
-79
0

query II rowsort
SELECT col0 AS col2, col0 AS col2 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

onlyif mysql # DIV for integer division: 
query I rowsort label-2148
SELECT col1 DIV - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2148
SELECT col1 / - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + col0 AS col2, + col1 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) < col1 + col2
----

query I rowsort
SELECT + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL col0 + + col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 WHERE NOT ( ( NULL IS NULL ) ) GROUP BY col1, col2, col0
----

query I rowsort
SELECT col1 * + col1 FROM tab0 cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 * - col2 + - col2 AS col1 FROM tab0 GROUP BY col0, col2
----
261744
44352
53325

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 WHERE col0 IS NOT NULL GROUP BY col2, col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 + col2 AS col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING + col0 IS NULL
----

query II rowsort
SELECT col0, - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 AS col2, col0 col2 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL + col1 * - col1 FROM tab1 GROUP BY col0, col1
----
-1936
-3249
-36

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
0
81

query I rowsort
SELECT ALL col1 * - col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
45
71
8

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
26
43
83

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT col1 * - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT + - col1 * col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING - col0 IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - - col1 - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
0

query I rowsort
SELECT ALL col1 + + col2 FROM tab1 GROUP BY col2, col1
----
102
115
14

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-2180
SELECT DISTINCT col2 DIV col2 FROM tab0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-2180
SELECT DISTINCT col2 / col2 FROM tab0 GROUP BY col2
----
1

query I rowsort
SELECT ALL col2 * col0 FROM tab1 GROUP BY col0, col0, col2
----
1260
176
5822

query I rowsort
SELECT DISTINCT + + col1 * col1 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NULL BETWEEN NULL AND - + col0
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col2 * + + col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col2 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT - - col0 - - col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
182
184
30

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col2 * + col2 * - col2 + col2 AS col0 FROM tab1 GROUP BY col2
----
357982
520
91170

query I rowsort
SELECT ALL - col2 * - col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + - col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT ALL + col2 * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
-58
-79
-87

query I rowsort
SELECT - + col2 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col0, col1, col0 HAVING + - col1 IS NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col1, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col1, col1 FROM tab1 GROUP BY col0, col1
----
44
44
57
57
6
6

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL + col1, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT ALL + col1 * - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col1, col0, col0 HAVING NOT ( NULL ) > ( NULL )
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col1 + col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
158
48
76

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING col1 > NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 WHERE - - col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 - + col0 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL < - AVG ( DISTINCT col1 )
----

query I rowsort
SELECT col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0, col1
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT col0 + - - col0 < NULL
----

query II rowsort
SELECT - col1 AS col1, col2 FROM tab0 GROUP BY col1, col2
----
-81
24
0
38
0
79

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) <= NULL
----

query I rowsort
SELECT - col1 / col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col2 * + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + AVG ( - col0 ) + col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) > ( NULL )
----

query I rowsort
SELECT col1 AS col0 FROM tab2 WHERE NOT - + col0 + - col1 = NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT - col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + + col1 + - col1 FROM tab0 WHERE NOT + col0 >= NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - col1 * + - col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
6561

query II rowsort
SELECT ALL col2 AS col0, col2 AS col1 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 AS col0, - col2 col0 FROM tab0 GROUP BY col0, col2
----
26
-79
43
-24
83
-38

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col1, col0
----
15
91
92

query I rowsort
SELECT ALL + col0 + - col0 AS col2 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col2 + col2, col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
116
58
158
79
174
87

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT - col2 + col2 AS col0 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col0 * - + col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-2025
-5041
-64

query II rowsort
SELECT DISTINCT - col2, - col2 FROM tab2 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT ALL col1 + - - col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT col2 * - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2565
-3124
-48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 * - col1 AS col0 FROM tab0 GROUP BY col1 HAVING ( NULL ) <= NULL
----

query I rowsort
SELECT ALL col0 * + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING + col0 IS NOT NULL
----
225
8281
8464

query II rowsort
SELECT ALL - - col1 AS col1, col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT - col2 * + - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col1
----
3364
6241
7569

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - + col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT col1 * - col1 FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * - col1 FROM tab2 cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT - - col2 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT col1 * + col1 AS col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL col1 * col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
6561

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col1 col2, col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
82
57
28
6
22

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 + col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING col0 IS NULL
----

query I rowsort
SELECT col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING + col0 <= NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 * - + col0 + - + col0 FROM tab1 AS cor0 GROUP BY col0
----
462
6642
756

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE ( NOT ( ( ( NULL >= NULL ) ) ) ) GROUP BY col0
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 * - col2 col2 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL > col1
----

query I rowsort
SELECT - col0 * + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0, col0, col0 HAVING ( NULL ) IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col0, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT - + col2 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 AS col1, col0 col1 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT DISTINCT + col1 + - + col1 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT 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 DISTINCT + col1 col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NOT ( NULL IS NOT NULL )
----
44
57
6

query I rowsort
SELECT ALL + col2 + - col2 * - col2 * col2 AS col1 FROM tab1 GROUP BY col2, col2
----
357982
520
91170

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + - col2 FROM tab1 cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT - - col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 + - col2 FROM tab0 GROUP BY col2
----
-158
-48
-76

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 ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query II rowsort
SELECT ALL col0, col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT AVG ( DISTINCT - + col0 ) IS NULL
----
26
26
43
43
83
83

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT + - col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( ( NULL < NULL ) )
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN - AVG ( DISTINCT + col1 ) AND NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT col0 + col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col0, col2, col0
----
58
79
87

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col1 + - + col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
-118
-122
-82

query I rowsort
SELECT + col0 * - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( - AVG ( DISTINCT + - col1 ) ) <> NULL
----

query I rowsort
SELECT ALL + col2 + + - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col1, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT + - col2 <= NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT - col1 IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 * - - AVG ( DISTINCT col0 ) AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL BETWEEN - col1 AND NULL
----

query I rowsort
SELECT DISTINCT - + col2 * + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-2337
SELECT col1 DIV - col1 AS col2 FROM tab1 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2337
SELECT col1 / - col1 AS col2 FROM tab1 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT - col1 + col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT - col2 + - - col0 FROM tab0 GROUP BY col0, col2
----
-53
19
45

query I rowsort
SELECT + col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + + col1 * + col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
6561

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 + col2 col1 FROM tab1 GROUP BY col0, col0, col0, col2
----
-11
-14
17

query I rowsort
SELECT ALL - col0 / col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col2 * col2, + col2 FROM tab1 GROUP BY col2
----
2025
45
5041
71
64
8

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1 HAVING NOT + col1 - + col0 IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 - col0 col2 FROM tab0 GROUP BY col2, col0
----
0

query I rowsort
SELECT DISTINCT + col2 + col2 AS col0 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT AVG ( - col2 ) AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT ( + col2 ) < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL + + AVG ( - + col1 ) AS col2 FROM tab0 WHERE NOT ( + col2 IS NOT NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 WHERE NOT col0 IS NULL GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( - - col0 ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col2, col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col0 - + col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col0, col1, col0 HAVING NOT col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 col1, - col2 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
0
71
0
8
0

query I rowsort
SELECT DISTINCT col0 - + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL > + AVG ( ALL col0 )
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - - AVG ( ALL col2 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2 HAVING ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col0 FROM tab1 WHERE NOT NULL NOT BETWEEN NULL AND col0 GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 - + + col0 col2 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-105
-121
-67

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 cor0 GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
45
71
8

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2379
SELECT ALL col1 + col1 DIV - col1 FROM tab2 GROUP BY col1
----
40
58
60

skipif mysql # not compatible
query I rowsort label-2379
SELECT ALL col1 + col1 / - col1 FROM tab2 GROUP BY col1
----
40
58
60

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col1 HAVING + col2 <> NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL AVG ( ALL col0 ) FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col0 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col1 AS col0 FROM tab0 WHERE NOT NULL = NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 + + - col2 FROM tab1 GROUP BY col2
----
0

query I rowsort
SELECT - col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col2 - col2 * + col2 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT - + col0 - col0 * - + col0 FROM tab0 WHERE NOT - col2 - - col0 IS NULL GROUP BY col0
----
1806
650
6806

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 ALL - + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT col2 FROM tab1 GROUP BY col1, col2 HAVING + col1 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2396
SELECT col2 DIV col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-23
-37
-78

skipif mysql # not compatible
query I rowsort label-2396
SELECT col2 / col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-23
-37
-78

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <= col2
----

query I rowsort
SELECT ALL col2 * - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + + col0 FROM tab2 cor0 GROUP BY col1, col0, col2
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT - - col1 + + col0 FROM tab0 cor0 GROUP BY col0, col1
----
124
26
83

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * - col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2408
SELECT + col1 DIV col2 AS col2 FROM tab2 GROUP BY col2, col0, col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2408
SELECT + col1 / col2 AS col2 FROM tab2 GROUP BY col2, col0, col1
----
0
0
0

query II rowsort
SELECT DISTINCT + col0, - col0 FROM tab0 cor0 WHERE NOT NULL > - col0 GROUP BY col0 HAVING NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2410
SELECT ALL + - col0 DIV - - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2410
SELECT ALL + - col0 / - - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT col2 IS NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - + col0 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING - col2 - + + AVG ( ALL - - col2 ) >= NULL
----

query I rowsort
SELECT ALL col0 - + - col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT AVG ( col0 ) AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - col1 * - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab0 GROUP BY col1, col0 HAVING AVG ( DISTINCT col1 ) > NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING + col1 IS NOT NULL
----
-81
0

query I rowsort
SELECT - col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query II rowsort
SELECT ALL col2 * col2, col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
38
576
24
6241
79

query II rowsort
SELECT - + col0, + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT ALL - col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query II rowsort
SELECT - col1, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT ALL - col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT AVG ( col0 ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING ( NOT ( NULL ) IS NOT NULL )
----
0
0
81

query I rowsort
SELECT col0 * + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-3375
-753571
-778688

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 / + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col0 <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT + col1 + - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0 HAVING + col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) NOT BETWEEN NULL AND col0
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col1, + col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
0
26
0
83
81
43

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING + AVG ( DISTINCT col2 ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col1 * col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 - - - col0 - col0 * - col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT - col2 + + + col2 FROM tab1 AS cor0 GROUP BY col2
----
0

query II rowsort
SELECT - + col1 AS col0, col0 - + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
0
-57
0
-6
0

query I rowsort
SELECT ALL + col2 * - col2 FROM tab2 WHERE NULL < ( NULL ) GROUP BY col2
----

query I rowsort
SELECT - AVG ( - col1 ) FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * - col2 col2 FROM tab0 cor0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col1 * + col1 FROM tab1 cor0 WHERE NOT NULL > NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT - col1 * col1 + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1589
-3390
-3706

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT DISTINCT - AVG ( col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-81
0
0

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query II rowsort
SELECT ALL + col0 AS col0, col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query II rowsort
SELECT - col2 + + col2 AS col0, - col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
0
-15
0
-91
0
-92

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col2, col1, col2
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-2471
SELECT ALL - - col0 DIV + col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2471
SELECT ALL - - col0 / + col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT col1 + col1 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT DISTINCT col2 * col2 AS col0 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - col1 AS col1 FROM tab0 WHERE col0 * - col0 + + col0 IS NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 cor0 GROUP BY col1, col0, col2
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + + AVG ( DISTINCT col0 ) AS col2 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN + col0 AND NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0 HAVING AVG ( col2 ) IS NULL
----

query I rowsort
SELECT ALL + col0 + + col0 AS col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT ALL - + col1 * - + col1 - + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT ALL - + col1 FROM tab2 WHERE NOT + col1 <= col2 GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL + col1 * + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT + + col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col1 - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT - col0 * - col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
1260
176
5822

onlyif mysql # DIV for integer division: 
query I rowsort label-2490
SELECT ALL col1 + - col1 + - - col1 DIV - - col1 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2490
SELECT ALL col1 + - col1 + - - col1 / - - col1 FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT col1 + col1 FROM tab0 WHERE - - col2 + col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

onlyif mysql # DIV for integer division: 
query I rowsort label-2495
SELECT DISTINCT - + col1 DIV + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-1

skipif mysql # not compatible
query I rowsort label-2495
SELECT DISTINCT - + col1 / + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-1

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col2 * + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
0
81

query I rowsort
SELECT ALL - - col1 - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING ( NOT col0 IS NOT NULL )
----

query II rowsort
SELECT DISTINCT - - col1 + - col1, + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
0
41
0
59
0
61

query I rowsort
SELECT + col0 * + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT ALL + col0 * + + col0 FROM tab0 cor0 GROUP BY col0, col0 HAVING NOT + AVG ( col2 ) IS NOT NULL
----

query II rowsort
SELECT + - col1, - col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
79
87

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 - - + col1 col2, - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
-24
38
-38
79
-79

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT + col1 + - + col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT - col0 + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT ALL col0 * + col0 AS col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1 HAVING NULL < - - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2, + col2 * + - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col1, col1, col2
----
-45
-71
-8

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
142
16
90

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 * + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab2 GROUP BY col2, col0
----
-225
-8281
-8464

onlyif mysql # DIV for integer division: 
query I rowsort label-2526
SELECT ALL + col2 DIV + col2 - - - col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-57
-78
-86

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2526
SELECT ALL + col2 / + col2 - - - col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-57
-78
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
0

query II rowsort
SELECT col0, col2 FROM tab2 GROUP BY col2, col0, col0
----
15
87
91
79
92
58

onlyif mysql # DIV for integer division: 
query I rowsort label-2531
SELECT col0 * col0 DIV - col0 AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-2531
SELECT col0 * col0 / - col0 AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT + col1 IS NULL
----
41
59
61

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NOT NULL IS NULL )
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-2536
SELECT DISTINCT col1 DIV + col0 AS col1 FROM tab0 GROUP BY col1, col0
----
0
1

skipif mysql # not compatible
query I rowsort label-2536
SELECT DISTINCT col1 / + col0 AS col1 FROM tab0 GROUP BY col1, col0
----
0
1

query I rowsort
SELECT + col1 AS col0 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT col2 AS col0 FROM tab0 cor0 GROUP BY col2, col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + col1 + - - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
114
12
88

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + + col0 + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col0 * + AVG ( + col0 ) FROM tab1 GROUP BY col0 HAVING NOT NULL < ( NULL )
----

query I rowsort
SELECT ALL + col0 + - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 cor0 GROUP BY col1, col2, col0
----
24
38
79

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING ( NULL NOT BETWEEN col1 AND NULL )
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col1 * - col2 + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
2320
4582
5220

query I rowsort
SELECT ALL AVG ( col0 ) FROM tab1 AS cor0 WHERE NOT ( NULL ) < NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NOT NULL = NULL GROUP BY col0, col0
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL + col0 * + col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col1, col0 HAVING NOT col0 IS NULL
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-2562
SELECT ALL col2 DIV - - col2 AS col0 FROM tab0 GROUP BY col1, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2562
SELECT ALL col2 / - - col2 AS col0 FROM tab0 GROUP BY col1, col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + + col1 * - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * col1 - + col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-1980
-3306
-42

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col2 HAVING ( - col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE NOT + - col1 IS NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + - col2 * col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2, col2, col0
----
-24
-38
-79

query II rowsort
SELECT + col2 AS col0, col2 + + col2 AS col1 FROM tab2 GROUP BY col2
----
58
116
79
158
87
174

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col1, - col2 col0 FROM tab2 GROUP BY col1, col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
26
43
83

query I rowsort
SELECT AVG ( DISTINCT - col2 ) AS col1 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NULL ) > - col2
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col2, col2
----
15
91
92

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 col1, col0 col2 FROM tab1 GROUP BY col1, col0, col0
----
22
22
28
28
82
82

query II rowsort
SELECT ALL - col1 AS col1, col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT col2 * col2 * + col1 FROM tab0 GROUP BY col1, col2
----
0
0
46656

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL IS NULL ) GROUP BY col1
----

query I rowsort
SELECT col1 + - col2 AS col2 FROM tab0 GROUP BY col2, col1, col0
----
-38
-79
57

query I rowsort
SELECT - col0 + + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT col0 * - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 + + + col0 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
3813
5428
976

onlyif mysql # DIV for integer division: 
query I rowsort label-2595
SELECT DISTINCT col0 DIV col1 FROM tab2 GROUP BY col1, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-2595
SELECT DISTINCT col0 / col1 FROM tab2 GROUP BY col1, col0
----
0
1
2

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0, col0 HAVING col0 IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 / - AVG ( + col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab1 GROUP BY col1, col0
----
484
6724
784

query I rowsort
SELECT - col2 + + col1 * + + col1 FROM tab1 cor0 GROUP BY col2, col1, col1, col1
----
1865
28
3204

query I rowsort
SELECT DISTINCT - col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT col2 * col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( ( ( NOT NULL IS NOT NULL ) ) )
----

query I rowsort
SELECT - col0 * + col0 + col0 AS col0 FROM tab0 GROUP BY col0
----
-1806
-650
-6806

query I rowsort
SELECT ALL + AVG ( DISTINCT - col0 ) + - col0 * col0 AS col1 FROM tab2 GROUP BY col0, col0, col0 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 * - col1 AS col2 FROM tab0 GROUP BY col1 HAVING col2 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT + col1 * - + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + + col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col1, col2
----

query I rowsort
SELECT DISTINCT + col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab0 GROUP BY col1, col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 * - col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
2378
4661
5307

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2618
SELECT col1 DIV col0 AS col2 FROM tab1 GROUP BY col0, col1
----
0
0
2

skipif mysql # not compatible
query I rowsort label-2618
SELECT col1 / col0 AS col2 FROM tab1 GROUP BY col0, col1
----
0
0
2

query I rowsort
SELECT + - col1 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

onlyif mysql # DIV for integer division: 
query II rowsort label-2621
SELECT ALL + col1, - col1 DIV - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
1
57
1
6
1

skipif mysql # not compatible
query II rowsort label-2621
SELECT ALL + col1, - col1 / - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
1
57
1
6
1

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( NULL IS NULL )
----
15
91
92

query II rowsort
SELECT ALL col2 AS col1, AVG ( - col2 ) FROM tab2 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col2 FROM tab2 WHERE NOT NULL <> NULL GROUP BY col2, col1
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col1 * + col1 + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
1980
3306
42

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + AVG ( ALL - - col0 ) < NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col2 * - col2 + + col2 FROM tab1 cor0 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0, col2 HAVING - + col2 IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT ALL + col2 * + col2 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT col1 * col1 * col1 AS col1 FROM tab2 GROUP BY col1
----
205379
226981
68921

query I rowsort
SELECT + - col0 AS col0 FROM tab2 WHERE NOT NULL = NULL GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING + col0 * + col0 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 + col1 FROM tab1 cor0 GROUP BY col1
----
114
12
88

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 NOT NULL
----
41
59
61

query II rowsort
SELECT DISTINCT col2, - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
-45
71
-71
8
-8

query I rowsort
SELECT col2 * - - col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col1 * - + col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col1 + + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-29
16
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 IS NULL
----

query II rowsort
SELECT ALL col0 AS col0, + col0 AS col1 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT + col2 * + AVG ( + - col2 ) + - col0 + - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING ( NOT NULL IS NULL )
----

query II rowsort
SELECT + col1 * - - col1, col1 AS col1 FROM tab1 WHERE col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 * - col1 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * col1 col2 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col2 IS NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-2664
SELECT col0 + + + col1 DIV col1 - + col1 + - + col0 FROM tab1 GROUP BY col0, col1
----
-43
-5
-56

skipif mysql # not compatible
query I rowsort label-2664
SELECT col0 + + + col1 / col1 - + col1 + - + col0 FROM tab1 GROUP BY col0, col1
----
-43
-5
-56

query I rowsort
SELECT col2 + - - col2 + + col2 FROM tab1 GROUP BY col2
----
135
213
24

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - - col2 AS col0 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-2668
SELECT ALL - col1 DIV - col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2668
SELECT ALL - col1 / - col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 <= NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT col0 - - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
182
184
30

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING col1 IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 * - + col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col2 * + - col2 AS col1 FROM tab1 GROUP BY col2, col0, col1
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT - col0 + - - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2678
SELECT DISTINCT - col2 DIV + col2 + col2 FROM tab2 GROUP BY col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-2678
SELECT DISTINCT - col2 / + col2 + col2 FROM tab2 GROUP BY col2
----
57
78
86

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab0 GROUP BY col2, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT AVG ( col1 ) FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 * - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col2 + + + col1 FROM tab1 GROUP BY col1, col2
----
102
115
14

query I rowsort
SELECT DISTINCT col0 * - + col1 * - col0 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 * + + col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col2 HAVING col2 > - - col0
----
26

onlyif mysql # DIV for integer division: 
query I rowsort label-2698
SELECT col1 * - col1 DIV - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-2698
SELECT col1 * - col1 / - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col0 * - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-41
-59
-61

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
22
28
82

query I rowsort
SELECT col1 * - + col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 WHERE NOT col0 * - col2 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col2 HAVING NULL <> col0
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT col0 + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
182
184
30

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING ( + col2 ) >= NULL
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL BETWEEN col0 AND NULL
----

query I rowsort
SELECT - col2 + + col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 AS cor0 WHERE ( NOT NULL IS NOT NULL ) GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT AVG ( col0 ) IS NOT NULL
----

query II rowsort
SELECT AVG ( col2 ) AS col0, col2 / - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
22
28
82

query I rowsort
SELECT col1 + + col1 - - - col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT - col2 + - col2 FROM tab1 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT ALL col0 + + col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col0 + + - col0 FROM tab1 GROUP BY col2, col0
----
0
0
0

query II rowsort
SELECT - - col2 AS col1, col2 / + col2 AS col2 FROM tab0 cor0 WHERE col1 IS NOT NULL GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT + - col1 + + col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2727
SELECT + ( 63 ) DIV col2 AS col1 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
0
1
7

skipif mysql # not compatible
query I rowsort label-2727
SELECT + ( 63 ) / col2 AS col1 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
0
1
7

query I rowsort
SELECT + 49 FROM tab1 AS cor0 GROUP BY col1
----
49
49
49

query I rowsort
SELECT DISTINCT 97 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-1455
-8827
-8924

query I rowsort
SELECT ALL 73 AS col1 FROM tab2 GROUP BY col0
----
73
73
73

query I rowsort
SELECT ALL - 63 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < + 53 * - 61 + - + col1
----

query I rowsort
SELECT + - ( - 43 ) FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 + + + col1 IS NULL
----

query I rowsort
SELECT ALL - col2 * - col2 FROM tab1 GROUP BY col2
----
2025
5041
64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 / - col1 AS col2 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col1 HAVING ( col2 ) IS NULL OR NOT NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT + + col2, + col2 + - 75 AS col0 FROM tab1 cor0 GROUP BY col2, col2 HAVING - col2 + - 17 IS NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( + col1 ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT 90 FROM tab2 GROUP BY col1, col0
----
90
90
90

query I rowsort
SELECT + ( col1 ) FROM tab2 AS cor0 WHERE NOT ( NOT NULL BETWEEN ( + 8 * col0 + - 64 ) AND ( + col2 + + 28 / + col2 ) ) GROUP BY col1 HAVING ( + 16 ) <= ( NULL )
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE NOT + col0 + + col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + - 22 FROM tab0 cor0 GROUP BY col1
----
-22
-22

query I rowsort
SELECT ALL col2 + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT ALL + 8 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
8
8
8

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN ( 80 ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2745
SELECT DISTINCT AVG ( DISTINCT CAST( NULL AS SIGNED ) ) + + 58 * 82 AS col2 FROM tab2 cor0 WHERE NULL > + col2 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-2745
SELECT DISTINCT AVG ( DISTINCT CAST ( NULL AS INTEGER ) ) + + 58 * 82 AS col2 FROM tab2 cor0 WHERE NULL > + col2 GROUP BY col1
----

query II rowsort
SELECT ( + 74 ) AS col0, 93 FROM tab2 cor0 WHERE ( col2 ) IS NOT NULL GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL - 46, ( + col0 ) FROM tab1 GROUP BY col0, col2 HAVING NOT ( NOT + 70 + - ( + col0 ) > - + col0 )
----
-46
22
-46
28
-46
82

onlyif mysql # DIV for integer division: 
query I rowsort label-2748
SELECT ( - col2 ) DIV - col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2748
SELECT ( - col2 ) / - col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col2
----
1
1
1

query II rowsort
SELECT ALL - NULLIF ( - + 38, + col2 ) AS col0, col2 AS col0 FROM tab2 GROUP BY col0, col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col1, - 25 FROM tab1 GROUP BY col1
----
44
-25
57
-25
6
-25

query I rowsort
SELECT - ( - - col1 ) + col0 * + ( + - col1 ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND + col1
----

query I rowsort
SELECT - col1 AS col2 FROM tab1 WHERE NOT ( NULL ) >= NULL GROUP BY col1
----

query II rowsort
SELECT DISTINCT - col1 + + - col1 + - col1 AS col1, col1 FROM tab0 AS cor0 GROUP BY col1
----
-243
81
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2754
SELECT DISTINCT - col1 DIV - col1 + + - 45 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-44

skipif mysql # not compatible
query I rowsort label-2754
SELECT DISTINCT - col1 / - col1 + + - 45 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-44

query I rowsort
SELECT + 25 FROM tab2 AS cor0 WHERE NOT + 93 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + 27 - + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-135
27

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT COALESCE ( - 59, 95, + - 69 ) / - + col0 AS col1 FROM tab2 WHERE NOT NULL < NULL GROUP BY col0 HAVING - + 67 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2760
SELECT ALL - 32 AS col0 FROM tab2 AS cor0 WHERE col2 NOT IN ( + + NULLIF ( + CAST( - col0 AS SIGNED ), + ( 77 ) ) / + col2 ) GROUP BY col0, col1
----
-32
-32
-32

skipif mysql # not compatible
query I rowsort label-2760
SELECT ALL - 32 AS col0 FROM tab2 AS cor0 WHERE col2 NOT IN ( + + NULLIF ( + CAST ( - col0 AS INTEGER ), + ( 77 ) ) / + col2 ) GROUP BY col0, col1
----
-32
-32
-32

query I rowsort
SELECT 32 FROM tab0 AS cor0 GROUP BY col2
----
32
32
32

query I rowsort
SELECT DISTINCT - ( + 4 ) AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT ( + col0 ) * + col0 * 95 + col0 AS col0 FROM tab1 cor0 WHERE NOT NULLIF ( + col2, - 12 * - + 2 ) IS NOT NULL GROUP BY col0
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2764
SELECT ALL - - col0 / 30 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NOT col0 * + col0 NOT BETWEEN CAST( NULL AS DECIMAL ) AND - 74 * col1 + - col1
----

skipif mysql # not compatible
query I rowsort label-2764
SELECT ALL - - col0 / 30 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NOT col0 * + col0 NOT BETWEEN CAST ( NULL AS REAL ) AND - 74 * col1 + - col1
----

query I rowsort
SELECT DISTINCT + - 41 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2766
SELECT DISTINCT AVG ( DISTINCT - NULLIF ( + CAST( + - col0 AS SIGNED ), NULLIF ( - col0, + 92 * - - 29 ) ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-2766
SELECT DISTINCT AVG ( DISTINCT - NULLIF ( + CAST ( + - col0 AS INTEGER ), NULLIF ( - col0, + 92 * - - 29 ) ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2768
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col0 HAVING - - CAST( - col0 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-2768
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col0 HAVING - - CAST ( - col0 AS INTEGER ) IS NULL
----

query I rowsort
SELECT - - 76 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
76
76

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT + 83 FROM tab2 AS cor0 GROUP BY col2
----
83
83
83

query I rowsort
SELECT 88 + + ( - col1 ) * + col1 + + 23 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1570
-3370
-3610

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 * - 40, 35 col2 FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) > + - ( - 72 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 4 col2, 1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-4
1
-4
1
-4
1

query I rowsort
SELECT DISTINCT + 7 + + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + + 22 / - col2 IS NOT NULL
----
-1
-38
-64

query I rowsort
SELECT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 83 col1 FROM tab2 cor0 GROUP BY col2
----
83
83
83

query I rowsort
SELECT - 32 FROM tab2 GROUP BY col2 HAVING NOT NULL < + + COALESCE ( + + 59, + ( + 85 ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2780
SELECT DISTINCT - col2 DIV col2 FROM tab1 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-2780
SELECT DISTINCT - col2 / col2 FROM tab1 GROUP BY col2
----
-1

query I rowsort
SELECT - 2 FROM tab2 cor0 GROUP BY col1, col1
----
-2
-2
-2

query I rowsort
SELECT 97 AS col0 FROM tab1 GROUP BY col1, col2
----
97
97
97

query II rowsort
SELECT DISTINCT + col1, ( - - col1 ) * + + col1 * - 10 * + col1 FROM tab2 GROUP BY col1
----
41
-689210
59
-2053790
61
-2269810

query I rowsort
SELECT - 60 + col0 FROM tab0 GROUP BY col0, col1
----
-17
-34
23

query I rowsort
SELECT 1 + + 59 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 65 col0 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING NOT NULL IS NOT NULL
----
65

query II rowsort
SELECT col2 + - col2 * - col2 / + 2 AS col0, col2 * - + 83 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <> col2 / - ( + 55 ) GROUP BY col2
----

query I rowsort
SELECT + - NULLIF ( 31, 67 ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

query I rowsort
SELECT ALL + col2 * col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - 43 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-43
-43
-43

query I rowsort
SELECT DISTINCT - 40 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE ( NULL ) >= col1 GROUP BY col2
----

query I rowsort
SELECT - col2 + 60 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL < 23
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 GROUP BY col2, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 26 - - col2 col1 FROM tab1 GROUP BY col2 HAVING NOT 62 NOT BETWEEN + col1 + - - col1 AND - 38
----

query I rowsort
SELECT ALL 51 / 68 FROM tab0 GROUP BY col1, col0, col1 HAVING NOT + 14 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2798
SELECT DISTINCT col1 * + CAST( + 86 AS SIGNED ) * + - col2 + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + 25 IS NULL
----

skipif mysql # not compatible
query I rowsort label-2798
SELECT DISTINCT col1 * + CAST ( + 86 AS INTEGER ) * + - col2 + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + 25 IS NULL
----

query I rowsort
SELECT - col0 - - 59 + col0 FROM tab2 cor0 GROUP BY col2, col0, col0 HAVING - + 0 IS NULL
----

query I rowsort
SELECT DISTINCT + + 3 * + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-246
-66
-84

query I rowsort
SELECT - col2 FROM tab1 WHERE NOT + col2 * + col2 IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT 26 * + 23 + + col1 * + 35 FROM tab2 GROUP BY col1
----
2033
2663
2733

query I rowsort
SELECT 3 + + col0 + + 84 - - col0 * - col0 + + col0 AS col1 FROM tab0 GROUP BY col0
----
-1676
-537
-6636

onlyif mysql # DIV for integer division: 
query I rowsort label-2804
SELECT + ( 76 ) DIV - - 38 FROM tab2 AS cor0 GROUP BY col1 HAVING - - col1 IS NOT NULL
----
2
2
2

skipif mysql # not compatible
query I rowsort label-2804
SELECT + ( 76 ) / - - 38 FROM tab2 AS cor0 GROUP BY col1 HAVING - - col1 IS NOT NULL
----
2
2
2

query I rowsort
SELECT DISTINCT + - col1 + + 28 - - - col1 FROM tab1 AS cor0 GROUP BY col1
----
-60
-86
16

query I rowsort
SELECT DISTINCT + ( - + col1 ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT 48 + 54 AS col2 FROM tab0 cor0 GROUP BY col1
----
102
102

query I rowsort
SELECT - + col0 * - col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col1 + - + col1 + + ( col1 ) - - 78 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-3
78

query II rowsort
SELECT + 71 AS col1, + col0 * - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
71
-484
71
-6724
71
-784

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2811
SELECT + col2 / + + col2 * - col0 + - col0 / COALESCE ( + col0, + col2 * - 99 * - CAST( NULL AS DECIMAL ) + col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING col0 IS NULL AND NOT NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-2811
SELECT + col2 / + + col2 * - col0 + - col0 / COALESCE ( + col0, + col2 * - 99 * - CAST ( NULL AS REAL ) + col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING col0 IS NULL AND NOT NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2812
SELECT - + CAST( NULL AS SIGNED ) col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2812
SELECT - + CAST ( NULL AS INTEGER ) col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT - + 20 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - - 72 IS NULL
----
-20
-20
-20

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT - 8 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-8

query I rowsort
SELECT DISTINCT + 99 * - 51 * - + col0 * - col0 FROM tab2 AS cor0 GROUP BY col0
----
-1136025
-41810769
-42734736

query I rowsort
SELECT - 10 + + - col1 * + 36 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1594
-2062
-226

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 * + + ( col1 ) + 46 col0 FROM tab0 AS cor0 WHERE NOT ( + col2 ) IS NOT NULL GROUP BY col0, col1
----

query II rowsort
SELECT ALL - col2, col2 FROM tab2 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL - - 3 FROM tab1 AS cor0 WHERE NOT + 66 * - + col0 IS NOT NULL GROUP BY col0, col2
----

query II rowsort
SELECT ALL 76 AS col1, col0 + - 38 AS col1 FROM tab1 GROUP BY col0, col2
----
76
-10
76
-16
76
44

query I rowsort
SELECT ALL + 29 FROM tab1 GROUP BY col0 HAVING NOT ( 96 + - + ( col0 ) ) < + col0
----
29
29

query I rowsort
SELECT + ( col1 ) FROM tab0 WHERE ( col2 ) * + col1 + + col0 >= + + col0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT - + 58 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT - 6 + - - col2 + + + ( - col2 ) / col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL NOT BETWEEN col2 + 84 AND NULL AND col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT 72 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
5832

query I rowsort
SELECT 6 + col1 FROM tab0 AS cor0 GROUP BY col1
----
6
87

query I rowsort
SELECT DISTINCT col1 * col1 FROM tab1 GROUP BY col1 HAVING NOT 9 IS NULL
----
1936
3249
36

query I rowsort
SELECT - + 0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col2 + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT col2 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2832
SELECT ALL 11 * + + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2832
SELECT ALL 11 * + + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2, col2
----
NULL
NULL
NULL

query II rowsort
SELECT - 62 * col0 + - col0 * + + col0 AS col0, col0 + + - NULLIF ( - + 14, + 59 ) FROM tab0 WHERE NOT NULL BETWEEN NULL AND + 16 / - 28 GROUP BY col0
----

query I rowsort
SELECT DISTINCT - ( + + 89 ) + - col0 FROM tab2 GROUP BY col0 HAVING + 93 >= 53
----
-104
-180
-181

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING AVG ( + 20 ) IS NOT NULL
----
58
79
87

query I rowsort
SELECT - 9 FROM tab0 AS cor0 GROUP BY col0
----
-9
-9
-9

query I rowsort
SELECT col0 * - col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
10648
21952
551368

query II rowsort
SELECT DISTINCT - + col2 + + + col2, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0
58
0
79
0
87

query I rowsort
SELECT col2 + 34 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL + col0 * col0, 9 * col0 FROM tab2 GROUP BY col0 HAVING NULL <> NULL
----

query II rowsort
SELECT ALL - col0 AS col2, col0 / - ( + 31 ) * - 63 / col0 * + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IN ( - 99 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2842
SELECT - + col2 * + - col2 * - col2 * + + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2842
SELECT - + col2 * + - col2 * - col2 * + + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2843
SELECT + col2 + + ( + col2 ) FROM tab2 AS cor0 WHERE - CAST( NULL AS SIGNED ) IS NULL GROUP BY col2
----
116
158
174

skipif mysql # not compatible
query I rowsort label-2843
SELECT + col2 + + ( + col2 ) FROM tab2 AS cor0 WHERE - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2
----
116
158
174

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2844
SELECT DISTINCT - + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-2844
SELECT DISTINCT - + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL NOT IN ( 26 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2846
SELECT - 82 + + col2 DIV + col0 col1 FROM tab2 GROUP BY col0, col2
----
-77
-82
-82

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2846
SELECT - 82 + + col2 / + col0 col1 FROM tab2 GROUP BY col0, col2
----
-77
-82
-82

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2 HAVING NOT 85 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2848
SELECT + col2 DIV - col2 FROM tab1 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2848
SELECT + col2 / - col2 FROM tab1 GROUP BY col2
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-2849
SELECT DISTINCT 9 DIV - 46 FROM tab1 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-2849
SELECT DISTINCT 9 / - 46 FROM tab1 GROUP BY col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 28 col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0
----
28
28
28

query I rowsort
SELECT ALL + - col0 + + 46 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
-37
20
3

query I rowsort
SELECT - col1 * - col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT + - 43 * + + 16 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-688
-688
-688

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2854
SELECT - 11 FROM tab2 cor0 WHERE NULL <> - col1 + + col2 * - CAST( + 17 AS DECIMAL ) + - + col0 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-2854
SELECT - 11 FROM tab2 cor0 WHERE NULL <> - col1 + + col2 * - CAST ( + 17 AS REAL ) + - + col0 GROUP BY col0
----

query II rowsort
SELECT DISTINCT + - 52, 2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT 5 AS col2 FROM tab0 AS cor0 WHERE NULL IN ( 17 / + col0 ) GROUP BY col0
----

query I rowsort
SELECT + col2 * - 25 FROM tab0 GROUP BY col0, col2 HAVING NOT - 27 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2859
SELECT col1 DIV col1 FROM tab1 GROUP BY col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2859
SELECT col1 / col1 FROM tab1 GROUP BY col0, col1
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ( + + col2 ) col2, - col2 * + - 32 AS col1 FROM tab2 AS cor0 WHERE col0 + + 83 IS NULL GROUP BY col2, col2, col2 HAVING NULL IN ( 70 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * + 57 * col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL NOT BETWEEN ( + col2 ) AND col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2862
SELECT DISTINCT + col0 + CAST( NULL AS SIGNED ) + + col0 AS col2 FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-2862
SELECT DISTINCT + col0 + CAST ( NULL AS INTEGER ) + + col0 AS col2 FROM tab0 GROUP BY col0
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 - + 36 col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 + + 11 AS col1 FROM tab1 GROUP BY col0
----
33
39
93

query I rowsort
SELECT - 86 FROM tab2 GROUP BY col1, col0
----
-86
-86
-86

query I rowsort
SELECT + 87 FROM tab2 cor0 GROUP BY col0
----
87
87
87

query I rowsort
SELECT - ( - + 84 ) FROM tab1 AS cor0 GROUP BY col1
----
84
84
84

query I rowsort
SELECT DISTINCT 53 AS col2 FROM tab2 GROUP BY col1
----
53

query I rowsort
SELECT 51 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT ALL + - col0 AS col2, + col2 - - col0 FROM tab1 cor0 GROUP BY col0, col2, col2
----
-22
30
-28
73
-82
153

query I rowsort
SELECT - - col2 * - + ( - 82 ) * - - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
166050
413362
5248

query I rowsort
SELECT DISTINCT + col1 FROM tab2 WHERE NOT - - col1 * + col2 BETWEEN + + col1 AND - col2 GROUP BY col1, col1 HAVING - 72 > col1 * 3
----

query I rowsort
SELECT DISTINCT - AVG ( col1 ) * + 48 AS col2 FROM tab2 cor0 WHERE - ( 97 ) <> NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 77 FROM tab2 AS cor0 WHERE + 15 + col0 IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2875
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2875
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2876
SELECT ALL - - 32 + CAST( NULL AS SIGNED ) - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING - 78 + + CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2876
SELECT ALL - - 32 + CAST ( NULL AS INTEGER ) - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING - 78 + + CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT + 54 IS NULL
----
44
57
6

query I rowsort
SELECT - 62 + 0 FROM tab1 GROUP BY col0 HAVING NOT + col0 > NULL
----

query I rowsort
SELECT + 2 / col2 AS col2 FROM tab1 WHERE NOT ( - 72 ) IS NULL GROUP BY col2 HAVING ( + 60 ) <= 43
----

query I rowsort
SELECT - 69 AS col1 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT - 20 IS NULL
----
-69
-69
-69

query I rowsort
SELECT ALL - 4 + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
4
41
67

query I rowsort
SELECT - + col1 + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + 13 * - col2 + 31 <> NULL
----

query II rowsort
SELECT + col1 AS col1, + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
44
44
57
57
6
6

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 GROUP BY col0, col1 HAVING - 55 IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 61 * ( 89 ) + + col2 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 99 AS col2 FROM tab1 GROUP BY col1 HAVING NULL IN ( + 32 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 91 * + 57 col2 FROM tab1 GROUP BY col1
----
5187
5187
5187

onlyif mysql # DIV for integer division: 
query I rowsort label-2890
SELECT + 86 + col2 DIV 2 AS col2 FROM tab2 WHERE NOT col2 < - col0 GROUP BY col2
----
115
125
129

skipif mysql # not compatible
query I rowsort label-2890
SELECT + 86 + col2 / 2 AS col2 FROM tab2 WHERE NOT col2 < - col0 GROUP BY col2
----
115
125
129

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2891
SELECT - + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) <> 11 + - + col0 * CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2891
SELECT - + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) <> 11 + - + col0 * CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT DISTINCT + col0 * - col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
-210
-8190
-8372

onlyif mysql # DIV for integer division: 
query I rowsort label-2893
SELECT ALL - + col0 * - - col0 DIV col0 * + col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

skipif mysql # not compatible
query I rowsort label-2893
SELECT ALL - + col0 * - - col0 / col0 * + col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 WHERE + col2 IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col1 * + + col0 FROM tab2 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT - - 98 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
98

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT + + col2 IS NOT NULL
----

query I rowsort
SELECT 12 / - 73 AS col0 FROM tab1 WHERE NULL BETWEEN + col0 AND + col2 GROUP BY col1
----

query I rowsort
SELECT ALL - + 39 FROM tab1 AS cor0 GROUP BY col2, col2
----
-39
-39
-39

query I rowsort
SELECT ALL 25 + - 30 FROM tab2 AS cor0 GROUP BY col1
----
-5
-5
-5

query I rowsort
SELECT - 61 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1342
-1708
-5002

query I rowsort
SELECT DISTINCT - 24 * + 38 AS col0 FROM tab1 GROUP BY col2, col1 HAVING - 80 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2905
SELECT CAST( NULL AS SIGNED ) + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-2905
SELECT CAST ( NULL AS INTEGER ) + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * 64 + col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( + 82 ) IS NULL
----
-2583
-3717
-3843

query I rowsort
SELECT - 14 + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
10
24
65

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 63 * 38 FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 27 FROM tab1 GROUP BY col0
----
27
27
27

query I rowsort
SELECT DISTINCT + ( col2 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2912
SELECT col0 + - CAST( NULL AS DECIMAL ) FROM tab2 cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2912
SELECT col0 + - CAST ( NULL AS REAL ) FROM tab2 cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 6 FROM tab0 GROUP BY col1, col1, col0
----
-6
-6
-6

query I rowsort
SELECT 16 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
16
16
16

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2915
SELECT col2 + CAST( NULL AS SIGNED ) * - col2 FROM tab2 GROUP BY col2 HAVING NOT 45 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2915
SELECT col2 + CAST ( NULL AS INTEGER ) * - col2 FROM tab2 GROUP BY col2 HAVING NOT 45 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + 33 AS col2 FROM tab1 GROUP BY col0, col0
----
33
33
33

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + + 6 col0 FROM tab0 GROUP BY col1
----
6
87

query I rowsort
SELECT + col2 + + ( + col2 ) FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT - 46 AS col2 FROM tab0 AS cor0 WHERE ( NOT NULL IS NULL ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 76 + - col2 col2, col2 FROM tab2 GROUP BY col2
----
-11
87
-3
79
18
58

query I rowsort
SELECT + 71 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 + + col1 AS col2 FROM tab0 GROUP BY col1, col0, col2
----
105
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 + - 26 col0 FROM tab1 GROUP BY col1, col0, col2 HAVING NOT ( - col0 ) + + col2 + - + 12 + col2 IS NULL OR NULL IS NOT NULL
----
-32
-70
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 93 col1 FROM tab2 GROUP BY col0 HAVING + + 39 IS NULL
----

query I rowsort
SELECT DISTINCT + 3 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
3

query I rowsort
SELECT - 26 AS col1 FROM tab2 GROUP BY col2
----
-26
-26
-26

query I rowsort
SELECT 94 FROM tab0 GROUP BY col2
----
94
94
94

query I rowsort
SELECT 44 AS col2 FROM tab1 GROUP BY col0 HAVING NOT 5 IS NULL
----
44
44
44

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - 76 FROM tab2 WHERE NOT - - col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - + 5 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
-5

query I rowsort
SELECT - col1 * 59 AS col0 FROM tab0 GROUP BY col1
----
-4779
0

query II rowsort
SELECT ALL col1 * - col1 + 95 AS col2, + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-1586
41
-3386
59
-3626
61

query I rowsort
SELECT 99 FROM tab1 GROUP BY col1, col0
----
99
99
99

query II rowsort
SELECT + + col1, - col0 + + col0 + - col1 * 84 + 77 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
-3367
59
-4879
61
-5047

query I rowsort
SELECT ALL + - 91 * + col0 + + 77 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + - col0 IS NULL
----
-2289
-3836
-7476

query I rowsort
SELECT - col0 * + 4 + - 47 AS col2 FROM tab0 GROUP BY col0
----
-151
-219
-379

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-2938
SELECT + col1 - + ( - CAST( NULL AS DECIMAL ) ) + + + 71 * + ( - 27 ) AS col2, + col1 / + 63 - + col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

skipif mysql # not compatible
query II rowsort label-2938
SELECT + col1 - + ( - CAST ( NULL AS REAL ) ) + + + 71 * + ( - 27 ) AS col2, + col1 / + 63 - + col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 + - ( - col2 ) col1, 3 FROM tab1 GROUP BY col2
----
142
3
16
3
90
3

query I rowsort
SELECT + col0 - - 16 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
107
108
31

query I rowsort
SELECT ALL - 35 FROM tab2 AS cor0 GROUP BY col1, col1
----
-35
-35
-35

query I rowsort
SELECT + col1 * + col1 FROM tab2 GROUP BY col1, col2
----
1681
3481
3721

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-2943
SELECT CAST( ( + + CAST( - col0 AS DECIMAL ) ) AS SIGNED ) AS col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-2943
SELECT CAST ( ( + + CAST ( - col0 AS REAL ) ) AS INTEGER ) AS col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT 65 * - col1 FROM tab2 GROUP BY col1
----
-2665
-3835
-3965

query I rowsort
SELECT ALL + + col1 * - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 67 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
67
67
67

query I rowsort
SELECT ALL col2 * + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2948
SELECT DISTINCT - CAST( NULL AS SIGNED ) * - - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + 30 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-2948
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * - - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + 30 IS NOT NULL
----

query I rowsort
SELECT ALL ( col0 ) * - + col0 + - + col0 * col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL OR NOT ( NULL ) IS NOT NULL
----
-16562
-16928
-450

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 cor0 WHERE NOT ( + 8 ) IS NULL GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL + 35 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
35
35
35

query I rowsort
SELECT NULLIF ( 87, + 85 ) AS col0 FROM tab1 GROUP BY col2
----
87
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 WHERE 83 IS NOT NULL GROUP BY col2, col0 HAVING NOT ( NOT 44 < NULL )
----

query I rowsort
SELECT DISTINCT + - 9 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
-9

query II rowsort
SELECT DISTINCT - col2 AS col2, ( + 85 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN + col2 AND - col2 + - ( + + 23 )
----

query I rowsort
SELECT + col2 + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + 21 + col1 FROM tab1 GROUP BY col1
----
27
65
78

query II rowsort
SELECT - + ( - + col2 ) AS col0, 59 - + col2 * + 13 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
-253
38
-435
79
-968

query I rowsort
SELECT 35 - 79 + 5 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
161
251
261

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING - 78 + - 91 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING - col0 * 9 IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + 98 FROM tab2 GROUP BY col0
----
98

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2964
SELECT DISTINCT - CAST( - 7 AS SIGNED ) col1 FROM tab1 GROUP BY col0
----
7

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2964
SELECT DISTINCT - CAST ( - 7 AS INTEGER ) col1 FROM tab1 GROUP BY col0
----
7

query I rowsort
SELECT - 3 * - col1 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL <= 62 / - 21 )
----

query I rowsort
SELECT - + 56 - + 38 FROM tab2 AS cor0 GROUP BY col1, col1
----
-94
-94
-94

query I rowsort
SELECT ALL - 21 AS col1 FROM tab2 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT + + 95 IS NOT NULL
----

query I rowsort
SELECT + col1 * + - 8 FROM tab1 AS cor0 GROUP BY col2, col1
----
-352
-456
-48

query I rowsort
SELECT DISTINCT col2 * - 10 - - 45 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
1695
3355
380

query I rowsort
SELECT + 21 FROM tab0 cor0 GROUP BY col2
----
21
21
21

query I rowsort
SELECT + col0 * - ( + col0 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT 62 + + col0 + + col0 AS col1 FROM tab1 GROUP BY col0
----
106
118
226

query II rowsort
SELECT - + col0 AS col2, + 85 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-1870
-28
-2380
-82
-6970

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2974
SELECT + CAST( AVG ( DISTINCT col1 ) AS SIGNED ) FROM tab1 GROUP BY col2, col2
----
44
57
6

skipif mysql # not compatible
query I rowsort label-2974
SELECT + CAST ( AVG ( DISTINCT col1 ) AS INTEGER ) FROM tab1 GROUP BY col2, col2
----
44
57
6

query I rowsort
SELECT + + 56 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
56
56
56

query I rowsort
SELECT ALL + 69 FROM tab0 GROUP BY col0
----
69
69
69

query I rowsort
SELECT ( - 87 ) FROM tab2 GROUP BY col2
----
-87
-87
-87

query II rowsort
SELECT DISTINCT col2 - col2 - + + col2, - 69 FROM tab0 GROUP BY col2, col1 HAVING - col2 >= ( 22 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + COALESCE ( 52, + col1 ) col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
52

query I rowsort
SELECT ALL + 81 FROM tab2 cor0 GROUP BY col1, col0
----
81
81
81

query I rowsort
SELECT + 55 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
55
55
55

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT - + col1 <= - - col0 * + col0 + - AVG ( DISTINCT - + col2 )
----

query I rowsort
SELECT col0 + + ( - col0 ) FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT 55 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - col1 IS NULL
----
0
4455

query I rowsort
SELECT + 5 + 93 * - col0 AS col0 FROM tab0 WHERE col2 IS NULL GROUP BY col2, col0, col1
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT - col0 - - col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 87 FROM tab0 AS cor0 WHERE NOT ( NOT col1 NOT BETWEEN 25 + + col0 * col2 AND NULL ) GROUP BY col1 HAVING NOT - col1 >= ( 22 + + 68 )
----
87
87

query I rowsort
SELECT - 47 FROM tab2 cor0 GROUP BY col2
----
-47
-47
-47

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( col1 ) + + 95 col0 FROM tab1 GROUP BY col1
----
101
139
152

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 * col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + 71 NOT IN ( 58 )
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-2995
SELECT - col2 + - col2 FROM tab2 AS cor0 WHERE NOT - CAST( NULL AS DECIMAL ) BETWEEN + CAST( NULL AS SIGNED ) AND ( + ( + col0 ) + + col0 * col0 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-2995
SELECT - col2 + - col2 FROM tab2 AS cor0 WHERE NOT - CAST ( NULL AS REAL ) BETWEEN + CAST ( NULL AS INTEGER ) AND ( + ( + col0 ) + + col0 * col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT 21 * 16 + 78 AS col1 FROM tab1 WHERE col2 * - + 44 = + col2 GROUP BY col0
----

query I rowsort
SELECT DISTINCT + 13 FROM tab1 AS cor0 GROUP BY col1
----
13

query I rowsort
SELECT ALL + 82 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
82
82
82

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING 1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 WHERE NOT + col1 - + col1 NOT IN ( - col1 ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT - 17 AS col1 FROM tab2 GROUP BY col0
----
-17

query II rowsort
SELECT DISTINCT + col0, - col2 FROM tab1 GROUP BY col0, col2
----
22
-8
28
-45
82
-71

query I rowsort
SELECT ALL AVG ( ALL + 52 ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 30 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-30
-30
-30

query II rowsort
SELECT ALL - - col1 - + 54, 14 * - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2, col1
----
-13
-574
5
-826
7
-854

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + 72 * - col1 * - 85 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
495720

query I rowsort
SELECT + col1 - 26 FROM tab2 cor0 GROUP BY col1
----
15
33
35

query I rowsort
SELECT DISTINCT 8 AS col1 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL > col2
----

query I rowsort
SELECT ALL col2 * col2 - col2 * - col2 FROM tab2 AS cor0 GROUP BY col2
----
12482
15138
6728

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 GROUP BY col2 HAVING NOT NULL >= 44
----

query I rowsort
SELECT ALL - col0 + 85 AS col2 FROM tab1 GROUP BY col0, col0
----
3
57
63

query I rowsort
SELECT - col1 + + col1 * col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
1640
3422
3660

query I rowsort
SELECT DISTINCT + col0 * col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING ( + 45 ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 WHERE NOT - 55 NOT BETWEEN NULL AND NULL OR NOT NULL < ( NULL ) GROUP BY col2, col2
----

query I rowsort
SELECT 34 * + col0 FROM tab0 GROUP BY col0, col1 HAVING ( 8 ) IS NOT NULL
----
1462
2822
884

query I rowsort
SELECT + col1 * col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( 69 ) <= NULL
----

query I rowsort
SELECT ALL - - col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
6561

query I rowsort
SELECT 8 FROM tab2 GROUP BY col2, col0
----
8
8
8

query I rowsort
SELECT ALL + 82 AS col1 FROM tab1 GROUP BY col0
----
82
82
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3022
SELECT AVG ( - CAST( NULL AS SIGNED ) ) + - col1 + - col1 + - 46 * + - col1 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3022
SELECT AVG ( - CAST ( NULL AS INTEGER ) ) + - col1 + - col1 + - 46 * + - col1 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 4 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 - 50 IS NULL
----

query I rowsort
SELECT + 91 FROM tab0 GROUP BY col2, col1
----
91
91
91

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NULL > ( + 78 ) * 44 + - + col0
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3026
SELECT + CAST( NULL AS DECIMAL ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT + - col1 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3026
SELECT + CAST ( NULL AS REAL ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT + - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 + + ( 96 ) AS col1 FROM tab1 GROUP BY col1, col0, col0
----
118
124
178

onlyif mysql # DIV for integer division: 
query I rowsort label-3028
SELECT DISTINCT + 19 DIV - col2 FROM tab0 AS cor0 GROUP BY col2
----
0

skipif mysql # not compatible
query I rowsort label-3028
SELECT DISTINCT + 19 / - col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL 52 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
52
52
52

query I rowsort
SELECT ALL 55 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
137
77
83

query I rowsort
SELECT ALL - col0 * - + col0 * + col0 * - 12 + + - 0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - - 52 / + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 47 + NULLIF ( + col2, + 55 ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
11
32
40

query I rowsort
SELECT ALL + col0 + - col0 * col1 AS col1 FROM tab2 GROUP BY col1, col0 HAVING + + ( + col1 ) - - 88 IS NOT NULL
----
-3680
-5278
-900

query I rowsort
SELECT - 68 AS col2 FROM tab1 GROUP BY col1 HAVING 23 IS NULL
----

query I rowsort
SELECT - ( - 2 ) * - col1 + + ( - - 17 ) FROM tab0 GROUP BY col1
----
-145
17

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - 15 + col0 AS col1 FROM tab0 GROUP BY col0, col0, col0
----
11
28
68

query II rowsort
SELECT ALL - ( - col2 ) AS col2, col2 FROM tab2 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT 21 AS col0 FROM tab0 GROUP BY col2, col0, col0 HAVING ( NOT NULL >= col2 * - 92 )
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 WHERE NULL BETWEEN + col1 AND - + ( - 36 ) GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT ( - 55 ) / + col0 / - - NULLIF ( + col0, col0 ) + col0 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3042
SELECT + CAST( + 87 AS SIGNED ) + + - 27 + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
139
84
98

skipif mysql # not compatible
query I rowsort label-3042
SELECT + CAST ( + 87 AS INTEGER ) + + - 27 + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
139
84
98

query I rowsort
SELECT ALL - 61 * - - ( + NULLIF ( 12, - - col1 ) ) + + 45 FROM tab1 AS cor0 GROUP BY col0, col1
----
-687
-687
-687

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3045
SELECT ALL - col2 FROM tab2 GROUP BY col0, col2 HAVING CAST( + - ( + col2 ) AS DECIMAL ) * 81 IS NULL
----

skipif mysql # not compatible
query I rowsort label-3045
SELECT ALL - col2 FROM tab2 GROUP BY col0, col2 HAVING CAST ( + - ( + col2 ) AS REAL ) * 81 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3046
SELECT + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

skipif mysql # not compatible
query I rowsort label-3046
SELECT + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT + 4 + 97 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
101
101
101

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3048
SELECT + CAST( NULL AS SIGNED ) + - col0 - - ( col0 ) * + col2 FROM tab0 GROUP BY col2, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3048
SELECT + CAST ( NULL AS INTEGER ) + - col0 - - ( col0 ) * + col2 FROM tab0 GROUP BY col2, col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2 HAVING NULL BETWEEN + 67 AND NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT CASE col2 WHEN - col2 THEN - AVG ( DISTINCT - col0 ) END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING + col1 = NULL
----

query I rowsort
SELECT - col0 * - 93 FROM tab1 WHERE + col2 * + col1 * - 33 IS NULL GROUP BY col0
----

query I rowsort
SELECT + col0 * - - col0 FROM tab2 cor0 GROUP BY col0, col0
----
225
8281
8464

query II rowsort
SELECT DISTINCT + 61, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
61
-15
61
-91
61
-92

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2 HAVING NOT + col2 * + + col2 + - col2 IS NOT NULL
----

query I rowsort
SELECT - 62 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
-2790
-4402
-496

query I rowsort
SELECT + 27 * + 75 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 * + - 81 IS NULL
----
2025
2025

onlyif mysql # DIV for integer division: 
query II rowsort label-3057
SELECT + col0, 86 DIV ( col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
3
28
3
82
1

skipif mysql # not compatible
query II rowsort label-3057
SELECT + col0, 86 / ( col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
3
28
3
82
1

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col2, col2, col0
----
22
28
82

query I rowsort
SELECT + 94 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL - 81 * col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-4698
-6399
-7047

query II rowsort
SELECT - col2 / - 47 * + col2 + - col2 AS col1, col2 * + col2 FROM tab2 GROUP BY col2 HAVING + ( col2 ) + + 67 * - col2 > NULL
----

query II rowsort
SELECT DISTINCT 4 AS col0, - col2 AS col2 FROM tab0 GROUP BY col2
----
4
-24
4
-38
4
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3063
SELECT ALL + col1 AS col0 FROM tab1 WHERE NULL > + + 71 * + - col2 + + col1 + - - CAST( NULL AS SIGNED ) * col1 + + col2 + - col1 GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-3063
SELECT ALL + col1 AS col0 FROM tab1 WHERE NULL > + + 71 * + - col2 + + col1 + - - CAST ( NULL AS INTEGER ) * col1 + + col2 + - col1 GROUP BY col0, col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL BETWEEN + - 33 * - - 38 + + col1 AND + col2 + - + col0
----

query I rowsort
SELECT DISTINCT - - 76 * col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1824
2888
6004

query I rowsort
SELECT ALL + - 3 / + 9 + - col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT NULL = ( NULL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3068
SELECT + CAST( NULL AS SIGNED ) FROM tab1 WHERE NOT - + 82 < NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3068
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 WHERE NOT - + 82 < NULL GROUP BY col0
----

query II rowsort
SELECT + col1, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
41
59
59
61
61

query I rowsort
SELECT - + col0 FROM tab1 cor0 WHERE NOT 25 * + + col1 - col1 <= NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL - 41 * - + col1 AS col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1804
2337
246

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 WHERE NOT - 41 >= - - col1 GROUP BY col2 HAVING NOT + 26 IS NULL
----
-58
-79
-87

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3074
SELECT DISTINCT col2 * - - 66 AS col1, CAST( NULL AS SIGNED ) AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
1584
NULL
2508
NULL
5214
NULL

skipif mysql # not compatible
query II rowsort label-3074
SELECT DISTINCT col2 * - - 66 AS col1, CAST ( NULL AS INTEGER ) AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
1584
NULL
2508
NULL
5214
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + + 50 ) col2 FROM tab1 GROUP BY col1, col1
----
50
50
50

query I rowsort
SELECT ALL col2 * col2 AS col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL 16 * + col0 - - - col0 FROM tab2 GROUP BY col0
----
1365
1380
225

query I rowsort
SELECT + col1 FROM tab0 WHERE NOT + - 45 IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 * + 48 + col0 / 91 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( ( NULL ) IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 col2, col1 * + + col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) > col2 GROUP BY col2, col1, col0, col1
----

query I rowsort
SELECT - 40 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - + 13 + 52 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 + col2 / - 23 * 84 * + 75 AS col0 FROM tab2 WHERE NULL <> 94 GROUP BY col2, col1
----

query I rowsort
SELECT 53 + - + col1 - + - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT + AVG ( DISTINCT + - col2 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT - 36 > + col1 * - 30
----

query I rowsort
SELECT ALL + 77 FROM tab1 GROUP BY col2
----
77
77
77

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NOT NULL IS NOT NULL )
----
-58
-79
-87

query I rowsort
SELECT ALL ( col0 ) AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT - col2 / + 45 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 GROUP BY col2, col1 HAVING NOT ( - ( - ( - + CASE 38 WHEN - col2 + + + col1 THEN - ( - - 57 ) / - 79 * + col2 WHEN - col0 THEN - 13 ELSE NULL END ) ) / + + col2 < NULL )
----

query II rowsort
SELECT ALL + col1, col0 FROM tab2 cor0 GROUP BY col1, col0
----
41
92
59
91
61
15

query I rowsort
SELECT DISTINCT 26 FROM tab2 AS cor0 GROUP BY col1, col1
----
26

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3091
SELECT ALL - CAST( + - ( 43 ) AS SIGNED ) + + 46 FROM tab2 AS cor0 GROUP BY col0, col2
----
89
89
89

skipif mysql # not compatible
query I rowsort label-3091
SELECT ALL - CAST ( + - ( 43 ) AS INTEGER ) + + 46 FROM tab2 AS cor0 GROUP BY col0, col2
----
89
89
89

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - - col2 + col2 + + col2 * + + col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
2115
5183
80

query II rowsort
SELECT DISTINCT - col2 * - col2 + + 66 AS col1, 75 FROM tab0 AS cor0 GROUP BY col2, col2
----
1510
75
6307
75
642
75

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3095
SELECT + CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3095
SELECT + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3096
SELECT DISTINCT CAST( NULL AS SIGNED ) * col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL < NULL
----

skipif mysql # not compatible
query I rowsort label-3096
SELECT DISTINCT CAST ( NULL AS INTEGER ) * col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT 46 AS col1 FROM tab0 GROUP BY col1, col1, col0
----
46

onlyif mysql # DIV for integer division: 
query I rowsort label-3098
SELECT - col2 DIV + 23 FROM tab0 AS cor0 GROUP BY col2
----
-1
-1
-3

skipif mysql # not compatible
query I rowsort label-3098
SELECT - col2 / + 23 FROM tab0 AS cor0 GROUP BY col2
----
-1
-1
-3

query I rowsort
SELECT ALL + 72 * + + 43 FROM tab1 AS cor0 WHERE - col1 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT - col2 - + - 19 + + 0 AS col0 FROM tab2 GROUP BY col2, col2
----
-39
-60
-68

onlyif mysql # DIV for integer division: 
query I rowsort label-3101
SELECT col0 DIV - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3101
SELECT col0 / - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-3102
SELECT + col2 * col2 DIV 68 FROM tab2 GROUP BY col2
----
111
49
91

skipif mysql # not compatible
query I rowsort label-3102
SELECT + col2 * col2 / 68 FROM tab2 GROUP BY col2
----
111
49
91

query I rowsort
SELECT DISTINCT col2 * + col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query II rowsort
SELECT ALL + col2, ( + col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT 65 NOT BETWEEN - col0 + - col1 AND 78 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT ALL ( + 96 ) * - col2 * + 47 FROM tab1 AS cor0 GROUP BY col0, col2
----
-203040
-320352
-36096

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3106
SELECT + 11 * - - 1 * col0 + 8 / col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( CAST( NULL AS SIGNED ) ) <= ( NULL )
----

skipif mysql # not compatible
query I rowsort label-3106
SELECT + 11 * - - 1 * col0 + 8 / col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( CAST ( NULL AS INTEGER ) ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT + col0 * - + col0 AS col2 FROM tab1 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col0 * - col0 + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-476
-6653
-739

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT 76 FROM tab1 GROUP BY col2 HAVING NOT ( + ( 56 ) ) IS NULL
----
76
76
76

query I rowsort
SELECT - - col2 FROM tab1 WHERE NOT col2 IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL col2 + + + 59 FROM tab1 GROUP BY col2
----
104
130
67

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3114
SELECT - CAST( NULL AS DECIMAL ) FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3114
SELECT - CAST ( NULL AS REAL ) FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + + 27 FROM tab1 AS cor0 GROUP BY col0
----
27
27
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3116
SELECT - CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col1 HAVING ( col2 ) >= NULL
----

skipif mysql # not compatible
query I rowsort label-3116
SELECT - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col1 HAVING ( col2 ) >= NULL
----

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - 69 FROM tab2 GROUP BY col2, col1 HAVING + col1 IS NOT NULL
----
-69
-69
-69

query I rowsort
SELECT - - ( + col0 ) FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + + col0 col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT + 47 * - col2 AS col1 FROM tab0 GROUP BY col2, col0, col0 HAVING NULL IS NULL
----
-1128
-1786
-3713

query I rowsort
SELECT + col0 * + 69 FROM tab2 GROUP BY col0, col2, col1
----
1035
6279
6348

query I rowsort
SELECT DISTINCT + col0 + + - 85 AS col2 FROM tab1 AS cor0 WHERE NOT NULL NOT IN ( col0 + - - col1 * + + 46 * + col2 * - - 30 ) GROUP BY col0
----

query I rowsort
SELECT - - ( + - 68 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-68
-68
-68

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT + - col2 * - col1 + + + 74 IS NULL
----
0
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT - ( AVG ( DISTINCT 16 ) ) * + + col1 FROM tab1 GROUP BY col0, col1 HAVING NOT ( - AVG ( - 94 ) ) IS NOT NULL
----

query I rowsort
SELECT ALL col0 - - - col0 FROM tab2 GROUP BY col0, col0
----
0
0
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3130
SELECT DISTINCT 25 FROM tab1 GROUP BY col0 HAVING NOT ( - 93 + + CAST( NULL AS DECIMAL ) ) NOT BETWEEN - COALESCE ( - COALESCE ( + col0, 71, 16 ), + - ( + 83 ) ) AND - 38
----

skipif mysql # not compatible
query I rowsort label-3130
SELECT DISTINCT 25 FROM tab1 GROUP BY col0 HAVING NOT ( - 93 + + CAST ( NULL AS REAL ) ) NOT BETWEEN - COALESCE ( - COALESCE ( + col0, 71, 16 ), + - ( + 83 ) ) AND - 38
----

query I rowsort
SELECT ALL - - col2 + - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - - ( - + 69 ) IS NOT NULL
----
142
16
90

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( col0 ) GROUP BY col2, col2
----

query I rowsort
SELECT ( - + col2 ) AS col0 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 37 col0 FROM tab2 GROUP BY col2
----
37
37
37

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE + col0 IS NULL GROUP BY col1 HAVING + col1 NOT BETWEEN NULL AND + 33
----

query I rowsort
SELECT ALL + 82 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-10
-9
67

query I rowsort
SELECT - ( - - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= - col0 - col0 * + col0 * - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 * - - col0 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
1849
676
6889

query I rowsort
SELECT ALL 50 FROM tab2 AS cor0 GROUP BY col2, col0
----
50
50
50

query I rowsort
SELECT ALL - 38 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-38
-38
-38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * + + col2 col2 FROM tab1 GROUP BY col2 HAVING NULL BETWEEN NULL AND - 27
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3142
SELECT ALL - 67 + + col0 DIV - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-67
-68
-70

skipif mysql # not compatible
query I rowsort label-3142
SELECT ALL - 67 + + col0 / - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-67
-68
-70

query I rowsort
SELECT 91 FROM tab0 GROUP BY col0
----
91
91
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 * col0 - - col0 col0 FROM tab1 AS cor0 WHERE NOT - NULLIF ( + col0, - 66 + + - col1 ) IS NULL GROUP BY col0
----
-462
-6642
-756

query II rowsort
SELECT ALL col2, + 28 * - + 86 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <= col2 / - - col2 GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT + - 21 + 28 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL > NULL
----

query II rowsort
SELECT DISTINCT - 79 AS col0, 43 + + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 AS col0, col0 * - - 85 * col0 FROM tab0 GROUP BY col0, col0
----
26
57460
43
157165
83
585565

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3149
SELECT DISTINCT + - 82 * CAST( - 55 AS SIGNED ) * - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-117260
-193930
-374330

skipif mysql # not compatible
query I rowsort label-3149
SELECT DISTINCT + - 82 * CAST ( - 55 AS INTEGER ) * - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-117260
-193930
-374330

query I rowsort
SELECT 7 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1 HAVING col1 < - AVG ( - col0 )
----

query I rowsort
SELECT DISTINCT 78 AS col1 FROM tab1 GROUP BY col1
----
78

query II rowsort
SELECT ALL - - col2, - col2 / - 12 FROM tab2 AS cor0 WHERE - col1 BETWEEN NULL AND + + 56 * + 46 / + + 47 / + 2 + - col1 GROUP BY col2
----

query I rowsort
SELECT col2 * - - 49 AS col1 FROM tab1 GROUP BY col2
----
2205
3479
392

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 41 + + col2 col0 FROM tab1 GROUP BY col2 HAVING + 55 BETWEEN col2 AND NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - ( + ( - + ( - + col2 ) ) ) AS col2 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col0, col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col0 * - col2 * + 85 * col0 FROM tab1 GROUP BY col0, col2, col0
----
2998800
329120
40579340

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 9 col0 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
9

query II rowsort
SELECT ALL ( + col2 ) AS col0, - ( col2 ) AS col0 FROM tab1 GROUP BY col1, col2
----
45
-45
71
-71
8
-8

query I rowsort
SELECT 53 FROM tab1 GROUP BY col1
----
53
53
53

query I rowsort
SELECT DISTINCT 0 FROM tab0 AS cor0 GROUP BY col2
----
0

query II rowsort
SELECT - col2 AS col0, 67 FROM tab2 cor0 GROUP BY col2, col1
----
-58
67
-79
67
-87
67

query I rowsort
SELECT ALL - 71 - + + 85 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-156
-156
-156

query I rowsort
SELECT DISTINCT col0 + + col0 + ( - col0 ) FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + col1 * - 81 AS col2 FROM tab2 GROUP BY col1
----
-3321
-4779
-4941

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3168
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT col2 + + ( - + col2 ) BETWEEN col0 AND - CAST( - col0 AS DECIMAL ) * - col2 - + - 54 + + + col1 * - col0 GROUP BY col2, col2, col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-3168
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT col2 + + ( - + col2 ) BETWEEN col0 AND - CAST ( - col0 AS REAL ) * - col2 - + - 54 + + + col1 * - col0 GROUP BY col2, col2, col0
----
22
28
82

query I rowsort
SELECT ALL - 77 - - col0 AS col0 FROM tab0 GROUP BY col0, col0, col2
----
-34
-51
6

query I rowsort
SELECT + col0 * - 15 * + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-100860
-11760
-7260

query I rowsort
SELECT + col2 + - 85 / + - col1 + col2 + - - 47 + 75 + + col2 * + 24 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING + - col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3172
SELECT CAST( NULL AS SIGNED ) + - 84 + + 70 * - 50 FROM tab1 GROUP BY col2, col2, col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3172
SELECT CAST ( NULL AS INTEGER ) + - 84 + + 70 * - 50 FROM tab1 GROUP BY col2, col2, col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col2 + - - col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL - ( col2 ) AS col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - ( + col0 ) - + 18 * + 67 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1221
-1297
-1298

query I rowsort
SELECT ALL - 40 * + col1 FROM tab0 GROUP BY col1
----
-3240
0

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 + 4 * - col0 + col2 - - col2 FROM tab1 AS cor0 WHERE - 89 IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT + 55 FROM tab2 WHERE NOT - - 85 IS NULL GROUP BY col1
----
55
55
55

query II rowsort
SELECT + col1 * + 86, col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
6966
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab2 AS cor0 WHERE NOT NULL <> ( NULL ) GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT 64 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
64
64
64

query I rowsort
SELECT DISTINCT 78 AS col1 FROM tab2 GROUP BY col0, col0
----
78

query I rowsort
SELECT col1 * + col1 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
6561

query I rowsort
SELECT ALL + 50 - 71 + col2 * + 28 * - 85 * + col2 FROM tab0 GROUP BY col2
----
-1370901
-14853601
-3436741

query I rowsort
SELECT ALL - 56 FROM tab1 GROUP BY col2
----
-56
-56
-56

query I rowsort
SELECT DISTINCT - + 20 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col0, col1
----

query I rowsort
SELECT - 8 FROM tab0 GROUP BY col2, col2
----
-8
-8
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3190
SELECT - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3190
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT col1 AS col0, - col1 + - col0 * 24 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
-2012
57
-729
6
-534

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 29 col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
29

query I rowsort
SELECT 0 + - + col0 AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - NULLIF ( ( - 48 ), 92 ) FROM tab1 GROUP BY col1, col0, col1
----
48
48
48

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0 HAVING + + 34 IS NULL
----

query I rowsort
SELECT DISTINCT - ( col0 ) + + 20 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-144
-24
-36

query II rowsort
SELECT + col0 AS col2, col1 + + + col1 * + + 93 FROM tab2 AS cor0 WHERE 6 + 41 IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3198
SELECT - col0 / col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL >= ( CAST( NULL AS SIGNED ) + + - ( + col0 ) ) )
----

skipif mysql # not compatible
query I rowsort label-3198
SELECT - col0 / col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL >= ( CAST ( NULL AS INTEGER ) + + - ( + col0 ) ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3199
SELECT ALL col1 DIV - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3199
SELECT ALL col1 / - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 * col1 - - ( + 11 ) * col0 * - col0 col1, col2 / - - 90 - - 82 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + col2 + + - col2 * - 10 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
288
456
948

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT 55 * - col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL > NULL GROUP BY col2 HAVING NULL >= col1
----

query I rowsort
SELECT - col1 + + + 63 AS col0 FROM tab0 GROUP BY col1
----
-18
63

query I rowsort
SELECT + 36 - - - ( 35 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-3206
SELECT - col0 DIV - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3206
SELECT - col0 / - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3207
SELECT + ( - col0 ) col1, + CAST( - 16 AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-16
-91
-16
-92
-16

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3207
SELECT + ( - col0 ) col1, + CAST ( - 16 AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-16
-91
-16
-92
-16

query I rowsort
SELECT - ( - - 91 ) * + + col2 + + col2 AS col1 FROM tab1 WHERE NULL > NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL 72 * col0 FROM tab2 GROUP BY col0
----
1080
6552
6624

query II rowsort
SELECT col2 AS col0, 42 AS col0 FROM tab0 GROUP BY col2
----
24
42
38
42
79
42

query I rowsort
SELECT DISTINCT 10 FROM tab0 GROUP BY col0
----
10

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 99 col2 FROM tab2 GROUP BY col0, col2
----
99
99
99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3213
SELECT NULLIF ( CAST( NULL AS SIGNED ), + + col2 ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3213
SELECT NULLIF ( CAST ( NULL AS INTEGER ), + + col2 ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 63 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
63
63
63

query I rowsort
SELECT ALL - + col2 * - 16 - + + col2 + + + col2 - 80 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
1263
328
566

onlyif mysql # DIV for integer division: 
query I rowsort label-3216
SELECT - 37 DIV + 20 + + ( col0 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
14
90
91

skipif mysql # not compatible
query I rowsort label-3216
SELECT - 37 / + 20 + + ( col0 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
14
90
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + + 17 * + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
1547
1564
255

query I rowsort
SELECT ( - - col2 ) * - col2 FROM tab0 GROUP BY col2 HAVING NOT ( - COALESCE ( + + col2, col2 ) ) IS NOT NULL
----

query I rowsort
SELECT 61 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
152
153
76

query I rowsort
SELECT ALL - col2 + + col2 + - 88 * - 92 FROM tab2 AS cor0 WHERE - col1 * + col2 / + col1 * - col1 * + ( + COALESCE ( col2, col2 ) ) IS NOT NULL GROUP BY col2 HAVING NULL >= COALESCE ( 95, ( 81 ) )
----

query I rowsort
SELECT col0 - - - col0 FROM tab0 GROUP BY col0
----
0
0
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3223
SELECT + - ( - col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + 98 <= + - CAST( NULL AS DECIMAL ) - - 35 * + 21
----

skipif mysql # not compatible
query I rowsort label-3223
SELECT + - ( - col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + 98 <= + - CAST ( NULL AS REAL ) - - 35 * + 21
----

query I rowsort
SELECT col2 + - + 89 FROM tab0 AS cor0 GROUP BY col1, col2
----
-10
-51
-65

query I rowsort
SELECT + 41 + + + ( + + col2 ) FROM tab1 GROUP BY col2, col0
----
112
49
86

query I rowsort
SELECT + col2 + + 19 FROM tab2 GROUP BY col2, col2
----
106
77
98

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL ( - NULLIF ( + 6, + 19 ) ) + col1 FROM tab1 GROUP BY col1
----
0
38
51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + + - 37 col1 FROM tab2 AS cor0 GROUP BY col1
----
22
24
4

query I rowsort
SELECT + col2 * + col2 FROM tab2 cor0 GROUP BY col2 HAVING + 3 BETWEEN 79 * - ( + 73 ) AND col2
----
3364
6241
7569

query I rowsort
SELECT 46 FROM tab2 AS cor0 WHERE NOT - col2 < 73 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ( col0 ) FROM tab1 WHERE NULL NOT IN ( + col0 ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3233
SELECT ALL 83 + + col2 FROM tab0 GROUP BY col0, col2 HAVING NOT + CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3233
SELECT ALL 83 + + col2 FROM tab0 GROUP BY col0, col2 HAVING NOT + CAST ( NULL AS INTEGER ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3234
SELECT ALL col0 * + col2 * - col2 - CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) + col2 FROM tab0 cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3234
SELECT ALL col0 * + col2 * - col2 - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) + col2 FROM tab0 cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING 76 IS NULL
----

query II rowsort
SELECT DISTINCT col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3237
SELECT ALL - col0 AS col1, CAST( NULL AS SIGNED ) FROM tab0 WHERE col2 IS NULL GROUP BY col0
----

skipif mysql # not compatible
query II rowsort label-3237
SELECT ALL - col0 AS col1, CAST ( NULL AS INTEGER ) FROM tab0 WHERE col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab2 GROUP BY col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 * - ( + col2 ) col0 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col2 + col0 * col0 AS col1 FROM tab1 GROUP BY col1, col2, col0
----
492
6795
829

query I rowsort
SELECT ALL + 5 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ( - col0 ) FROM tab2 WHERE - ( - 90 ) * + 75 * - COALESCE ( + 1, - col1, - col0, + ( + col2 ) ) IS NOT NULL GROUP BY col0 HAVING NOT + col0 >= ( col0 )
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING 12 > - + 95
----
44
57
6

query I rowsort
SELECT - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( + 72 * col0 / + 26 ) IS NOT NULL
----
0
0
81

query I rowsort
SELECT DISTINCT col2 + - 63 FROM tab1 AS cor0 WHERE NOT NULL < NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3247
SELECT DISTINCT + col2 DIV + col2 - 50 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-49

skipif mysql # not compatible
query I rowsort label-3247
SELECT DISTINCT + col2 / + col2 - 50 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-49

query I rowsort
SELECT 24 + 15 AS col2 FROM tab2 WHERE NOT NULL > - 5 + col1 GROUP BY col0, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3249
SELECT col0 DIV col1 AS col2 FROM tab1 GROUP BY col0, col1
----
0
1
3

skipif mysql # not compatible
query I rowsort label-3249
SELECT col0 / col1 AS col2 FROM tab1 GROUP BY col0, col1
----
0
1
3

query I rowsort
SELECT - 0 + - 54 AS col1 FROM tab0 GROUP BY col2, col1
----
-54
-54
-54

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT 5 IS NULL
----
41
59
61

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 WHERE NOT ( col1 * - 22 ) IN ( + ( + col1 ) * 80 + - col2 ) GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 WHERE ( NULL ) IN ( - 21 * - col0 ) GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col2 + col2 FROM tab1 GROUP BY col2, col2
----
142
16
90

query I rowsort
SELECT DISTINCT 34 FROM tab2 GROUP BY col1, col1
----
34

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3260
SELECT + col0 AS col1 FROM tab2 GROUP BY col0 HAVING CAST( NULL AS SIGNED ) IS NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-3260
SELECT + col0 AS col1 FROM tab2 GROUP BY col0 HAVING CAST ( NULL AS INTEGER ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL + 37 FROM tab2 GROUP BY col2, col1 HAVING ( - col2 ) IS NOT NULL
----
37
37
37

query I rowsort
SELECT + 63 FROM tab0 GROUP BY col0
----
63
63
63

query I rowsort
SELECT ALL - 18 + - 13 FROM tab2 cor0 WHERE NULL NOT BETWEEN + col0 AND - col0 * - ( + col1 ) GROUP BY col1, col0 HAVING NOT NULL < 69
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + 71 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 = NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-3266
SELECT ALL CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL NOT BETWEEN ( + COALESCE ( CAST( NULL AS DECIMAL ), col1 + 63 * 7 ) ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-3266
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL NOT BETWEEN ( + COALESCE ( CAST ( NULL AS REAL ), col1 + 63 * 7 ) ) AND NULL
----

query I rowsort
SELECT 91 - - col2 * - col2 FROM tab0 WHERE NOT + CASE - col2 WHEN 98 THEN - ( + col1 ) * - col2 - + col2 * col2 END + col0 IS NOT NULL GROUP BY col2
----
-1353
-485
-6150

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT NULL >= - col2 GROUP BY col2
----

query I rowsort
SELECT ALL col2 * + + col2 - + col1 - + + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
3265
6103
7421

query I rowsort
SELECT col1 + col2 FROM tab0 GROUP BY col1, col2
----
105
38
79

query I rowsort
SELECT ALL + 71 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 59 + + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
150
151
74

query I rowsort
SELECT DISTINCT - ( - 71 ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3274
SELECT DISTINCT CAST( NULL AS SIGNED ) * - - 19 + ( + 49 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-3274
SELECT DISTINCT CAST ( NULL AS INTEGER ) * - - 19 + ( + 49 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT - col1 * - + col1 AS col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3276
SELECT DISTINCT - CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3276
SELECT DISTINCT - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT + col2 - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3278
SELECT ALL - CAST( NULL AS SIGNED ) AS col1, + 38 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-3278
SELECT ALL - CAST ( NULL AS INTEGER ) AS col1, + 38 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
81

query II rowsort
SELECT 15 AS col0, + 31 + + ( col1 ) * + col1 * + + ( + ( + 49 ) ) FROM tab2 GROUP BY col1
----
15
170600
15
182360
15
82400

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3281
SELECT ALL + col2 AS col0 FROM tab0 WHERE NOT col1 BETWEEN NULL AND + CAST( NULL AS SIGNED ) + col2 + + col2 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-3281
SELECT ALL + col2 AS col0 FROM tab0 WHERE NOT col1 BETWEEN NULL AND + CAST ( NULL AS INTEGER ) + col2 + + col2 GROUP BY col2
----

query I rowsort
SELECT col1 + + - col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NOT NULL > - col1 GROUP BY col1
----

query II rowsort
SELECT + - col1 / - 55 AS col1, + 75 * 71 FROM tab0 WHERE NOT NULL <> NULL GROUP BY col2, col1 HAVING col1 <> ( - 77 )
----

query I rowsort
SELECT ALL - 77 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT - + 87 IS NULL
----
-77
-77
-77

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3287
SELECT + col1 * + 2 + col1 FROM tab0 GROUP BY col1, col1, col2 HAVING NOT + - CAST( + col2 AS SIGNED ) + + 19 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3287
SELECT + col1 * + 2 + col1 FROM tab0 GROUP BY col1, col1, col2 HAVING NOT + - CAST ( + col2 AS INTEGER ) + + 19 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 + + 82 - 24 / - + 86 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT - 7 = NULL
----

query I rowsort
SELECT DISTINCT + 78 + 91 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
169

query II rowsort
SELECT ALL - col2, - col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN col2 AND NULL
----

query I rowsort
SELECT + col0 + + col0 + - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col0 - + - col0 FROM tab1 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 + + col1 + 10 * - 81 * COALESCE ( 7, + 91 + col1 + ( + col2 ) ) + - - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT ( col1 = NULL )
----

query I rowsort
SELECT - + 63 * 7 + - - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-441
6120

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING ( ( NULL ) IS NULL )
----
24
38
79

query I rowsort
SELECT DISTINCT col1 * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3297
SELECT 83 - + col2 AS col2 FROM tab2 AS cor0 WHERE 38 - + ( + + NULLIF ( + col0, CAST( NULL AS SIGNED ) + - CAST( NULL AS SIGNED ) ) ) + - 94 IS NOT NULL GROUP BY col2
----
-4
25
4

skipif mysql # not compatible
query I rowsort label-3297
SELECT 83 - + col2 AS col2 FROM tab2 AS cor0 WHERE 38 - + ( + + NULLIF ( + col0, CAST ( NULL AS INTEGER ) + - CAST ( NULL AS INTEGER ) ) ) + - 94 IS NOT NULL GROUP BY col2
----
-4
25
4

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col2, col1, col1
----
-41
-59
-61

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL < 11
----

query I rowsort
SELECT DISTINCT + - col1 * - col2 + + col2 / + 65 + + col1 + - col2 + - col2 * 68 * col2 / + 72 / + 13 * - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - 3 + + 12 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
9

query I rowsort
SELECT + - ( 30 ) FROM tab1 AS cor0 GROUP BY col0
----
-30
-30
-30

query II rowsort
SELECT col1 AS col1, + col1 + + col1 * + 0 - - 22 * + col1 FROM tab2 cor0 GROUP BY col1
----
41
943
59
1357
61
1403

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3304
SELECT ALL + col1 * + 2 / + + ( - CAST( NULL AS SIGNED ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3304
SELECT ALL + col1 * + 2 / + + ( - CAST ( NULL AS INTEGER ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 + - - col0 col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3307
SELECT + - col0 FROM tab0 WHERE - + col0 BETWEEN + CAST( NULL AS SIGNED ) AND - col2 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3307
SELECT + - col0 FROM tab0 WHERE - + col0 BETWEEN + CAST ( NULL AS INTEGER ) AND - col2 GROUP BY col0
----

query I rowsort
SELECT + + col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3309
SELECT DISTINCT + col0 DIV - - 93 AS col0 FROM tab0 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-3309
SELECT DISTINCT + col0 / - - 93 AS col0 FROM tab0 GROUP BY col0
----
0

query I rowsort
SELECT ALL - + ( col2 ) AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 34 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
34
34
34

query II rowsort
SELECT DISTINCT - col2 AS col1, + col2 AS col1 FROM tab1 GROUP BY col2
----
-45
45
-71
71
-8
8

onlyif mysql # DIV for integer division: 
query I rowsort label-3314
SELECT DISTINCT + col1 DIV + + 33 FROM tab1 AS cor0 GROUP BY col1
----
0
1

skipif mysql # not compatible
query I rowsort label-3314
SELECT DISTINCT + col1 / + + 33 FROM tab1 AS cor0 GROUP BY col1
----
0
1

query I rowsort
SELECT 52 AS col0 FROM tab1 GROUP BY col2, col1
----
52
52
52

query I rowsort
SELECT ALL + - 88 * + col1 FROM tab1 cor0 GROUP BY col1
----
-3872
-5016
-528

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING 48 IS NULL
----

query I rowsort
SELECT ALL - 17 FROM tab2 GROUP BY col1
----
-17
-17
-17

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3319
SELECT + col1 / + - col2 + + + CAST( NULL AS SIGNED ) + - col2 + - col1 * 13 AS col2, + 33 * + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
NULL
-1914
NULL
-2607
NULL
-2871

skipif mysql # not compatible
query II rowsort label-3319
SELECT + col1 / + - col2 + + + CAST ( NULL AS INTEGER ) + - col2 + - col1 * 13 AS col2, + 33 * + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
NULL
-1914
NULL
-2607
NULL
-2871

onlyif mysql # DIV for integer division: 
query I rowsort label-3320
SELECT col2 DIV col0 col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col2
----
0
0
5

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3320
SELECT col2 / col0 col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col2
----
0
0
5

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3321
SELECT DISTINCT - col1 * 28 + NULLIF ( + - COALESCE ( 95, - CAST( 94 AS SIGNED ), - col1 ), AVG ( col0 ) - + 45 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1327
-1691
-263

skipif mysql # not compatible
query I rowsort label-3321
SELECT DISTINCT - col1 * 28 + NULLIF ( + - COALESCE ( 95, - CAST ( 94 AS INTEGER ), - col1 ), AVG ( col0 ) - + 45 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1327
-1691
-263

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + col1 IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT + 7 IS NULL
----
22
28
82

query I rowsort
SELECT col0 + col2 FROM tab0 GROUP BY col0, col2 HAVING + 27 + + 81 <> ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3325
SELECT ALL col0 col0 FROM tab0 WHERE NOT ( ( NOT + CAST( NULL AS SIGNED ) + col0 * + col0 = NULL ) ) GROUP BY col0 HAVING NOT + col0 >= 21
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3325
SELECT ALL col0 col0 FROM tab0 WHERE NOT ( ( NOT + CAST ( NULL AS INTEGER ) + col0 * + col0 = NULL ) ) GROUP BY col0 HAVING NOT + col0 >= 21
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3326
SELECT ALL + ( 25 ) * ( CAST( NULL AS SIGNED ) * col0 ) FROM tab1 cor0 WHERE NULL = col1 + NULLIF ( - col2, - 22 ) * col1 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3326
SELECT ALL + ( 25 ) * ( CAST ( NULL AS INTEGER ) * col0 ) FROM tab1 cor0 WHERE NULL = col1 + NULLIF ( - col2, - 22 ) * col1 GROUP BY col0
----

query I rowsort
SELECT + col1 + col1 * - ( + col1 ) + + ( - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT + 41 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab0 GROUP BY col2, col1
----
-6561
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3330
SELECT - CAST( 23 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-3330
SELECT - CAST ( 23 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3331
SELECT col2 + col2 + - - CAST( + AVG ( + + col1 ) AS SIGNED ) * col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
2610
3195
56

skipif mysql # not compatible
query I rowsort label-3331
SELECT col2 + col2 + - - CAST ( + AVG ( + + col1 ) AS INTEGER ) * col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
2610
3195
56

query II rowsort
SELECT col0 * + col0 + - col0 AS col0, col0 AS col0 FROM tab2 GROUP BY col0
----
210
15
8190
91
8372
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST( NULL AS SIGNED ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST ( NULL AS INTEGER ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

query I rowsort
SELECT + col2 * col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT 0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT + 28 * - 33 AS col2 FROM tab0 GROUP BY col0
----
-924
-924
-924

query I rowsort
SELECT DISTINCT + 66 * + col1 AS col1 FROM tab0 AS cor0 WHERE col0 IS NOT NULL GROUP BY col1
----
0
5346

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3338
SELECT 99 FROM tab2 AS cor0 WHERE NOT NULL IN ( COALESCE ( col0, NULLIF ( - CAST( + col0 AS SIGNED ), + col2 ) / - col2 ) ) GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-3338
SELECT 99 FROM tab2 AS cor0 WHERE NOT NULL IN ( COALESCE ( col0, NULLIF ( - CAST ( + col0 AS INTEGER ), + col2 ) / - col2 ) ) GROUP BY col2, col1
----

query I rowsort
SELECT + 33 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
33
33
33

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3340
SELECT ALL + CAST( NULL AS SIGNED ) * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3340
SELECT ALL + CAST ( NULL AS INTEGER ) * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3341
SELECT - col2 FROM tab1 cor0 WHERE NOT CAST( + col2 AS SIGNED ) IS NOT NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-3341
SELECT - col2 FROM tab1 cor0 WHERE NOT CAST ( + col2 AS INTEGER ) IS NOT NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL ( col2 ) + - 11 FROM tab1 AS cor0 WHERE ( + col2 + - col0 ) BETWEEN col2 + - 65 AND col1 GROUP BY col2, col1 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL + 84 + col1 * - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1597
-3397
-3637

query I rowsort
SELECT + 36 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
36
36
36

query I rowsort
SELECT ALL 12 FROM tab2 AS cor0 GROUP BY col0
----
12
12
12

query I rowsort
SELECT col0 + + 58 FROM tab1 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
140
80
86

query I rowsort
SELECT - - 10 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT col2 * + ( + AVG ( ALL col2 ) ) AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 55 * + - 53 col0 FROM tab2 GROUP BY col0
----
-2915

query I rowsort
SELECT 35 + + - ( col2 ) FROM tab1 GROUP BY col1, col2 HAVING ( NULL ) BETWEEN col1 AND 67
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3351
SELECT ALL + 12 * - - CAST( + col0 AS SIGNED ) AS col1 FROM tab0 GROUP BY col0
----
312
516
996

skipif mysql # not compatible
query I rowsort label-3351
SELECT ALL + 12 * - - CAST ( + col0 AS INTEGER ) AS col1 FROM tab0 GROUP BY col0
----
312
516
996

query I rowsort
SELECT - col2 - 42 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 78 * + 46 + + 85 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 27 FROM tab0 GROUP BY col0
----
-27
-27
-27

query I rowsort
SELECT 35 + - - 67 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
102
102
102

query I rowsort
SELECT DISTINCT col2 * - col2 * 86 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-289304
-536726
-650934

query II rowsort
SELECT 71, col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0 HAVING NULL IS NULL
----
71
58
71
79
71
87

query II rowsort
SELECT ALL - col2, - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT col2 + + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT 34 IS NULL
----
116
158
174

query I rowsort
SELECT - 72 FROM tab0 AS cor0 GROUP BY col1
----
-72
-72

onlyif mysql # DIV for integer division: 
query I rowsort label-3362
SELECT ALL - col0 DIV - + 32 + 51 FROM tab2 GROUP BY col0, col1
----
51
53
53

skipif mysql # not compatible
query I rowsort label-3362
SELECT ALL - col0 / - + 32 + 51 FROM tab2 GROUP BY col0, col1
----
51
53
53

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING + - 78 < + 30 * + CASE col2 WHEN - ( 25 ) THEN NULL WHEN 61 THEN 16 ELSE NULL END * + ( - col1 ) + + 95 - - + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 44 col0 FROM tab2 AS cor0 GROUP BY col1
----
-44
-44
-44

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 50, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL <= + - ( + - 58 ) + + + col2
----

query I rowsort
SELECT + + 54 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
54
54

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1, col0, col2
----
0
0
81

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT col0 + + col0 FROM tab2 GROUP BY col0, col0, col2
----
182
184
30

query I rowsort
SELECT col2 + 53 AS col1 FROM tab1 WHERE NOT ( 54 - col2 ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0 HAVING NOT ( - 51 ) IN ( + 12 )
----
22
28
82

query I rowsort
SELECT + col2 * col2 - + + col2 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <> NULL
----

query III rowsort
SELECT DISTINCT - 52, ( - col1 ) * - 47, + 34 * + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT + col2 * + 17 FROM tab0 GROUP BY col2
----
1343
408
646

onlyif mysql # DIV for integer division: 
query I rowsort label-3375
SELECT col0 DIV + 82 FROM tab0 GROUP BY col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-3375
SELECT col0 / + 82 FROM tab0 GROUP BY col0
----
0
0
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3376
SELECT ALL col2 + - col2 * col2 AS col0 FROM tab1 AS cor0 WHERE NOT + CAST( NULL AS SIGNED ) IS NULL GROUP BY col2 HAVING NOT 57 IS NOT NULL AND NOT + col2 <> NULL
----

skipif mysql # not compatible
query I rowsort label-3376
SELECT ALL col2 + - col2 * col2 AS col0 FROM tab1 AS cor0 WHERE NOT + CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2 HAVING NOT 57 IS NOT NULL AND NOT + col2 <> NULL
----

query I rowsort
SELECT + ( - ( + col2 ) ) AS col0 FROM tab1 WHERE NOT NULL NOT BETWEEN + 67 + - + ( 91 ) + - col2 + + col0 AND NULL GROUP BY col2
----

query I rowsort
SELECT + 98 AS col0 FROM tab1 GROUP BY col2
----
98
98
98

query I rowsort
SELECT col2 - + 85 AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3380
SELECT DISTINCT - CAST( - col0 AS SIGNED ) * col0 + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-3380
SELECT DISTINCT - CAST ( - col0 AS INTEGER ) * col0 + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT 36 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NOT 67 / - 4 IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col1 HAVING NOT - - 77 IS NULL
----
26
43
83

query I rowsort
SELECT 0 AS col2 FROM tab1 GROUP BY col2, col1
----
0
0
0

query II rowsort
SELECT DISTINCT 11 + 37 AS col0, col2 AS col0 FROM tab1 GROUP BY col2
----
48
45
48
71
48
8

query II rowsort
SELECT DISTINCT + col2 + - + col1, col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 97 / - + col2 FROM tab2 AS cor0 WHERE - 63 * col2 BETWEEN + col1 AND NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL ( - 53 ) AS col1 FROM tab0 WHERE NOT - col0 IS NOT NULL GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - 78 FROM tab1 AS cor0 GROUP BY col2, col2
----
-78
-78
-78

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
-81
0

onlyif mysql # DIV for integer division: 
query I rowsort label-3392
SELECT DISTINCT - - col1 DIV - col1 + - + col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-45
-58
-7

skipif mysql # not compatible
query I rowsort label-3392
SELECT DISTINCT - - col1 / - col1 + - + col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-45
-58
-7

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT - ( + 74 ) IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + 23 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING NOT - - col2 + - 33 BETWEEN NULL AND ( + + col0 )
----

query II rowsort
SELECT col1 AS col1, 4 FROM tab0 GROUP BY col1
----
0
4
81
4

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3396
SELECT DISTINCT - col2 * - ( - 99 ) + col2 * col2 AS col0, col2 * + - ( col2 ) FROM tab0 AS cor0 WHERE - col1 * - ( - 29 ) NOT IN ( - CAST( NULL AS SIGNED ) ) GROUP BY col2
----

skipif mysql # not compatible
query II rowsort label-3396
SELECT DISTINCT - col2 * - ( - 99 ) + col2 * col2 AS col0, col2 * + - ( col2 ) FROM tab0 AS cor0 WHERE - col1 * - ( - 29 ) NOT IN ( - CAST ( NULL AS INTEGER ) ) GROUP BY col2
----

query I rowsort
SELECT - col0 * - + col0 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 60 IS NULL
----
506
6806
812

query I rowsort
SELECT DISTINCT - - col1 * + col1 FROM tab2 AS cor0 WHERE NOT col0 > NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NOT NULL IS NOT NULL )
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 52 * + col2 + - col2 col0, + col1 * - col1 FROM tab0 GROUP BY col1, col2
----
1224
-6561
1938
0
4029
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT - col0 + - 42 AS col2 FROM tab1 GROUP BY col0, col1
----
-124
-64
-70

query I rowsort
SELECT - 36 FROM tab0 GROUP BY col2
----
-36
-36
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - + 87 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-87
-87
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 28 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
28
28
28

query I rowsort
SELECT ( - col2 ) FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ( + 22 ) + + 19 FROM tab2 GROUP BY col2, col1
----
41
41
41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3409
SELECT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3409
SELECT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - ( + + 42 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-42

query II rowsort
SELECT DISTINCT 57 + - col1 - + 25, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1, col1
----
-27
59
-29
61
-9
41

query I rowsort
SELECT ALL - 36 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-36
-36
-36

query I rowsort
SELECT - 23 FROM tab1 WHERE NOT col0 NOT BETWEEN - - col1 AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - - col1 * - + ( col1 ) FROM tab2 cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT - ( + ( - + col0 ) ) + - 53 - + 6 FROM tab0 GROUP BY col2, col0
----
-16
-33
24

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT - 85 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3417
SELECT ALL - + col1 - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3417
SELECT ALL - + col1 - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING col0 + + 73 <> NULL
----

query I rowsort
SELECT + 7 * 25 FROM tab0 GROUP BY col1
----
175
175

query I rowsort
SELECT + col1 * - 55 * 37 * - + 41 * + - col1 - - - col1 FROM tab2 GROUP BY col1
----
-140254276
-290437294
-310461696

query I rowsort
SELECT DISTINCT ( - - col0 ) FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + 30 FROM tab2 AS cor0 GROUP BY col0
----
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + ( + - col2 ) col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT + 46 FROM tab0 AS cor0 GROUP BY col1, col1
----
46
46

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + COALESCE ( + 52, + 43 ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
52

query I rowsort
SELECT DISTINCT ( + col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + 31 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 / - 55 < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3429
SELECT ALL CAST( NULL AS SIGNED ), col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-3429
SELECT ALL CAST ( NULL AS INTEGER ), col2 AS col0 FROM tab0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3430
SELECT + + ( + - col2 ), col2 AS col1 FROM tab2 WHERE NOT ( col1 ) + + ( + CAST( NULL AS DECIMAL ) ) * 56 <= NULL GROUP BY col2 HAVING ( NULL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-3430
SELECT + + ( + - col2 ), col2 AS col1 FROM tab2 WHERE NOT ( col1 ) + + ( + CAST ( NULL AS REAL ) ) * 56 <= NULL GROUP BY col2 HAVING ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 25 col2 FROM tab1 GROUP BY col2 HAVING NOT - - 94 IS NOT NULL
----

query I rowsort
SELECT + col1 - col1 + + col1 AS col1 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 WHERE NOT NULL <= + 48 * + + 99 * + + col2 * + 45 GROUP BY col0 HAVING NOT + col0 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT + 38, + COALESCE ( - - COALESCE ( - 46, + - col1 ), + 74 ) AS col0 FROM tab2 GROUP BY col0
----
38
-46

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT + - 52 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3436
SELECT - 1 * - CAST( + col0 AS SIGNED ) AS col1 FROM tab1 GROUP BY col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-3436
SELECT - 1 * - CAST ( + col0 AS INTEGER ) AS col1 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col0, col1, col2, col0
----
41
59
61

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 WHERE + col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL > + col1
----

query I rowsort
SELECT - col2 * - col2 + - + col2 - 49 * col2 + ( - col2 ) FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2 HAVING NOT NULL <= + + col2
----

query I rowsort
SELECT ALL - 91 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING col1 IS NULL AND 26 + + col1 * - + 39 IS NOT NULL
----

query I rowsort
SELECT ALL - + 51 * - col2 + col2 AS col2 FROM tab2 AS cor0 WHERE NOT 48 * + - col2 IS NOT NULL GROUP BY col2 HAVING NOT NULL > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3443
SELECT ALL ( 19 ) FROM tab0 AS cor0 WHERE NULL BETWEEN + CAST( + col1 AS SIGNED ) + - - col0 + col2 * - 76 + col1 * - 8 / + col1 * - + col0 / - - col2 AND - col2 + col0 * + + col1 * col2 GROUP BY col2 HAVING NOT ( - ( + ( 44 ) ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3443
SELECT ALL ( 19 ) FROM tab0 AS cor0 WHERE NULL BETWEEN + CAST ( + col1 AS INTEGER ) + - - col0 + col2 * - 76 + col1 * - 8 / + col1 * - + col0 / - - col2 AND - col2 + col0 * + + col1 * col2 GROUP BY col2 HAVING NOT ( - ( + ( 44 ) ) ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT - 52 FROM tab0 GROUP BY col2
----
-52
-52
-52

query II rowsort
SELECT + 13 AS col2, col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
13
1681
13
3481
13
3721

query I rowsort
SELECT DISTINCT + 70 * + col2 + col2 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
1728
2736
5688

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3448
SELECT col1 * + col1 * - - col1 * - col1 + + col1 FROM tab1 cor0 WHERE NOT + COALESCE ( - 22, - col1 * col2 / - 73, + CAST( NULL AS SIGNED ) / + + col0 + 36 ) / + ( + col0 ) NOT IN ( - ( - ( + - col0 ) ) - - 19 ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-3448
SELECT col1 * + col1 * - - col1 * - col1 + + col1 FROM tab1 cor0 WHERE NOT + COALESCE ( - 22, - col1 * col2 / - 73, + CAST ( NULL AS INTEGER ) / + + col0 + 36 ) / + ( + col0 ) NOT IN ( - ( - ( + - col0 ) ) - - 19 ) GROUP BY col1
----

query I rowsort
SELECT - col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING + 4 NOT BETWEEN ( + 43 ) AND NULL
----
-24
-38
-79

query I rowsort
SELECT col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT - 62 <= + 54
----

query I rowsort
SELECT ALL 67 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NULL < NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col2, col2, col1
----
0
0
81

query I rowsort
SELECT ALL col0 * - col1 * - 10 FROM tab2 GROUP BY col1, col0
----
37720
53690
9150

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3454
SELECT DISTINCT CAST( + 15 AS SIGNED ) * - - col1 + - - col1 FROM tab0 GROUP BY col1
----
0
1296

skipif mysql # not compatible
query I rowsort label-3454
SELECT DISTINCT CAST ( + 15 AS INTEGER ) * - - col1 + - - col1 FROM tab0 GROUP BY col1
----
0
1296

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + - 29 * + - ( + - col0 ) + + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-2548
-2576
-420

query I rowsort
SELECT 33 * + col1 * + + 20 FROM tab1 GROUP BY col2, col1
----
29040
37620
3960

query I rowsort
SELECT ALL + - 24 FROM tab0 AS cor0 GROUP BY col0
----
-24
-24
-24

query I rowsort
SELECT ALL + 53 + 87 + - - col1 + + + 83 FROM tab1 GROUP BY col1 HAVING - - 68 IS NOT NULL
----
229
267
280

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0, col1, col2
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3461
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING ( - 21 + + - CAST( NULL AS SIGNED ) ) IS NULL
----
24
38
79

skipif mysql # not compatible
query I rowsort label-3461
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING ( - 21 + + - CAST ( NULL AS INTEGER ) ) IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 53 / + 98 col0 FROM tab2 WHERE - col2 + - + 99 NOT BETWEEN - col2 AND - col0 OR NOT + - col0 >= + col1 GROUP BY col0, col2, col1 HAVING ( 54 IS NULL )
----

query I rowsort
SELECT DISTINCT + - 52 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col1, col1
----
-52

query I rowsort
SELECT 70 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT 42 AS col0 FROM tab0 GROUP BY col0, col0
----
42

query I rowsort
SELECT DISTINCT col1 * + - 78 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-3432
-4446
-468

query I rowsort
SELECT DISTINCT + + 39 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
39

query I rowsort
SELECT + + col0 * + col0 + - - col0 AS col2 FROM tab1 cor0 WHERE 64 * - + ( 81 ) <> + 54 GROUP BY col0
----
506
6806
812

query I rowsort
SELECT + col2 * col2 * - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-13824
-493039
-54872

query I rowsort
SELECT col2 * col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT ( + - 80 ) IS NULL
----
3364
6241
7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3471
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + + 64 + + + CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3471
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + + 64 + + + CAST ( NULL AS INTEGER ) IS NULL
----

query II rowsort
SELECT 90 + + - col2 + - col2 + + - 44 * 57 * - col2, col2 FROM tab0 GROUP BY col2
----
198064
79
60234
24
95318
38

query I rowsort
SELECT ALL + 64 * + - 9 * + - col2 * + col2 FROM tab0 GROUP BY col1, col2, col0
----
331776
3594816
831744

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3474
SELECT DISTINCT + CAST( ( col0 ) AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-3474
SELECT DISTINCT + CAST ( ( col0 ) AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3476
SELECT DISTINCT col0 col0 FROM tab1 WHERE + CAST( NULL AS SIGNED ) IS NULL GROUP BY col0
----
22
28
82

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3476
SELECT DISTINCT col0 col0 FROM tab1 WHERE + CAST ( NULL AS INTEGER ) IS NULL GROUP BY col0
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3477
SELECT + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3477
SELECT + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col1 - + col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 87 AS col0 FROM tab2 WHERE NOT + col0 BETWEEN col0 / col1 AND + 53 GROUP BY col1, col2 HAVING + col1 > 30
----
87
87

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL 31 + - col2 FROM tab0 GROUP BY col2 HAVING NOT 65 + col2 >= NULL
----

query I rowsort
SELECT 51 FROM tab0 GROUP BY col0
----
51
51
51

query I rowsort
SELECT 21 FROM tab2 GROUP BY col0
----
21
21
21

query I rowsort
SELECT ALL + col1 * col1 + ( col1 + + 11 ) AS col0 FROM tab0 GROUP BY col1
----
11
6653

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3485
SELECT DISTINCT + CAST( col0 AS SIGNED ) * - 14 FROM tab2 WHERE ( + ( + col2 ) ) IS NULL GROUP BY col0 HAVING ( - 37 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3485
SELECT DISTINCT + CAST ( col0 AS INTEGER ) * - 14 FROM tab2 WHERE ( + ( + col2 ) ) IS NULL GROUP BY col0 HAVING ( - 37 ) IS NULL
----

query I rowsort
SELECT col2 - 18 * - 37 AS col0 FROM tab1 WHERE ( col1 ) > NULL GROUP BY col2
----

query I rowsort
SELECT 33 + + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
104
41
78

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3488
SELECT DISTINCT - CAST( NULL AS SIGNED ) * col1 FROM tab1 GROUP BY col1, col0, col1 HAVING ( col1 ) IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-3488
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * col1 FROM tab1 GROUP BY col1, col0, col1 HAVING ( col1 ) IS NOT NULL
----
NULL

query I rowsort
SELECT ( + 68 ) AS col2 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 60 * + + col1 * + 76 FROM tab2 GROUP BY col1
----
-186960
-269040
-278160

query I rowsort
SELECT DISTINCT + col1 + + ( - + col1 ) FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3492
SELECT + - CAST( - col2 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col2, col2 HAVING NOT + col2 IS NULL
----
58
79
87

skipif mysql # not compatible
query I rowsort label-3492
SELECT + - CAST ( - col2 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col2, col2 HAVING NOT + col2 IS NULL
----
58
79
87

query I rowsort
SELECT ALL ( - col2 ) + - - col2 - - 93 AS col0 FROM tab1 GROUP BY col2
----
93
93
93

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) <> - ( + col0 )
----

query I rowsort
SELECT DISTINCT + col1 * 26 - + + col1 AS col0 FROM tab0 GROUP BY col1
----
0
2025

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-3497
SELECT ALL + 99 DIV col2 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3497
SELECT ALL + 99 / col2 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL - 4 FROM tab2 AS cor0 GROUP BY col1, col0
----
-4
-4
-4

query I rowsort
SELECT ALL + 83 * + 16 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL >= - col1 * col1
----

query I rowsort
SELECT ALL - - col2 - - ( col1 ) + + col2 * - - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
3463
6379
7717

query I rowsort
SELECT DISTINCT - col0 / - 90 * + 58 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL < ( 29 )
----

query I rowsort
SELECT + 72 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - 12 IS NULL
----
72
72

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3503
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT CAST( 98 AS DECIMAL ) < NULL
----

skipif mysql # not compatible
query I rowsort label-3503
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT CAST ( 98 AS REAL ) < NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NOT + 40 IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL - 75 + + col0 + - col0 * col0 FROM tab1 GROUP BY col0
----
-537
-6717
-831

onlyif mysql # DIV for integer division: 
query I rowsort label-3506
SELECT col1 DIV - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-2
0
0

skipif mysql # not compatible
query I rowsort label-3506
SELECT col1 / - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-2
0
0

query I rowsort
SELECT ALL + - 0 * + 44 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col2 * - + col1 + - ( - - col2 ) FROM tab2 cor0 GROUP BY col1, col1, col2
----
2320
4582
5220

query II rowsort
SELECT ALL + + col2, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT 38 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT col1 + + 95 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
136
154
156

query I rowsort
SELECT DISTINCT - col2 * - - col2 + col2 - - col2 + - 85 * - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1136
1890
632

query I rowsort
SELECT 6 * + + col0 FROM tab0 GROUP BY col0, col2
----
156
258
498

query I rowsort
SELECT DISTINCT 9 + - 91 / + ( + col2 ) FROM tab2 AS cor0 WHERE NOT - col2 IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * - ( - - col0 ) col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL + + col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query II rowsort
SELECT 40, col0 FROM tab0 GROUP BY col0
----
40
26
40
43
40
83

query I rowsort
SELECT DISTINCT + 64 FROM tab2 AS cor0 GROUP BY col0
----
64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3520
SELECT - col2 + + 75 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING 0 + - 70 * - 71 * + CAST( NULL AS SIGNED ) + + 83 + - 86 * 43 * - 12 BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-3520
SELECT - col2 + + 75 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING 0 + - 70 * - 71 * + CAST ( NULL AS INTEGER ) + + 83 + - 86 * 43 * - 12 BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT + 19 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
19

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3522
SELECT + CAST( - + col0 AS SIGNED ) * + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

skipif mysql # not compatible
query I rowsort label-3522
SELECT + CAST ( - + col0 AS INTEGER ) * + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col1 * - col1 * + col1 * 3 + - col0 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - - col0 BETWEEN NULL AND ( + 4 )
----
-206763
-616137
-680943

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3524
SELECT DISTINCT + col0 * + - CAST( + col0 AS SIGNED ) * - ( col0 ) + + - col0 AS col2 FROM tab1 GROUP BY col0
----
10626
21924
551286

skipif mysql # not compatible
query I rowsort label-3524
SELECT DISTINCT + col0 * + - CAST ( + col0 AS INTEGER ) * - ( col0 ) + + - col0 AS col2 FROM tab1 GROUP BY col0
----
10626
21924
551286

query I rowsort
SELECT ALL + - col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
-58
-79
-87

onlyif mysql # DIV for integer division: 
query I rowsort label-3526
SELECT col1 - - + col1 DIV + 15 AS col1 FROM tab1 GROUP BY col1
----
46
6
60

skipif mysql # not compatible
query I rowsort label-3526
SELECT col1 - - + col1 / + 15 AS col1 FROM tab1 GROUP BY col1
----
46
6
60

query I rowsort
SELECT DISTINCT + col0 + - + ( + + col0 ) + - 5 FROM tab0 GROUP BY col0
----
-5

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 85 col2 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
85
85
85

query I rowsort
SELECT DISTINCT 67 FROM tab2 GROUP BY col0
----
67

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL ( - - col2 ) AS col1 FROM tab1 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 col1, 78 - - col0 - 65 + - + 50 * - + ( col2 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
26
3989
43
1256
83
1996

query II rowsort
SELECT + col1, col1 * 76 + + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
3157
59
4543
61
4697

query I rowsort
SELECT DISTINCT - 8 + 50 + ( - + 16 ) * col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-1254
42

query I rowsort
SELECT + 93 - col2 + + - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-57
-77
-9

query I rowsort
SELECT + ( + + col0 ) AS col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT ( col0 ) - + + col0 FROM tab0 AS cor0 GROUP BY col0
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3538
SELECT - CAST( NULL AS SIGNED ) + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3538
SELECT - CAST ( NULL AS INTEGER ) + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-3540
SELECT ALL 1 * - col0 * 88 * - - 84 - + col0 + col2 + - col2 + - NULLIF ( - ( + - col2 ), + - col0 ) * col0 DIV COALESCE ( + 51, CAST( + 13 AS SIGNED ) ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-192258
-317919
-613680

skipif mysql # not compatible
query I rowsort label-3540
SELECT ALL 1 * - col0 * 88 * - - 84 - + col0 + col2 + - col2 + - NULLIF ( - ( + - col2 ), + - col0 ) * col0 / COALESCE ( + 51, CAST ( + 13 AS INTEGER ) ) FROM tab0 AS cor0 GROUP BY col2, col0
----
-192258
-317919
-613680

query I rowsort
SELECT 88 AS col1 FROM tab2 AS cor0 WHERE NOT + col0 * - col1 BETWEEN - col2 + - COALESCE ( 40, + 88 ) AND - col1 / - + 54 + + + col2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
88
88
88

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT - 87 + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING + col1 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3544
SELECT + ( + CAST( NULL AS SIGNED ) ) + + + ( 10 ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3544
SELECT + ( + CAST ( NULL AS INTEGER ) ) + + + ( 10 ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + + 17 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
17
17
17

query I rowsort
SELECT ALL ( - ( col2 ) ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-3547
SELECT DISTINCT col1 + - col1 DIV + 91 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-3547
SELECT DISTINCT col1 + - col1 / + 91 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + 44 FROM tab2 GROUP BY col0
----
44

query I rowsort
SELECT - col2 * 74 * + ( - col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
149850
373034
4736

query I rowsort
SELECT DISTINCT + ( + - 94 ) FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - AVG ( DISTINCT + col2 ) * 72 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3551
SELECT + - 69 * + col2 + - col2 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN + col1 - - CAST( + + 34 AS SIGNED ) AND - 46 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-3551
SELECT + - 69 * + col2 + - col2 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN + col1 - - CAST ( + + 34 AS INTEGER ) AND - 46 GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + col0 IS NULL
----
26
43
83

query I rowsort
SELECT + - 83 * - - 36 * col1 + - NULLIF ( + col1, - col1 ) * + + ( - col1 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col1
----
-235467
NULL

query II rowsort
SELECT ALL + ( col2 ), - col2 * - 64 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
2880
71
4544
8
512

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3555
SELECT ALL col0 + + col0 col0 FROM tab2 GROUP BY col0 HAVING NOT - CAST( NULL AS DECIMAL ) > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3555
SELECT ALL col0 + + col0 col0 FROM tab2 GROUP BY col0 HAVING NOT - CAST ( NULL AS REAL ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 5 + + 33 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
38

query I rowsort
SELECT DISTINCT - + 30 FROM tab0 cor0 GROUP BY col2
----
-30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3558
SELECT DISTINCT - col2 + - CAST( NULL AS SIGNED ) * 98 * + 49 + - + col1 + - - col1 - - + ( + col1 ) * col2 * col1 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3558
SELECT DISTINCT - col2 + - CAST ( NULL AS INTEGER ) * 98 * + 49 + - + col1 + - - col1 - - + ( + col1 ) * col2 * col1 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
NULL

query I rowsort
SELECT - 99 + - COALESCE ( col0, col2, + 39 + col0 + col0 - - 42 * col0 ) + - 24 FROM tab1 AS cor0 GROUP BY col0, col2
----
-145
-151
-205

query I rowsort
SELECT col2 * + + ( - col0 ) AS col0 FROM tab2 GROUP BY col0, col2, col2
----
-1305
-5336
-7189

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2, col1
----
-81
0
0

query I rowsort
SELECT ( - 17 ) * + - col2 * - + col2 FROM tab1 cor0 GROUP BY col2
----
-1088
-34425
-85697

onlyif mysql # DIV for integer division: 
query I rowsort label-3563
SELECT DISTINCT - col1 DIV - col1 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-3563
SELECT DISTINCT - col1 / - col1 FROM tab1 GROUP BY col1
----
1

query II rowsort
SELECT - ( - col2 ) + + col2 AS col2, col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
58
158
79
174
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3565
SELECT ALL 23 * 36 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0 HAVING NULL < CAST( NULL AS SIGNED ) * + col0
----

skipif mysql # not compatible
query I rowsort label-3565
SELECT ALL 23 * 36 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0 HAVING NULL < CAST ( NULL AS INTEGER ) * + col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3566
SELECT ALL - - CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3566
SELECT ALL - - CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col2 * + + NULLIF ( - 39, + col1 * - + 56 - + - col1 * col2 ) + 39 * - 30 - - col2 * + + 88 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - col2 = ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3568
SELECT - col0 DIV - 55 FROM tab0 WHERE + col1 - - - ( + col0 ) IS NOT NULL GROUP BY col1, col1, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-3568
SELECT - col0 / - 55 FROM tab0 WHERE + col1 - - - ( + col0 ) IS NOT NULL GROUP BY col1, col1, col0
----
0
0
1

query I rowsort
SELECT DISTINCT 61 AS col2 FROM tab2 GROUP BY col1, col2
----
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + - 75 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN - - col0 + 12 AND ( - 59 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3571
SELECT DISTINCT - - CAST( NULL AS SIGNED ) AS col1, col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
----

skipif mysql # not compatible
query II rowsort label-3571
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) AS col1, col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
----

query I rowsort
SELECT DISTINCT col1 - + 5 AS col0 FROM tab0 GROUP BY col1
----
-5
76

query I rowsort
SELECT 75 FROM tab0 GROUP BY col0
----
75
75
75

query II rowsort
SELECT + col2, col2 + col2 AS col1 FROM tab0 GROUP BY col2
----
24
48
38
76
79
158

query I rowsort
SELECT DISTINCT - 54 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING 41 + + 87 IS NULL
----

query I rowsort
SELECT + 82 FROM tab2 AS cor0 GROUP BY col2, col2
----
82
82
82

query I rowsort
SELECT ALL col0 + 83 FROM tab2 AS cor0 WHERE NOT col0 NOT BETWEEN + + 27 AND NULL GROUP BY col1, col0 HAVING NULL < NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3578
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING - 23 + CAST( - 9 AS DECIMAL ) < NULL
----

skipif mysql # not compatible
query I rowsort label-3578
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING - 23 + CAST ( - 9 AS REAL ) < NULL
----

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col0 HAVING + + ( - ( - col0 ) ) > - col2
----
58
79
87

query I rowsort
SELECT ALL ( - col2 ) FROM tab1 cor0 WHERE ( + ( 86 ) ) > ( 47 ) GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL col1 FROM tab0 WHERE NOT + + col1 >= ( NULL ) GROUP BY col1 HAVING ( 0 ) IS NULL
----

query I rowsort
SELECT 41 FROM tab0 GROUP BY col0, col0
----
41
41
41

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + 94 <= ( - col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 57, - ( + col1 ) col0 FROM tab2 GROUP BY col2, col1
----
-57
-41
-57
-59
-57
-61

query I rowsort
SELECT + 79 * - col1 AS col0 FROM tab1 GROUP BY col2, col1
----
-3476
-4503
-474

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col2 * col1 col1 FROM tab2 GROUP BY col2, col1 HAVING 0 IS NOT NULL
----
-274999
-323727
-97498

query I rowsort
SELECT 36 FROM tab1 GROUP BY col2, col1
----
36
36
36

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3589
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST( + col1 AS SIGNED ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3589
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST ( + col1 AS INTEGER ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

query I rowsort
SELECT ALL + NULLIF ( + col0, + 41 ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT 66 + - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3592
SELECT - - 67 + - + col1 AS col0, CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-14
NULL
67
NULL

skipif mysql # not compatible
query II rowsort label-3592
SELECT - - 67 + - + col1 AS col0, CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-14
NULL
67
NULL

query I rowsort
SELECT + ( - 76 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-76
-76
-76

query I rowsort
SELECT ALL 19 FROM tab2 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1 HAVING NOT ( - col1 ) < ( NULL )
----

query I rowsort
SELECT ALL - + 1 + col0 / col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 61 + 75 IS NOT NULL
----

query I rowsort
SELECT 82 FROM tab2 WHERE NULL <= + col0 GROUP BY col1
----

query I rowsort
SELECT - col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND 95
----

query I rowsort
SELECT ALL + 10 - + 63 FROM tab1 GROUP BY col2
----
-53
-53
-53

query I rowsort
SELECT - 8 FROM tab0 AS cor0 GROUP BY col1 HAVING ( + AVG ( + col2 ) * + 10 - - col1 ) <= ( + 63 )
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - ( + 21 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 col2 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 10 AS col2 FROM tab0 GROUP BY col0
----
10
10
10

query I rowsort
SELECT col0 - - col0 FROM tab0 AS cor0 WHERE col2 IS NOT NULL GROUP BY col0
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 17 col2 FROM tab2 cor0 GROUP BY col1, col2
----
-17
-17
-17

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING 27 * - 22 + + col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 * - col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
132
1596
3608

query I rowsort
SELECT DISTINCT + col1 - 23 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
-23
58

query I rowsort
SELECT ALL - col1 / - + ( - col1 ) FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) NOT IN ( - col1 )
----

query I rowsort
SELECT 26 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NULL
----
26
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col0, col1 col2 FROM tab0 cor0 GROUP BY col1, col0 HAVING col1 <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * 28 col2 FROM tab2 AS cor0 WHERE NOT col2 + + col2 IS NULL GROUP BY col0, col0
----
2548
2576
420

query I rowsort
SELECT ALL 89 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
89
89
89

query II rowsort
SELECT DISTINCT - 19 AS col2, col1 * + - ( - col1 ) FROM tab1 cor0 GROUP BY col1
----
-19
1936
-19
3249
-19
36

query I rowsort
SELECT DISTINCT 79 * col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0 HAVING NOT col2 IN ( col2 + col2 )
----
1738
2212
6478

query I rowsort
SELECT 59 * - ( + col2 ) + col2 FROM tab0 GROUP BY col2
----
-1392
-2204
-4582

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ( 43 ) + col0 + - 41 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL = NULL
----

query I rowsort
SELECT 93 FROM tab0 GROUP BY col2, col2
----
93
93
93

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3619
SELECT - col2 * - CAST( NULL AS SIGNED ), ( + + 19 ) col1 FROM tab0 GROUP BY col2 HAVING ( NULL ) = ( col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3619
SELECT - col2 * - CAST ( NULL AS INTEGER ), ( + + 19 ) col1 FROM tab0 GROUP BY col2 HAVING ( NULL ) = ( col1 )
----

query I rowsort
SELECT + col1 FROM tab2 WHERE ( + ( + 37 ) ) >= NULL GROUP BY col1, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3621
SELECT - - 54 * - col1 + - col0 + col1 + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3621
SELECT - - 54 * - col1 + - col0 + col1 + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3622
SELECT col2 * + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3622
SELECT col2 * + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3623
SELECT - col1 * col1 + - 76 FROM tab2 GROUP BY col1 HAVING - - CAST( + col1 AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-3623
SELECT - col1 * col1 + - 76 FROM tab2 GROUP BY col1 HAVING - - CAST ( + col1 AS REAL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3624
SELECT ALL 0 * + ( CAST( NULL AS SIGNED ) ) - 14 FROM tab0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3624
SELECT ALL 0 * + ( CAST ( NULL AS INTEGER ) ) - 14 FROM tab0 GROUP BY col0, col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3625
SELECT + 12 FROM tab2 AS cor0 WHERE col0 + + + CAST( 60 AS SIGNED ) BETWEEN 25 AND NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3625
SELECT + 12 FROM tab2 AS cor0 WHERE col0 + + + CAST ( 60 AS INTEGER ) BETWEEN 25 AND NULL GROUP BY col0
----

query I rowsort
SELECT col1 + ( + 49 ) FROM tab1 AS cor0 GROUP BY col1
----
106
55
93

query I rowsort
SELECT DISTINCT - col2 + 46 FROM tab0 AS cor0 GROUP BY col2, col2
----
-33
22
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 + - - col1 * - - col1 AS col1, col1 col2 FROM tab1 WHERE NOT + 14 <> - - ( - 74 ) + - col2 + + - col0 + + col0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 39 AS col2 FROM tab2 GROUP BY col1 HAVING NOT + col1 > NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 3 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + + 84 * + col2 <= NULL
----

query I rowsort
SELECT DISTINCT + col0 * + 21 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
1911
1932
315

query I rowsort
SELECT - - 9 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
9
9
9

onlyif mysql # DIV for integer division: 
query II rowsort label-3634
SELECT DISTINCT col2 DIV 4 + + col2, ( - - col2 ) AS col2 FROM tab2 GROUP BY col2
----
108
87
72
58
98
79

skipif mysql # not compatible
query II rowsort label-3634
SELECT DISTINCT col2 / 4 + + col2, ( - - col2 ) AS col2 FROM tab2 GROUP BY col2
----
108
87
72
58
98
79

query I rowsort
SELECT - col0 + + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - ( + col2 ) + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT ALL - AVG ( col0 ) FROM tab2 GROUP BY col0 HAVING NULL < - col0
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 WHERE 65 IS NOT NULL GROUP BY col0, col0, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3364
-6241
-7569

query I rowsort
SELECT - - col2 * - + 24 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1392
-1896
-2088

query I rowsort
SELECT ALL + 0 AS col1 FROM tab2 GROUP BY col2 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 16 col0 FROM tab2 GROUP BY col1
----
16

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3643
SELECT + col1 * - col1 + + + CAST( NULL AS DECIMAL ) AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1 HAVING NULL = + + 72 * 92
----

skipif mysql # not compatible
query I rowsort label-3643
SELECT + col1 * - col1 + + + CAST ( NULL AS REAL ) AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1 HAVING NULL = + + 72 * 92
----

query II rowsort
SELECT DISTINCT - col0 AS col1, - col0 AS col0 FROM tab2 GROUP BY col0, col1
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT DISTINCT 21 AS col1 FROM tab1 GROUP BY col1
----
21

query I rowsort
SELECT + + 74 + - col0 AS col0 FROM tab1 WHERE NOT + + 9 - col0 * - col0 IS NULL GROUP BY col0
----
-8
46
52

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3647
SELECT DISTINCT - 64 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > + - 84 + - + CAST( col0 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3647
SELECT DISTINCT - 64 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > + - 84 + - + CAST ( col0 AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3648
SELECT + col2 + - col2 * - ( CAST( NULL AS SIGNED ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3648
SELECT + col2 + - col2 * - ( CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + 35, + col2 * - 15 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL > - col1 * + 42 * - col0 + + col2 + - col1
----

query I rowsort
SELECT - + col0 / col0 FROM tab1 AS cor0 WHERE + 44 = + - col1 GROUP BY col1, col0, col1 HAVING NOT ( NULL ) NOT BETWEEN 61 AND ( NULL )
----

query I rowsort
SELECT DISTINCT - + 75 * - 17 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
1275

query II rowsort
SELECT DISTINCT col0, - 1 FROM tab1 GROUP BY col0
----
22
-1
28
-1
82
-1

query I rowsort
SELECT DISTINCT + - 84 * col2 + - 72 FROM tab0 AS cor0 GROUP BY col2
----
-2088
-3264
-6708

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3654
SELECT ALL + col1 * col1 + - + CAST( + + col1 AS SIGNED ) AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <= col1
----

skipif mysql # not compatible
query I rowsort label-3654
SELECT ALL + col1 * col1 + - + CAST ( + + col1 AS INTEGER ) AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <= col1
----

query I rowsort
SELECT DISTINCT 10 FROM tab0 GROUP BY col1, col0, col1 HAVING ( + col0 IS NOT NULL )
----
10

query I rowsort
SELECT col0 + col0 AS col1 FROM tab1 GROUP BY col0
----
164
44
56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3657
SELECT + col1 * - col0 * + - ( CAST( + - col1 AS SIGNED ) ) FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT + 78 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3657
SELECT + col1 * - col0 * + - ( CAST ( + - col1 AS INTEGER ) ) FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT + 78 IS NOT NULL
----

query I rowsort
SELECT ALL 24 FROM tab0 GROUP BY col2, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + ( - col1 ) * ( - col1 ) + + col1 FROM tab0 GROUP BY col1
----
0
6642

query II rowsort
SELECT DISTINCT - col1, - col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
-81
0
0

query I rowsort
SELECT + col2 * + + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT DISTINCT - 24 * + col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1 HAVING + col1 >= - 31
----
-1056
-1368
-144

query I rowsort
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - - 63 IS NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT AVG ( + col0 ) col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - col0 <= - col0
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3665
SELECT DISTINCT + col2 + CAST( NULL AS DECIMAL ) AS col0 FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3665
SELECT DISTINCT + col2 + CAST ( NULL AS REAL ) AS col0 FROM tab0 GROUP BY col2
----
NULL

query I rowsort
SELECT DISTINCT + 93 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
93

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 16 / col1 col2 FROM tab1 AS cor0 WHERE NOT ( + col2 IN ( - col0 * - 77 ) ) GROUP BY col1 HAVING NOT ( NULL ) NOT IN ( + col2 - col2 )
----

query I rowsort
SELECT + + 12 FROM tab1 AS cor0 GROUP BY col1 HAVING - + 73 <= ( + ( col1 ) )
----
12
12
12

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NOT - COALESCE ( - col0, - + 66 ) < - 67 * col0 )
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 GROUP BY col2, col2 HAVING NOT col2 IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-3671
SELECT + col2 DIV + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3671
SELECT + col2 / + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT - 83 + - 98 * col1 AS col0 FROM tab0 GROUP BY col1, col1
----
-8021
-83

query I rowsort
SELECT ( - col2 ) + - - 42 FROM tab1 GROUP BY col2, col2
----
-29
-3
34

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3675
SELECT DISTINCT + 16 - + CAST( col1 AS SIGNED ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-25
-43
-45

skipif mysql # not compatible
query I rowsort label-3675
SELECT DISTINCT + 16 - + CAST ( col1 AS INTEGER ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-25
-43
-45

query II rowsort
SELECT ALL ( - 81 ), - 16 * - col2 + - 88 AS col2 FROM tab1 GROUP BY col2
----
-81
1048
-81
40
-81
632

query I rowsort
SELECT - 78 FROM tab2 GROUP BY col1
----
-78
-78
-78

query I rowsort
SELECT DISTINCT + - 37 AS col0 FROM tab0 AS cor0 WHERE NOT col0 >= + - 94 GROUP BY col0 HAVING 32 IS NULL
----

query I rowsort
SELECT ALL - col1 + + - 82 + + + 17 * + col1 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
-82
1214

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING ( + 87 ) IS NOT NULL
----
-22
-28
-82

query II rowsort
SELECT ALL COALESCE ( + 39, - 34 ) AS col1, col2 - + - 68 - - + col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL NOT BETWEEN ( NULL ) AND col2
----

query I rowsort
SELECT ALL ( - - col1 ) FROM tab2 GROUP BY col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3683
SELECT DISTINCT col0 * - 56 FROM tab0 WHERE NOT col2 * CAST( col0 AS SIGNED ) = 70 GROUP BY col2, col0, col2 HAVING NOT - col2 BETWEEN ( NULL ) AND CAST( + 82 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3683
SELECT DISTINCT col0 * - 56 FROM tab0 WHERE NOT col2 * CAST ( col0 AS INTEGER ) = 70 GROUP BY col2, col0, col2 HAVING NOT - col2 BETWEEN ( NULL ) AND CAST ( + 82 AS INTEGER )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3684
SELECT col2 + col2 + col2 DIV col2 FROM tab0 GROUP BY col2, col2 HAVING NOT 98 IN ( - 82 )
----
159
49
77

skipif mysql # not compatible
query I rowsort label-3684
SELECT col2 + col2 + col2 / col2 FROM tab0 GROUP BY col2, col2 HAVING NOT 98 IN ( - 82 )
----
159
49
77

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3685
SELECT DISTINCT - CAST( NULL AS SIGNED ) * - 56 FROM tab1 WHERE NOT ( col2 ) IN ( ( - col2 ) ) GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3685
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * - 56 FROM tab1 WHERE NOT ( col2 ) IN ( ( - col2 ) ) GROUP BY col2
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + + col2 col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
158
48
76

query I rowsort
SELECT ALL - 73 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <> ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3688
SELECT CAST( 59 AS SIGNED ) FROM tab1 AS cor0 WHERE NOT ( col0 ) BETWEEN 22 AND ( NULL ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3688
SELECT CAST ( 59 AS INTEGER ) FROM tab1 AS cor0 WHERE NOT ( col0 ) BETWEEN 22 AND ( NULL ) GROUP BY col0
----

query I rowsort
SELECT + - 80 FROM tab1 AS cor0 GROUP BY col1
----
-80
-80
-80

query I rowsort
SELECT ALL 6 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
270
426
48

query I rowsort
SELECT + ( - col0 ) AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL 14 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-30
-43
8

query I rowsort
SELECT DISTINCT + 56 FROM tab1 cor0 WHERE NOT col0 IS NULL GROUP BY col0 HAVING NOT ( + 90 * - 29 ) <= col0
----

query I rowsort
SELECT ALL + 54 AS col2 FROM tab2 GROUP BY col2, col0
----
54
54
54

query I rowsort
SELECT - 53 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + ( + 48 ) + - - 94 + + 86 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
2034
2550
7194

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 * - col1 * - COALESCE ( 30, 14, - col0 + 5 ) FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - 12 AS col1 FROM tab0 GROUP BY col2
----
-12
-12
-12

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3699
SELECT CAST( NULL AS SIGNED ) / col0 + + + col0 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3699
SELECT CAST ( NULL AS INTEGER ) / col0 + + + col0 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 50 * col0 FROM tab2 GROUP BY col1, col0
----
-4550
-4600
-750

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST( - col2 AS SIGNED ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST ( - col2 AS INTEGER ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 + - col2 * col1 FROM tab1 GROUP BY col2, col1
----
-2622
-3168
-54

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 31 col2 FROM tab2 cor0 GROUP BY col1, col2
----
31

query I rowsort
SELECT col0 * 12 - 93 AS col2 FROM tab1 GROUP BY col0
----
171
243
891

query I rowsort
SELECT 55 AS col1 FROM tab0 GROUP BY col2, col2, col1 HAVING + col1 + - col2 NOT IN ( 90 )
----
55
55
55

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 GROUP BY col0 HAVING ( 67 ) + 86 * 3 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NOT 99 * col2 <= + 21 - 65 * col0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT - 85 - + col2 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-130
-156
-93

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + 58 * + ( col0 * 4 ) col1 FROM tab0 GROUP BY col0 HAVING ( NULL ) IN ( col1 - - 68 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3711
SELECT - CAST( 70 AS SIGNED ) / + col2 FROM tab1 WHERE NOT ( 46 ) IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-3711
SELECT - CAST ( 70 AS INTEGER ) / + col2 FROM tab1 WHERE NOT ( 46 ) IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT - 77 - col0 AS col2 FROM tab0 GROUP BY col0 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 tab0 AS cor0 GROUP BY col0 HAVING ( col1 ) <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3714
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= + 43
----

skipif mysql # not compatible
query I rowsort label-3714
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST ( NULL AS INTEGER ) ) <= + 43
----

query I rowsort
SELECT - - 84 + - col1 * - col1 FROM tab2 WHERE - + 77 IN ( col2, - col0, - 32 + 95 * - col2 * - - col1 / + - 44 ) GROUP BY col1, col1 HAVING 31 <> NULL
----

query I rowsort
SELECT DISTINCT 50 FROM tab0 GROUP BY col2, col2
----
50

query I rowsort
SELECT ALL + 55 FROM tab1 GROUP BY col2, col2
----
55
55
55

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 cor0 WHERE col0 + col0 * col2 * NULLIF ( col1, + col0 ) IS NOT NULL GROUP BY col1
----
44
57
6

query II rowsort
SELECT DISTINCT 29, + ( + - 84 ) AS col2 FROM tab0 AS cor0 GROUP BY col1, col1, col1, col1 HAVING + col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 57 FROM tab2 WHERE NOT col1 IS NULL GROUP BY col2
----
57
57
57

query I rowsort
SELECT DISTINCT 88 * - col2 FROM tab1 GROUP BY col2
----
-3960
-6248
-704

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + ( col2 ) - col2, + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT 99 IS NOT NULL
----

query I rowsort
SELECT col2 + col2 AS col1 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT + col2 + + + col2 AS col0 FROM tab0 AS cor0 WHERE NULL < NULL GROUP BY col2
----

query I rowsort
SELECT ALL 37 AS col2 FROM tab2 GROUP BY col1, col2
----
37
37
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3726
SELECT ALL CAST( + 54 AS SIGNED ) * 92 - - col1 AS col2 FROM tab1 WHERE NOT + col0 BETWEEN col1 * ( col1 ) AND NULL GROUP BY col1
----
4974
5012
5025

skipif mysql # not compatible
query I rowsort label-3726
SELECT ALL CAST ( + 54 AS INTEGER ) * 92 - - col1 AS col2 FROM tab1 WHERE NOT + col0 BETWEEN col1 * ( col1 ) AND NULL GROUP BY col1
----
4974
5012
5025

query I rowsort
SELECT ( + - 55 ) * 60 AS col2 FROM tab2 GROUP BY col1 HAVING NOT + 58 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + ( - - ( + - col2 ) ) * + + 67 - + col2 FROM tab0 GROUP BY col2
----
-1632
-2584
-5372

query I rowsort
SELECT ALL - + 68 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT 70 + + 60 - - AVG ( ALL + 35 ) IS NOT NULL
----

query II rowsort
SELECT 93 - + col2 AS col1, + 49 + col2 FROM tab0 GROUP BY col2, col1
----
14
128
55
87
69
73

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 60 col0 FROM tab2 GROUP BY col1
----
60
60
60

query I rowsort
SELECT col0 + - 47 / + - col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT - - 15 * + col1 = NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col1, col2
----
-58
-79
-87

query II rowsort
SELECT + col2 * - col1 * - - col2 + + col0 - 8, col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING NOT 98 IS NULL
----
-137840
92
-368136
91
-461702
15

query I rowsort
SELECT - 90 AS col2 FROM tab1 GROUP BY col1, col0
----
-90
-90
-90

query I rowsort
SELECT DISTINCT col1 + + + col1 * 70 + - 31 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
3093
395
4016

query I rowsort
SELECT DISTINCT - CASE - + col2 WHEN + 51 * + - ( + 67 ) THEN col2 END AS col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT 6 IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1 HAVING NOT - 87 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT ALL + 54 * - + col0 AS col0 FROM tab2 GROUP BY col0
----
-4914
-4968
-810

query I rowsort
SELECT - + 69 FROM tab1 AS cor0 GROUP BY col1
----
-69
-69
-69

onlyif mysql # DIV for integer division: 
query I rowsort label-3742
SELECT DISTINCT - 41 DIV + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-5
0

skipif mysql # not compatible
query I rowsort label-3742
SELECT DISTINCT - 41 / + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-5
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3743
SELECT + 59 FROM tab2 AS cor0 GROUP BY col2, col2, col1, col0 HAVING NOT + - 77 > + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-3743
SELECT + 59 FROM tab2 AS cor0 GROUP BY col2, col2, col1, col0 HAVING NOT + - 77 > + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 + - 33 FROM tab0 GROUP BY col2 HAVING NULL > 50
----

query I rowsort
SELECT ( - + col2 ) * - ( + 40 ) FROM tab2 GROUP BY col2, col1
----
2320
3160
3480

query I rowsort
SELECT 54 * + CASE + col2 WHEN + - 23 THEN 49 END + 87 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT - 80 AS col1 FROM tab0 GROUP BY col0, col0
----
-80
-80
-80

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE - ( - - col2 ) IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL 18 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
18
18
18

query I rowsort
SELECT ALL col2 * + - col2 AS col0 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3752
SELECT ALL ( ( + CAST( NULL AS SIGNED ) ) ) * - - 31 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3752
SELECT ALL ( ( + CAST ( NULL AS INTEGER ) ) ) * - - 31 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT 90, col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NULL
----
90
44
90
57
90
6

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + + 44 col1 FROM tab1 AS cor0 WHERE NOT ( ( - col1 * - col1 * - col1 IS NULL ) ) GROUP BY col2, col1
----
101
50
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * 21 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 + + - 51 FROM tab1 AS cor0 GROUP BY col1
----
-45
-7
6

query I rowsort
SELECT DISTINCT col0 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - 32 + + + col2 FROM tab2 GROUP BY col2
----
26
47
55

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE ( NOT NULL < NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + ( + 49 ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT + 92 IS NULL
----
49

query I rowsort
SELECT DISTINCT - CASE + col1 WHEN - 77 THEN NULL ELSE + - 90 END * - 57 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( col1 * col1 IS NOT NULL )
----
-5130

query I rowsort
SELECT + 9 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - 79 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-79
-79
-79

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 WHERE NOT 32 / 47 - + 6 IS NULL GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT col2 + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT - ( - + col1 ) + + 23 IS NULL
----
105
38
79

query I rowsort
SELECT ( col0 ) FROM tab0 GROUP BY col0, col0
----
26
43
83

query II rowsort
SELECT col1 * + 77 * - 68 AS col0, col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-214676
92
-308924
91
-319396
15

query I rowsort
SELECT 14 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING + + 4 IS NOT NULL
----
14
14
14

query I rowsort
SELECT + 66 + + - col1 * + 95 FROM tab1 AS cor0 GROUP BY col2, col1
----
-4114
-504
-5349

query I rowsort
SELECT 2 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - - AVG ( - - 79 ) IS NULL
----
2
2

query I rowsort
SELECT DISTINCT 52 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
52

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL > NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 40 < NULL
----

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 WHERE NOT - col0 / CASE col1 WHEN - col1 - col1 THEN col2 * 25 ELSE NULL END * - col0 + - 86 IS NOT NULL GROUP BY col2, col0, col1
----
22
28
82

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE - col1 * + col0 IN ( col1, + 11, + col1 ) GROUP BY col0, col1
----

query I rowsort
SELECT ALL col2 FROM tab2 cor0 WHERE NOT ( NULL IS NULL ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT ( col1 ) AS col1, col1 AS col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + + ( col2 ) FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL + + col0 + + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
164
44
56

query I rowsort
SELECT ALL 71 AS col0 FROM tab2 AS cor0 WHERE NULL >= ( NULL ) GROUP BY col1, col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3783
SELECT ALL + col1 / - - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT - CAST( - + 0 AS DECIMAL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3783
SELECT ALL + col1 / - - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT - CAST ( - + 0 AS REAL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 + - col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING ( + ( - 7 ) ) IS NULL
----

query I rowsort
SELECT ALL 80 AS col2 FROM tab0 GROUP BY col0
----
80
80
80

query I rowsort
SELECT ALL 71 * - 99 FROM tab2 AS cor0 WHERE col0 * col2 BETWEEN NULL AND + col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col2 col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT - 7 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-7
-7
-7

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3789
SELECT col2 + + CAST( + 96 AS SIGNED ) * + - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-3789
SELECT col2 + + CAST ( + 96 AS INTEGER ) * + - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col1 AS col1, + col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL + + col1 - + col1 - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( 5 ) * - 91 * - 20 * - + 2 = NULL
----

query I rowsort
SELECT - 55 FROM tab2 AS cor0 GROUP BY col2
----
-55
-55
-55

query II rowsort
SELECT DISTINCT + 84, col0 * ( + col0 ) FROM tab2 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - 54 FROM tab1 GROUP BY col2
----
-54
-54
-54

query II rowsort
SELECT - 2 * - 3 + - 56, col2 FROM tab0 GROUP BY col2
----
-50
24
-50
38
-50
79

query I rowsort
SELECT ALL col1 * - col1 * - - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - 57 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col0 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT + 46 * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT col0 + + 62 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 WHERE - 6 NOT IN ( col1 ) GROUP BY col0, col2
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 91 - 1 col1 FROM tab2 WHERE NULL <> - 96 * col1 GROUP BY col0, col2
----

query I rowsort
SELECT col2 + col2 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT ( col1 ) + col1 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 50 * + col1 AS col1 FROM tab2 cor0 WHERE + col1 * col2 - col2 <> col0 GROUP BY col1 HAVING NOT col1 = ( 76 )
----
2050
2950
3050

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 GROUP BY col2 HAVING 52 * col2 IS NULL
----

query I rowsort
SELECT + col2 + + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab2 GROUP BY col2, col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3808
SELECT ALL ( - CAST( NULL AS SIGNED ) ) * - col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT + col1 / 39 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-3808
SELECT ALL ( - CAST ( NULL AS INTEGER ) ) * - col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT + col1 / 39 IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 WHERE ( - col0 ) IS NOT NULL GROUP BY col1 HAVING ( NULL ) IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 WHERE col2 >= ( col0 ) GROUP BY col0 HAVING NULL IS NULL
----
-26

query I rowsort
SELECT 50 FROM tab1 GROUP BY col1
----
50
50
50

query I rowsort
SELECT DISTINCT 59 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
59

query I rowsort
SELECT - 78 * - col0 + + col0 FROM tab2 GROUP BY col1, col0
----
1185
7189
7268

query I rowsort
SELECT - col2 + + col2 AS col1 FROM tab2 WHERE 41 IS NULL GROUP BY col2 HAVING NOT NULL <> + col2 / 6
----

query I rowsort
SELECT 58 + - 97 / - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT col1 / - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - 29 * col2 + col1 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT - 74 FROM tab0 AS cor0 GROUP BY col0, col0
----
-74
-74
-74

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 WHERE col2 IN ( + 95 * col1 ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col2, col0 HAVING 54 < 8
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query II rowsort label-3821
SELECT ALL 8 + - - col1 col2, col1 DIV - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
49
-1
67
-1
69
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3821
SELECT ALL 8 + - - col1 col2, col1 / - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
49
-1
67
-1
69
-1

query I rowsort
SELECT 82 AS col0 FROM tab2 WHERE NULL NOT BETWEEN NULL AND + col2 GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 + + + 56 + - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + + col1 IS NULL
----
56

query I rowsort
SELECT 64 FROM tab1 GROUP BY col2, col1
----
64
64
64

query I rowsort
SELECT + ( col0 ) - - + col0 - - col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT ALL + col2 AS col1, 18 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
18
38
18
79
18

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 + + + col2 AS col0 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL COALESCE ( - - 15, - - col2 ) FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT + - col0 IS NULL
----
15
15
15

query I rowsort
SELECT DISTINCT 16 AS col0 FROM tab1 GROUP BY col0
----
16

query I rowsort
SELECT - col2 + + 95 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query II rowsort
SELECT col1, - col1 FROM tab0 GROUP BY col1
----
0
0
81
-81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3833
SELECT ALL CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-3833
SELECT ALL CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * - col0 - - col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + 52 * ( + + 4 ) + - col0 * - col0 FROM tab0 WHERE - col0 IS NOT NULL GROUP BY col0 HAVING NOT - - 87 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + 89 FROM tab0 AS cor0 GROUP BY col1, col1
----
89

query I rowsort
SELECT DISTINCT 15 * + + 62 * col0 AS col1 FROM tab0 WHERE - + ( col2 ) + + + col1 BETWEEN - + col1 AND + + col2 GROUP BY col0, col0
----

query I rowsort
SELECT ALL + - 1 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-1
-1
-1

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + - 55 IS NOT NULL
----

query I rowsort
SELECT + 76 FROM tab2 GROUP BY col0
----
76
76
76

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 WHERE NOT NULL NOT IN ( - 91 ) GROUP BY col1, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab2 WHERE col0 * + + 20 + + col0 IS NOT NULL GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT col2 * 34 AS col1 FROM tab0 GROUP BY col2, col0
----
1292
2686
816

query I rowsort
SELECT - col1 * - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
1681
3481
3721

query I rowsort
SELECT - 70 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT 59 IS NOT NULL
----

query I rowsort
SELECT col0 + + ( + col0 ) + - + 40 * - col0 + col2 + + col2 + - 33 * col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING col2 <= NULL
----

query I rowsort
SELECT DISTINCT + + ( col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT ALL col1 + - + col1 FROM tab2 GROUP BY col1 HAVING + AVG ( DISTINCT col1 ) IS NULL AND NOT NULL IS NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING - 99 + - + col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING NOT 76 IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT ALL 55 * - col2 FROM tab0 GROUP BY col2
----
-1320
-2090
-4345

query I rowsort
SELECT + 56 AS col1 FROM tab2 WHERE - + col1 IS NULL GROUP BY col0
----

query II rowsort
SELECT 12 AS col1, 73 FROM tab0 GROUP BY col1, col0
----
12
73
12
73
12
73

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL - 89 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-89
-89
-89

query I rowsort
SELECT ALL + 38 FROM tab1 cor0 GROUP BY col0
----
38
38
38

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3858
SELECT ALL + CAST( NULL AS DECIMAL ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3858
SELECT ALL + CAST ( NULL AS REAL ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 FROM tab0 WHERE col0 + + col0 + - col0 * + col2 * col0 IS NOT NULL GROUP BY col2
----
24
38
79

query II rowsort
SELECT - col1, COALESCE ( - + col1, + - col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3861
SELECT col2, CAST( - - CAST( NULL AS SIGNED ) AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col0
----
58
NULL
79
NULL
87
NULL

skipif mysql # not compatible
query II rowsort label-3861
SELECT col2, CAST ( - - CAST ( NULL AS INTEGER ) AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col0
----
58
NULL
79
NULL
87
NULL

query I rowsort
SELECT ALL - 67 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-67
-67
-67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col1 + - + 71 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NOT ( NULL IS NOT NULL )
----
-14
-27
-65

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 22 col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-22
-22

query I rowsort
SELECT + col1 * - col1 + - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3867
SELECT DISTINCT - 55 + + col2 AS col0 FROM tab0 cor0 WHERE + col1 / - - col1 * 7 * - ( - - CAST( NULL AS SIGNED ) ) IS NOT NULL GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-3867
SELECT DISTINCT - 55 + + col2 AS col0 FROM tab0 cor0 WHERE + col1 / - - col1 * 7 * - ( - - CAST ( NULL AS INTEGER ) ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - col2 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ( - col1 ) AS col0 FROM tab0 GROUP BY col1, col2, col1
----
-81
0
0

query I rowsort
SELECT - + col1 + - - 47 FROM tab0 AS cor0 WHERE 51 = NULL GROUP BY col1
----

query I rowsort
SELECT ALL + 39 * + 77 + col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 57 FROM tab0 AS cor0 GROUP BY col2
----
57
57
57

query I rowsort
SELECT ALL + col1 + col1 - + + 43 FROM tab2 cor0 GROUP BY col1, col1
----
39
75
79

query I rowsort
SELECT - col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT - 94 IS NOT NULL
----

query I rowsort
SELECT - 53 FROM tab1 AS cor0 WHERE NOT ( NULL IS NULL ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL col0 * col2 FROM tab1 AS cor0 WHERE NULL <> col2 * + 35 GROUP BY col0, col2 HAVING NOT - col0 <= - + CASE ( + - col0 ) WHEN - ( + 51 ) THEN - col0 + ( col2 ) END / - 84
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3878
SELECT - CAST( - + col1 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - col1 IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-3878
SELECT - CAST ( - + col1 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - col1 IS NOT NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3879
SELECT DISTINCT 31 DIV ( - + col2 ) DIV + + col2 - - col2 + - COALESCE ( - 97, + 54 ) + 22 AS col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
143
157
198

skipif mysql # not compatible
query I rowsort label-3879
SELECT DISTINCT 31 / ( - + col2 ) / + + col2 - - col2 + - COALESCE ( - 97, + 54 ) + 22 AS col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
143
157
198

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 * - col1 * - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
-205379
-226981
-68921

query I rowsort
SELECT DISTINCT + 28 + - col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
1472
604
6269

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, ( - col0 ) * - col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND ( 65 )
----

query I rowsort
SELECT + col1 * - col0 + 76 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL < COALESCE ( - + col0, col0 ) AND ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NOT + + col2 IS NOT NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL BETWEEN NULL AND - - col2
----

query II rowsort
SELECT ALL - - col1 AS col0, - col2 FROM tab1 AS cor0 GROUP BY col2, col2, col1 HAVING NOT NULL NOT BETWEEN - col2 + col2 + + + col1 * col1 AND ( + 76 + 86 )
----

query II rowsort
SELECT DISTINCT - col2 AS col2, + col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-58
58
-79
79
-87
87

query I rowsort
SELECT DISTINCT ( - col2 ) - + col2 + - - col2 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + 63 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 98 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NULL IS NULL )
----
98
98
98

query I rowsort
SELECT col0 * + col0 FROM tab1 AS cor0 WHERE NULL NOT BETWEEN ( 46 ) AND NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3895
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-3895
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
NULL

query I rowsort
SELECT - col0 * + - col0 + - col0 + col0 + + + 33 FROM tab1 AS cor0 GROUP BY col0
----
517
6757
817

query I rowsort
SELECT ALL + + 43 - - 88 FROM tab0 AS cor0 GROUP BY col0
----
131
131
131

query I rowsort
SELECT DISTINCT - + 64 FROM tab0 AS cor0 GROUP BY col0
----
-64

query I rowsort
SELECT + 55 * 66 * col2 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN + 22 AND ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 + - col1 + + ( + 49 ) + - - col1 * col1 AS col1, - col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab0 GROUP BY col0 HAVING - - 82 IS NOT NULL
----
26
43
83

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT + col1 / - col1 + ( + 88 ) IS NULL
----
-41
-59
-61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3903
SELECT ALL - + CAST( + 44 AS DECIMAL ) * col0 - + col0 * - - 89 AS col0 FROM tab2 WHERE - 51 <= NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-3903
SELECT ALL - + CAST ( + 44 AS REAL ) * col0 - + col0 * - - 89 AS col0 FROM tab2 WHERE - 51 <= NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3904
SELECT ALL col0 * - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3904
SELECT ALL col0 * - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 3 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-3
-3
-3

query II rowsort
SELECT ALL - col2 AS col1, 10 AS col0 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT AVG ( 6 ) < + col1
----
-8
10

query II rowsort
SELECT DISTINCT + col1, ( + - col1 ) * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
-2378
59
-4661
61
-5307

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: DIV for integer division: 
query I rowsort label-3909
SELECT ALL - col0 DIV 62 + + col1 DIV - col0 FROM tab1 cor0 WHERE NOT 39 IS NULL GROUP BY col0, col1 HAVING NOT - CAST( CAST( NULL AS SIGNED ) AS DECIMAL ) IS NOT NULL
----
-1
-2
0

skipif mysql # not compatible
query I rowsort label-3909
SELECT ALL - col0 / 62 + + col1 / - col0 FROM tab1 cor0 WHERE NOT 39 IS NULL GROUP BY col0, col1 HAVING NOT - CAST ( CAST ( NULL AS INTEGER ) AS REAL ) IS NOT NULL
----
-1
-2
0

query I rowsort
SELECT ALL col2 * - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 83 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <> ( col1 )
----

query I rowsort
SELECT + 36 FROM tab1 AS cor0 GROUP BY col0
----
36
36
36

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3913
SELECT ALL CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3913
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3914
SELECT ALL - CAST( NULL AS SIGNED ) * col0 + ( 51 ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

skipif mysql # not compatible
query I rowsort label-3914
SELECT ALL - CAST ( NULL AS INTEGER ) * col0 + ( 51 ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT col0 + 90 * - ( col2 ) + - col0 FROM tab1 cor0 GROUP BY col2, col0 HAVING - col2 * - AVG ( + 70 ) > - 17 * col0
----
-4050
-6390
-720

onlyif mysql # DIV for integer division: 
query I rowsort label-3916
SELECT + COALESCE ( 83, - - col0 DIV CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3916
SELECT + COALESCE ( 83, - - col0 / CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3917
SELECT + col2 + - col2 * + 57 * + - CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3917
SELECT + col2 + - col2 * + 57 * + - CAST ( NULL AS REAL ) FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING ( NOT - 24 IS NULL )
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3920
SELECT + col2 AS col0 FROM tab2 GROUP BY col2, col0 HAVING - - col0 + + CASE col0 + - CAST( + col2 AS SIGNED ) WHEN col2 * col2 THEN - CAST( NULL AS SIGNED ) ELSE NULL END * col0 = ( - ( 77 ) )
----

skipif mysql # not compatible
query I rowsort label-3920
SELECT + col2 AS col0 FROM tab2 GROUP BY col2, col0 HAVING - - col0 + + CASE col0 + - CAST ( + col2 AS INTEGER ) WHEN col2 * col2 THEN - CAST ( NULL AS INTEGER ) ELSE NULL END * col0 = ( - ( 77 ) )
----

query I rowsort
SELECT ALL - col1 - + - 53 + + - col1 AS col1 FROM tab0 GROUP BY col1
----
-109
53

query I rowsort
SELECT 40 * col2 AS col0 FROM tab1 GROUP BY col2, col2
----
1800
2840
320

query I rowsort
SELECT col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( + col1 ) = NULL
----

query I rowsort
SELECT ( - 21 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
-21
-21
-21

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3925
SELECT - CAST( - - col0 AS SIGNED ) FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-3925
SELECT - CAST ( - - col0 AS INTEGER ) FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col0 + col0 FROM tab2 AS cor0 WHERE NOT - 49 + + - 70 NOT BETWEEN - col1 + + col2 + 26 AND NULL GROUP BY col0
----

query I rowsort
SELECT ALL - ( + col2 ) * col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - 83 * + col2 + - + 48 * + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - 11 * 3 IS NOT NULL
----
-1048
-5895
-9301

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col2, col2
----
-24
-38
-79

query I rowsort
SELECT + - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL > col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3932
SELECT DISTINCT CAST( + col0 AS SIGNED ) AS col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

skipif mysql # not compatible
query I rowsort label-3932
SELECT DISTINCT CAST ( + col0 AS INTEGER ) AS col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + ( col1 ) * - col1 * + 75 FROM tab0 WHERE NOT + - col1 + col0 * + col1 IS NULL GROUP BY col1 HAVING NULL > NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-3934
SELECT DISTINCT col1 AS col1, + 90 DIV col1 * + 64 + + col1 * - col1 + - col1 AS col1 FROM tab2 GROUP BY col1
----
41
-1594
59
-3476
61
-3718

skipif mysql # not compatible
query II rowsort label-3934
SELECT DISTINCT col1 AS col1, + 90 / col1 * + 64 + + col1 * - col1 + - col1 AS col1 FROM tab2 GROUP BY col1
----
41
-1594
59
-3476
61
-3718

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3935
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL <> NULL
----

skipif mysql # not compatible
query I rowsort label-3935
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3936
SELECT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3936
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT DISTINCT - col1 AS col0, col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-41
41
-59
59
-61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 20 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
20
20
20

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN col2 AND col0 GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col0 * + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - 99 * 21 + - col0 + + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-2079
-2079
-2079

query II rowsort
SELECT DISTINCT + col2 - - 11 AS col2, col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
69
58
90
79
98
87

query I rowsort
SELECT ALL + NULLIF ( 79, col2 ) FROM tab0 AS cor0 GROUP BY col2, col2
----
79
79
NULL

query I rowsort
SELECT - 30 - + col1 * + - 46 * 94 FROM tab2 cor0 GROUP BY col1, col0
----
177254
255086
263734

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST( NULL AS DECIMAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST ( NULL AS REAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING - col1 * - 13 + col0 + - 27 + - + 61 IS NULL
----

query I rowsort
SELECT + col1 * + col1 * + 52 FROM tab1 cor0 GROUP BY col1, col0
----
100672
168948
1872

query I rowsort
SELECT ALL col1 FROM tab1 WHERE NOT + col0 + + 61 * ( - - col1 ) - col0 * ( + + 68 ) / + col2 * + 66 + + col2 >= 12 GROUP BY col1 HAVING NOT 13 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col1, + 42 col1 FROM tab1 WHERE col2 IN ( - 16 * NULLIF ( + col0, - col0 ) * - 77 / col1 ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT 8 * + + col1 + + col1 AS col1 FROM tab0 GROUP BY col1
----
0
729

query I rowsort
SELECT + ( - col1 ) + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NOT NULL
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 71 col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-71
-71
-71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3954
SELECT ALL - ( + 29 ) + + + 80 * + col2 * - col2 * - + col0 / + CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-3954
SELECT ALL - ( + 29 ) + + + 80 * + col2 * - col2 * - + col0 / + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL ( - col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3957
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-3957
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT 80 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING ( + 63 ) NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-3960
SELECT DISTINCT - - col0 + - ( col0 ) AS col2, - col0 + - col0 + - - col0 + + col0 + - col0 DIV 25 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
0
-249
0
-26
0
-43

skipif mysql # not compatible
query II rowsort label-3960
SELECT DISTINCT - - col0 + - ( col0 ) AS col2, - col0 + - col0 + - - col0 + + col0 + - col0 / 25 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
0
-249
0
-26
0
-43

query I rowsort
SELECT DISTINCT - 9 * + 84 FROM tab1 GROUP BY col2
----
-756

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col2 HAVING - - col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT 11 AS col0 FROM tab0 GROUP BY col2
----
11

query I rowsort
SELECT 75 - col0 AS col2 FROM tab2 GROUP BY col0
----
-16
-17
60

query I rowsort
SELECT - col2 * 78 * + 85 * + 37 - col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT - - 18 IS NULL
----
-19379490
-5887521
-9321780

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 > NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3968
SELECT - CAST( col2 AS SIGNED ) FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-3968
SELECT - CAST ( col2 AS INTEGER ) FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + + 32 FROM tab0 cor0 GROUP BY col2, col2
----
32
32
32

query I rowsort
SELECT ALL - 47 FROM tab2 GROUP BY col2, col1
----
-47
-47
-47

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 93 col0 FROM tab1 cor0 GROUP BY col0, col2 HAVING - col2 BETWEEN + - 11 AND - - 71
----
93

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3974
SELECT DISTINCT col1 + 18 FROM tab0 GROUP BY col2, col1 HAVING NOT 68 < + - CAST( + col1 AS SIGNED )
----
18
99

skipif mysql # not compatible
query I rowsort label-3974
SELECT DISTINCT col1 + 18 FROM tab0 GROUP BY col2, col1 HAVING NOT 68 < + - CAST ( + col1 AS INTEGER )
----
18
99

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query II rowsort
SELECT DISTINCT + ( - col1 ), col1 + ( - + col1 ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT + col1 + + - 13 IS NULL
----
-81
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3977
SELECT - + 31 * + CAST( col0 AS SIGNED ) - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-2624
-704
-896

skipif mysql # not compatible
query I rowsort label-3977
SELECT - + 31 * + CAST ( col0 AS INTEGER ) - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-2624
-704
-896

query II rowsort
SELECT DISTINCT 15, - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING NOT - 88 > col2
----
15
-44
15
-57
15
-6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1 * - col1 * col1 + - + col1 AS col2, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN + ( - col1 ) AND + col2 + - 3
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 75 col1 FROM tab1 GROUP BY col0
----
75
75
75

query I rowsort
SELECT DISTINCT - col0 * + 83 FROM tab2 GROUP BY col0, col0
----
-1245
-7553
-7636

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT col1 >= - + col1
----

query I rowsort
SELECT ALL - col1 * + col1 * - + col1 + - - col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
0
531522

query I rowsort
SELECT ALL ( - 38 ) FROM tab1 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 WHERE - 38 * + col0 <= col0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col1 * - 69 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
5589

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3988
SELECT - COALESCE ( - CAST( - 18 AS SIGNED ), - + 10 ) + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
10
4
64

skipif mysql # not compatible
query I rowsort label-3988
SELECT - COALESCE ( - CAST ( - 18 AS INTEGER ), - + 10 ) + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
10
4
64

query I rowsort
SELECT + 32 FROM tab2 AS cor0 GROUP BY col0, col2
----
32
32
32

query I rowsort
SELECT + 4 * - col2 * - col2 - + 16 AS col1 FROM tab0 GROUP BY col2, col2
----
2288
24948
5760

query I rowsort
SELECT DISTINCT - ( col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 * + col0 AS col0, col0 * + 54 col1 FROM tab2 AS cor0 WHERE + col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 > + - 88
----

query I rowsort
SELECT col1 + + - col1 FROM tab0 GROUP BY col1, col1, col2
----
0
0
0

query I rowsort
SELECT + 43 FROM tab2 GROUP BY col2, col0 HAVING NOT ( 79 ) IS NULL
----
43
43
43

query I rowsort
SELECT 67 + + col1 AS col1 FROM tab2 GROUP BY col1, col2
----
108
126
128

query I rowsort
SELECT DISTINCT - + 39 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 91 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 24 IS NULL
----
-91
-91
-91

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3999
SELECT CAST( NULL AS SIGNED ) AS col2, col1 AS col2 FROM tab1 GROUP BY col1
----
NULL
44
NULL
57
NULL
6

skipif mysql # not compatible
query II rowsort label-3999
SELECT CAST ( NULL AS INTEGER ) AS col2, col1 AS col2 FROM tab1 GROUP BY col1
----
NULL
44
NULL
57
NULL
6

query I rowsort
SELECT DISTINCT - col0 * col2 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT ALL ( + ( col1 ) ) FROM tab1 GROUP BY col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4002
SELECT ALL CAST( - CAST( + 66 AS SIGNED ) AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-66
-66
-66

skipif mysql # not compatible
query I rowsort label-4002
SELECT ALL CAST ( - CAST ( + 66 AS INTEGER ) AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-66
-66
-66

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2 HAVING + 61 - col2 NOT IN ( col2 )
----
58
79
87

query I rowsort
SELECT - col2 * + col2 * + col2 FROM tab2 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
45
71
8

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT col0 IS NULL
----
22
28
82

query I rowsort
SELECT + COALESCE ( - 6, - + ( col0 ) ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-6
-6
-6

query I rowsort
SELECT col2 * col2 + + col2 + 80 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( 79 ) IS NOT NULL
----
1562
6400
680

query I rowsort
SELECT col0 * 29 AS col1 FROM tab1 cor0 GROUP BY col0, col0
----
2378
638
812

query I rowsort
SELECT - - 3 + col0 * - col0 AS col0 FROM tab1 AS cor0 WHERE NULL > + 24 GROUP BY col1, col0
----

query I rowsort
SELECT ALL + col0 + - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL ( - - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab2 WHERE NOT + col0 IS NOT NULL GROUP BY col0, col2 HAVING NOT - NULLIF ( + NULLIF ( col2, - col2 ), col0 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4015
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( + 37 ) <> 22 - CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-4015
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( + 37 ) <> 22 - CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT - 35 * - col2 FROM tab1 GROUP BY col2, col2
----
1575
2485
280

query II rowsort
SELECT DISTINCT + col1, ( + 42 ) AS col0 FROM tab0 GROUP BY col1
----
0
42
81
42

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4019
SELECT col2 AS col1, - col2 col2 FROM tab1 GROUP BY col2 HAVING 47 + + - CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4019
SELECT col2 AS col1, - col2 col2 FROM tab1 GROUP BY col2 HAVING 47 + + - CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + 99 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
99

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4021
SELECT - col2 - + 74 AS col1, CAST( NULL AS SIGNED ) FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-112
NULL
-153
NULL
-98
NULL

skipif mysql # not compatible
query II rowsort label-4021
SELECT - col2 - + 74 AS col1, CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-112
NULL
-153
NULL
-98
NULL

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING ( NOT NULL BETWEEN NULL AND col1 )
----

query I rowsort
SELECT - 55 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-55
-55
-55

query I rowsort
SELECT - col2 * col2 - + col2 AS col0 FROM tab0 GROUP BY col2
----
-1482
-600
-6320

query I rowsort
SELECT + col1 * 75 FROM tab0 GROUP BY col1
----
0
6075

query I rowsort
SELECT ALL 11 FROM tab0 GROUP BY col1, col2 HAVING NOT + ( col2 ) IS NULL
----
11
11
11

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4028
SELECT + CAST( NULL AS SIGNED ) - col0 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4028
SELECT + CAST ( NULL AS INTEGER ) - col0 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-4029
SELECT - col0 DIV + 77 FROM tab1 GROUP BY col2, col0
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-4029
SELECT - col0 / + 77 FROM tab1 GROUP BY col2, col0
----
-1
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 86 * + - 67 col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4031
SELECT ALL col0 - - 94 * + col0 AS col0 FROM tab1 GROUP BY col0 HAVING ( 46 - CAST( NULL AS SIGNED ) ) IN ( + 48 )
----

skipif mysql # not compatible
query I rowsort label-4031
SELECT ALL col0 - - 94 * + col0 AS col0 FROM tab1 GROUP BY col0 HAVING ( 46 - CAST ( NULL AS INTEGER ) ) IN ( + 48 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4032
SELECT - 2 FROM tab2 AS cor0 WHERE NOT ( col0 + - 77 ) IS NULL GROUP BY col1 HAVING NOT + 85 * - col1 NOT IN ( + CAST( 77 AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-4032
SELECT - 2 FROM tab2 AS cor0 WHERE NOT ( col0 + - 77 ) IS NULL GROUP BY col1 HAVING NOT + 85 * - col1 NOT IN ( + CAST ( 77 AS INTEGER ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * 67 col1 FROM tab1 GROUP BY col0, col0
----
-1474
-1876
-5494

query I rowsort
SELECT - 5 FROM tab1 GROUP BY col2
----
-5
-5
-5

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4035
SELECT - 16 AS col2 FROM tab1 GROUP BY col0, col1 HAVING CAST( - col0 AS SIGNED ) NOT IN ( - 20 )
----
-16
-16
-16

skipif mysql # not compatible
query I rowsort label-4035
SELECT - 16 AS col2 FROM tab1 GROUP BY col0, col1 HAVING CAST ( - col0 AS INTEGER ) NOT IN ( - 20 )
----
-16
-16
-16

query I rowsort
SELECT 74 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 64 AS col0 FROM tab2 AS cor0 WHERE + col0 NOT IN ( 33 ) GROUP BY col2
----
64

query I rowsort
SELECT + + 6 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col1 HAVING - 12 IS NOT NULL
----
6
6
6

query I rowsort
SELECT 32 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
32
32
32

query I rowsort
SELECT ALL 11 AS col1 FROM tab2 GROUP BY col0
----
11
11
11

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4041
SELECT DISTINCT - 1 col0 FROM tab2 WHERE + ( + CAST( NULL AS SIGNED ) ) IN ( - col1 ) GROUP BY col2, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4041
SELECT DISTINCT - 1 col0 FROM tab2 WHERE + ( + CAST ( NULL AS INTEGER ) ) IN ( - col1 ) GROUP BY col2, col2
----

query I rowsort
SELECT + col1 + + + col0 / + NULLIF ( col1, col0 ) AS col2 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT ( NULL ) NOT BETWEEN NULL AND col0
----

query I rowsort
SELECT col2 * col2 + - col2 * col2 FROM tab0 WHERE + COALESCE ( + 50, col2 * 89 ) IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NOT 75 IS NOT NULL
----

query I rowsort
SELECT col0 / - + ( - col0 ) AS col0 FROM tab0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT 26 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
26

query I rowsort
SELECT DISTINCT - col1 - + col1 FROM tab1 AS cor0 WHERE NOT ( NOT - col0 IS NOT NULL ) GROUP BY col1, col2
----
-114
-12
-88

query I rowsort
SELECT DISTINCT - 96 * col1 FROM tab1 cor0 GROUP BY col1, col0
----
-4224
-5472
-576

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING - col0 = NULL
----

query I rowsort
SELECT DISTINCT + ( + col0 ) * - ( col0 ) * col1 + - 1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1
-149770

query I rowsort
SELECT - + 41 + - col1 AS col0 FROM tab0 AS cor0 WHERE NOT ( + - 62 * ( - col1 ) * col1 + + col0 = + 60 ) GROUP BY col1, col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4052
SELECT col2 - - col2 DIV - + 84 FROM tab0 GROUP BY col2, col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-4052
SELECT col2 - - col2 / - + 84 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT 21 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
21

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4054
SELECT + CAST( + + 96 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col1
----
96
96
96

skipif mysql # not compatible
query I rowsort label-4054
SELECT + CAST ( + + 96 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1
----
96
96
96

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 29 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col1 HAVING NULL > + col2 + + + col0 * - col2 * col1 * + 48 * - col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4056
SELECT DISTINCT + col0 DIV - - col0 FROM tab2 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-4056
SELECT DISTINCT + col0 / - - col0 FROM tab2 GROUP BY col0, col0
----
1

query I rowsort
SELECT 59 FROM tab1 AS cor0 GROUP BY col2
----
59
59
59

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4058
SELECT + col2 + + CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4058
SELECT + col2 + + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT col0 + 47 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL 76 - 70 * 0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
76
76
76

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 * + - 26 col1 FROM tab0 GROUP BY col2
----
-2054
-624
-988

query I rowsort
SELECT + 61 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
61
61
61

query I rowsort
SELECT DISTINCT 69 AS col0 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
69

query I rowsort
SELECT ALL + ( + ( + col0 ) ) AS col0 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + + col0 AS col1 FROM tab2 WHERE NOT - - 68 * - col2 * - 58 < col1 * ( + col0 ) GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT + 81 AS col0 FROM tab1 GROUP BY col1
----
81
81
81

query I rowsort
SELECT + + 43 FROM tab1 AS cor0 GROUP BY col1, col0
----
43
43
43

query I rowsort
SELECT - NULLIF ( + + 86, 3 ) AS col0 FROM tab2 GROUP BY col1, col0
----
-86
-86
-86

query I rowsort
SELECT 11 + - 65 FROM tab0 GROUP BY col0
----
-54
-54
-54

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4071
SELECT ( + col2 ), - col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT + col2 + - CAST( + col0 AS SIGNED ) >= + - 29
----
58
-92

skipif mysql # not compatible
query II rowsort label-4071
SELECT ( + col2 ), - col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT + col2 + - CAST ( + col0 AS INTEGER ) >= + - 29
----
58
-92

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4072
SELECT ALL - ( + col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT + CAST( + - col0 AS DECIMAL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4072
SELECT ALL - ( + col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT + CAST ( + - col0 AS REAL ) IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4073
SELECT ALL + + col2 / - col2 + + CAST( NULL AS DECIMAL ) FROM tab1 cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4073
SELECT ALL + + col2 / - col2 + + CAST ( NULL AS REAL ) FROM tab1 cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + + col1 * + 53 / - - col1 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING 18 IS NULL
----

query I rowsort
SELECT DISTINCT - - 6 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
6

query I rowsort
SELECT - + col2 * col1 * col0 + - 17 * 15 FROM tab1 AS cor0 GROUP BY col0, col0, col1, col2
----
-1311
-256423
-72075

query I rowsort
SELECT ALL 41 - + 86 - - 90 / 52 * ( 39 ) + + + col2 FROM tab2 GROUP BY col2, col2 HAVING NULL <= col2
----

query I rowsort
SELECT ALL col1 * + 58 - + - col2 AS col1 FROM tab1 cor0 GROUP BY col1, col1, col2 HAVING NOT ( - col2 IS NOT NULL )
----

query I rowsort
SELECT 59 FROM tab0 GROUP BY col1 HAVING ( + + 14 ) IS NOT NULL
----
59
59

query I rowsort
SELECT DISTINCT 61 * - - col0 FROM tab0 GROUP BY col0, col0
----
1586
2623
5063

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING 37 < NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - 37 * col0 FROM tab1 GROUP BY col0
----
-1036
-3034
-814

query I rowsort
SELECT 80 * + col1 FROM tab2 GROUP BY col1, col1, col2
----
3280
4720
4880

query I rowsort
SELECT - - 0 * - - 55 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT DISTINCT - ( + col0 ) + + col0 * - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1892
-6972
-702

query I rowsort
SELECT ALL col0 + 5 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
20
96
97

query I rowsort
SELECT ALL - + col1 * - - 59 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2596
-3363
-354

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 96 + + col0 col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
118
124
178

query I rowsort
SELECT DISTINCT 6 FROM tab2 GROUP BY col2, col2, col1
----
6

query I rowsort
SELECT ALL - 20 FROM tab1 GROUP BY col2 HAVING - AVG ( ALL - col2 ) IS NOT NULL
----
-20
-20
-20

query I rowsort
SELECT 46 + + + col2 * - 28 AS col1 FROM tab2 GROUP BY col2
----
-1578
-2166
-2390

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4093
SELECT - NULLIF ( COALESCE ( + 79, - 44 ), CAST( NULL AS SIGNED ) ) FROM tab1 GROUP BY col0
----
-79
-79
-79

skipif mysql # not compatible
query I rowsort label-4093
SELECT - NULLIF ( COALESCE ( + 79, - 44 ), CAST ( NULL AS INTEGER ) ) FROM tab1 GROUP BY col0
----
-79
-79
-79

query I rowsort
SELECT + - col2 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col1, col2
----

query I rowsort
SELECT ALL - 18 FROM tab1 AS cor0 GROUP BY col2
----
-18
-18
-18

query II rowsort
SELECT 83 * + col2, col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
1992
24
3154
38
6557
79

onlyif mysql # DIV for integer division: 
query I rowsort label-4097
SELECT DISTINCT - col2 + + - col2 - 5 * - col2 * + - 48 DIV - ( - 4 ) - + + col2 DIV col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
-1489
-2357
-4899

skipif mysql # not compatible
query I rowsort label-4097
SELECT DISTINCT - col2 + + - col2 - 5 * - col2 * + - 48 / - ( - 4 ) - + + col2 / col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
-1489
-2357
-4899

query I rowsort
SELECT ALL - 35 + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-27
10
36

onlyif mysql # DIV for integer division: 
query I rowsort label-4099
SELECT - 99 DIV col2 + 71 AS col1 FROM tab0 GROUP BY col2
----
67
69
70

skipif mysql # not compatible
query I rowsort label-4099
SELECT - 99 / col2 + 71 AS col1 FROM tab0 GROUP BY col2
----
67
69
70

query I rowsort
SELECT ALL + 48 FROM tab2 AS cor0 WHERE NOT col1 < + col0 / - col2 GROUP BY col1, col2
----
48
48
48

query I rowsort
SELECT - - ( - col1 ) AS col2 FROM tab1 WHERE + 89 NOT BETWEEN NULL AND + col1 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col0 HAVING - col0 IS NOT NULL
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4103
SELECT DISTINCT - CAST( NULL AS SIGNED ) + + - col0 FROM tab1 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-4103
SELECT DISTINCT - CAST ( NULL AS INTEGER ) + + - col0 FROM tab1 GROUP BY col0
----
NULL

query I rowsort
SELECT - 70 AS col2 FROM tab1 GROUP BY col0, col2
----
-70
-70
-70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 11 col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 + col0 + - col2 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4107
SELECT + CAST( NULL AS SIGNED ) FROM tab1 WHERE NULL IS NULL GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4107
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 WHERE NULL IS NULL GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 92 AS col1 FROM tab1 GROUP BY col2
----
92
92
92

query I rowsort
SELECT ALL + 26 FROM tab2 GROUP BY col2
----
26
26
26

query I rowsort
SELECT ALL + 64 AS col0 FROM tab0 GROUP BY col2, col1
----
64
64
64

query I rowsort
SELECT + col0 * col0 * + 66 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - - 15 > col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query II rowsort
SELECT + col0 AS col0, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT 32 FROM tab1 cor0 GROUP BY col1, col2, col2
----
32
32
32

query I rowsort
SELECT - 52 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
-52
-52
-52

query II rowsort
SELECT DISTINCT - col2 * + 77 - 7 + + col0, col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + + 9 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
9
9
9

query I rowsort
SELECT DISTINCT ( + - col2 ) * - col2 * + ( 82 ) FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4119
SELECT ALL NULLIF ( - + col2, col2 ) DIV - col2 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4119
SELECT ALL NULLIF ( - + col2, col2 ) / - col2 FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col2 - - 41 FROM tab1 cor0 GROUP BY col2
----
112
49
86

query I rowsort
SELECT DISTINCT - 16 AS col1 FROM tab0 GROUP BY col0
----
-16

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4122
SELECT - col1 * + CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1, col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4122
SELECT - col1 * + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1, col1
----
NULL
NULL

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 WHERE ( COALESCE ( - + 49, + col0 + - + NULLIF ( - col0, - 84 + 76 ) ) * + + col2 ) IS NOT NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT 3 FROM tab2 AS cor0 GROUP BY col1, col0
----
3
3
3

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4126
SELECT DISTINCT 55 * + - 39 - + CAST( NULL AS SIGNED ) + + col2 + + col2 * + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-4126
SELECT DISTINCT 55 * + - 39 - + CAST ( NULL AS INTEGER ) + + col2 + + col2 * + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4127
SELECT + - CAST( NULL AS SIGNED ) col1 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4127
SELECT + - CAST ( NULL AS INTEGER ) col1 FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT - col2 AS col1, col2 AS col0 FROM tab1 AS cor0 WHERE NOT 61 IS NULL GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-45
45
-71
71
-8
8

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NOT - 99 >= + - 88
----
22
28
82

query I rowsort
SELECT col1 * - + col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT + - 81 * - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
3645
5751
648

query I rowsort
SELECT DISTINCT 95 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
95

query I rowsort
SELECT 20 FROM tab1 GROUP BY col1, col1
----
20
20
20

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4134
SELECT + NULLIF ( col0, + - 92 ) * - 79 / - ( col0 ) + - col0 - CAST( NULL AS DECIMAL ) + + col0 * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 53 < ( + + 79 )
----

skipif mysql # not compatible
query I rowsort label-4134
SELECT + NULLIF ( col0, + - 92 ) * - 79 / - ( col0 ) + - col0 - CAST ( NULL AS REAL ) + + col0 * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + 53 < ( + + 79 )
----

query I rowsort
SELECT DISTINCT + + AVG ( - ( 29 ) ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT 82 < NULL
----

query I rowsort
SELECT - 98 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4137
SELECT ALL + 89 FROM tab0 WHERE NOT col0 * + ( + col0 * col1 ) < col0 GROUP BY col1 HAVING NOT col1 IN ( + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-4137
SELECT ALL + 89 FROM tab0 WHERE NOT col0 * + ( + col0 * col1 ) < col0 GROUP BY col1 HAVING NOT col1 IN ( + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 97 col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
97
97
97

query I rowsort
SELECT DISTINCT + col2 + - col2 AS col0 FROM tab2 GROUP BY col2
----
0

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT + 15 AS col2 FROM tab2 GROUP BY col0
----
15

query I rowsort
SELECT - col1 + + 53 * ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
2288
2964
312

query I rowsort
SELECT DISTINCT - ( + col2 ) * + col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT 84 IS NOT NULL
----

query I rowsort
SELECT - col1 - - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT 46 * + col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4146
SELECT - col2 FROM tab0 AS cor0 WHERE ( CAST( col0 AS SIGNED ) / COALESCE ( col2, col1 ) ) IS NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-4146
SELECT - col2 FROM tab0 AS cor0 WHERE ( CAST ( col0 AS INTEGER ) / COALESCE ( col2, col1 ) ) IS NULL GROUP BY col2
----

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT 48 * + 11 + col1 FROM tab2 GROUP BY col1
----
569
587
589

query I rowsort
SELECT 34 FROM tab0 GROUP BY col0, col0
----
34
34
34

query I rowsort
SELECT - 87 FROM tab2 AS cor0 GROUP BY col2
----
-87
-87
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 68 * + - col2 + 4 col1 FROM tab0 AS cor0 GROUP BY col2
----
1636
2588
5376

query I rowsort
SELECT ALL - 31 + 29 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-2
-2
-2

query I rowsort
SELECT - 6 + - col1 * + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-1942
-3255
-42

query I rowsort
SELECT ALL - 3 FROM tab1 WHERE NOT NULL > col2 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 * - col1 + - 51 FROM tab1 GROUP BY col1
----
-1987
-3300
-87

query I rowsort
SELECT DISTINCT 54 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
54

query I rowsort
SELECT ALL col2 + + col2 FROM tab1 GROUP BY col2, col1
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 7 + col1 col2 FROM tab0 cor0 GROUP BY col2, col1, col1 HAVING NOT ( NULL ) IN ( - col2 )
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col2, col0 HAVING - 5 + + col0 * - col0 < col2 + 84
----
15
91
92

query I rowsort
SELECT + - col1 - + 32 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) <= ( 86 )
----

query I rowsort
SELECT ALL + + 95 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
95
95
95

query I rowsort
SELECT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT 7 FROM tab1 GROUP BY col0
----
7
7
7

query I rowsort
SELECT + - col2 FROM tab0 WHERE NOT ( 87 ) < + col1 * ( + + 9 ) * col1 + col2 GROUP BY col2 HAVING ( NULL <> NULL )
----

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4166
SELECT DISTINCT - 64 FROM tab1 GROUP BY col2 HAVING + 76 + - - CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4166
SELECT DISTINCT - 64 FROM tab1 GROUP BY col2 HAVING + 76 + - - CAST ( NULL AS INTEGER ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4167
SELECT DISTINCT + 20 * + CAST( - col0 AS SIGNED ) AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
-1820
-1840
-300

skipif mysql # not compatible
query I rowsort label-4167
SELECT DISTINCT + 20 * + CAST ( - col0 AS INTEGER ) AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
-1820
-1840
-300

query I rowsort
SELECT + 51 FROM tab2 AS cor0 GROUP BY col1
----
51
51
51

query I rowsort
SELECT DISTINCT - col2 + 73 FROM tab2 AS cor0 GROUP BY col2, col2
----
-14
-6
15

query I rowsort
SELECT + + 84 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
84
84
84

query I rowsort
SELECT + 51 FROM tab0 AS cor0 GROUP BY col1, col0
----
51
51
51

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( col1 + + col1 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + 28 col0 FROM tab2 cor0 GROUP BY col1, col0
----
-28
-28
-28

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * - 36 FROM tab1 GROUP BY col1, col0
----
-1008
-2952
-792

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) < NULL
----

query II rowsort
SELECT DISTINCT + 12 AS col2, + col1 FROM tab0 AS cor0 GROUP BY col1
----
12
0
12
81

query I rowsort
SELECT - 76 AS col0 FROM tab0 GROUP BY col2, col2
----
-76
-76
-76

onlyif mysql # DIV for integer division: 
query II rowsort label-4179
SELECT - col2 DIV + 89 - 49, 43 AS col0 FROM tab2 GROUP BY col2, col1
----
-49
43
-49
43
-49
43

skipif mysql # not compatible
query II rowsort label-4179
SELECT - col2 / + 89 - 49, 43 AS col0 FROM tab2 GROUP BY col2, col1
----
-49
43
-49
43
-49
43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4180
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT - - 34 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4180
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT - - 34 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 * + col0 * 42 AS col1 FROM tab2 GROUP BY col1, col0, col2
----
224112
301938
54810

query I rowsort
SELECT - 42 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT 74 FROM tab1 GROUP BY col0, col1
----
74
74
74

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + - col2 BETWEEN NULL AND col2
----

query I rowsort
SELECT ALL 23 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
23
23
23

query I rowsort
SELECT - - col2 FROM tab2 cor0 GROUP BY col2 HAVING 49 IS NOT NULL
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4187
SELECT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - ( CAST( NULL AS SIGNED ) ) = NULL
----

skipif mysql # not compatible
query I rowsort label-4187
SELECT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - ( CAST ( NULL AS INTEGER ) ) = NULL
----

query I rowsort
SELECT - - 75 FROM tab0 AS cor0 GROUP BY col0
----
75
75
75

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + COALESCE ( - - col2, + col1 ) * 20 AS col0 FROM tab1 GROUP BY col2, col1
----
1420
160
900

query I rowsort
SELECT ALL ( - + col0 ) - - col0 FROM tab2 GROUP BY col0
----
0
0
0

query II rowsort
SELECT ALL 79 / - - col0, - ( - - col0 ) FROM tab0 GROUP BY col0 HAVING NULL >= - 89
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4193
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0 HAVING + 72 / + CAST( 15 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4193
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0 HAVING + 72 / + CAST ( 15 AS INTEGER ) IS NULL
----

query I rowsort
SELECT 18 FROM tab0 GROUP BY col2
----
18
18
18

query I rowsort
SELECT - 33 - + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-124
-125
-48

query I rowsort
SELECT DISTINCT 1 AS col1 FROM tab2 GROUP BY col2
----
1

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4197
SELECT COALESCE ( - CAST( + - CAST( NULL AS SIGNED ) AS SIGNED ), + col1 ) AS col2, col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
41
1681
59
3481
61
3721

skipif mysql # not compatible
query II rowsort label-4197
SELECT COALESCE ( - CAST ( + - CAST ( NULL AS INTEGER ) AS INTEGER ), + col1 ) AS col2, col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
41
1681
59
3481
61
3721

query II rowsort
SELECT DISTINCT + col1 AS col0, - 14 * - + ( col1 ) FROM tab1 GROUP BY col1 HAVING + 14 = - 71
----

query I rowsort
SELECT 0 + ( col2 ) FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL col1 * col2 AS col0 FROM tab2 GROUP BY col2, col1
----
2378
4661
5307

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 + COALESCE ( + ( col2 ), + - 93 ) IS NULL
----
45
71
8

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4202
SELECT col1 FROM tab0 AS cor0 WHERE CAST( NULL AS DECIMAL ) IS NULL GROUP BY col1
----
0
81

skipif mysql # not compatible
query I rowsort label-4202
SELECT col1 FROM tab0 AS cor0 WHERE CAST ( NULL AS REAL ) IS NULL GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-4203
SELECT + CAST( NULL AS DECIMAL ), - 66 AS col1 FROM tab1 AS cor0 WHERE ( - col0 - + CAST( NULL AS SIGNED ) - - - 10 + + col2 ) <> NULL GROUP BY col1
----

skipif mysql # not compatible
query II rowsort label-4203
SELECT + CAST ( NULL AS REAL ), - 66 AS col1 FROM tab1 AS cor0 WHERE ( - col0 - + CAST ( NULL AS INTEGER ) - - - 10 + + col2 ) <> NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab0 cor0 GROUP BY col1, col2 HAVING - 3 IS NOT NULL OR NOT + + 92 IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + col2 * - 83 * NULLIF ( - 83, - 11 ) FROM tab2 AS cor0 GROUP BY col1, col2
----
399562
544231
599343

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 HAVING NOT + - NULLIF ( + col1, - col0 ) * - AVG ( DISTINCT 35 ) >= NULL
----

query I rowsort
SELECT col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-2025
-5041
-64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4208
SELECT ALL - 16 FROM tab1 AS cor0 WHERE NOT col1 NOT IN ( + col2, + 57 + + + col0 * + 54, + 64 * + col0 * - CAST( + col0 AS SIGNED ), + - 13 ) GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-4208
SELECT ALL - 16 FROM tab1 AS cor0 WHERE NOT col1 NOT IN ( + col2, + 57 + + + col0 * + 54, + 64 * + col0 * - CAST ( + col0 AS INTEGER ), + - 13 ) GROUP BY col2, col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4209
SELECT - ( + - CAST( NULL AS DECIMAL ) ) FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4209
SELECT - ( + - CAST ( NULL AS REAL ) ) FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 77 + col1 FROM tab0 GROUP BY col1, col0
----
158
77
77

query II rowsort
SELECT col0, + 65 FROM tab2 GROUP BY col0, col1
----
15
65
91
65
92
65

query I rowsort
SELECT col1 * + + col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT - CASE + + col1 WHEN + 57 THEN + col0 ELSE NULL END + col0 + + ( - col0 ) AS col0 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4214
SELECT DISTINCT - NULLIF ( + + col0, - - CAST( NULL AS DECIMAL ) ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - 41 + - col0 IS NOT NULL
----
-15
-91
-92

skipif mysql # not compatible
query I rowsort label-4214
SELECT DISTINCT - NULLIF ( + + col0, - - CAST ( NULL AS REAL ) ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - 41 + - col0 IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 GROUP BY col2, col0 HAVING NOT + 79 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT + ( + - 29 ) IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 WHERE NOT 97 IS NULL GROUP BY col1 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * 99 col0 FROM tab1 AS cor0 GROUP BY col1
----
-4356
-5643
-594

onlyif mysql # DIV for integer division: 
query II rowsort label-4219
SELECT ALL col0 DIV + col0 col1, + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
1
225
1
8281
1
8464

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4219
SELECT ALL col0 / + col0 col1, + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
1
225
1
8281
1
8464

query I rowsort
SELECT - ( - + col0 ) AS col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 WHERE ( NOT - 94 >= NULL ) GROUP BY col1, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4222
SELECT CAST( + 80 AS SIGNED ) AS col2 FROM tab2 GROUP BY col1
----
80
80
80

skipif mysql # not compatible
query I rowsort label-4222
SELECT CAST ( + 80 AS INTEGER ) AS col2 FROM tab2 GROUP BY col1
----
80
80
80

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4223
SELECT - - 8 * - CAST( NULL AS SIGNED ) / - col0 + ( + - col2 ) * + 22 FROM tab1 cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4223
SELECT - - 8 * - CAST ( NULL AS INTEGER ) / - col0 + ( + - col2 ) * + 22 FROM tab1 cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 - col1 col2 FROM tab0 GROUP BY col1, col1
----
-162
0

query I rowsort
SELECT ALL - col1 FROM tab2 WHERE + 87 * + col2 * - col2 IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NULL AND NOT 75 <= NULL
----

query I rowsort
SELECT DISTINCT col0 * 53 + + - col0 FROM tab0 GROUP BY col0, col1
----
1352
2236
4316

query I rowsort
SELECT DISTINCT + col0 + + col2 AS col1 FROM tab2 GROUP BY col0, col2
----
102
150
170

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4228
SELECT ALL + ( col0 ) FROM tab1 GROUP BY col0, col2 HAVING NULL NOT IN ( + col2 / - - 92 / - col2 * - col0, + COALESCE ( + + CAST( - - col2 AS SIGNED ), - col0 ) )
----

skipif mysql # not compatible
query I rowsort label-4228
SELECT ALL + ( col0 ) FROM tab1 GROUP BY col0, col2 HAVING NULL NOT IN ( + col2 / - - 92 / - col2 * - col0, + COALESCE ( + + CAST ( - - col2 AS INTEGER ), - col0 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - + 75 col0, 23 FROM tab1 cor0 GROUP BY col2
----
-75
23
-75
23
-75
23

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 WHERE NULL <> NULL GROUP BY col1 HAVING NULL >= - col1 + + ( 54 ) * + col1
----

query I rowsort
SELECT - - 5 * + + 61 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
305
305
305

query I rowsort
SELECT - + ( col0 ) + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL - - col0 * col0 - + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
492
6795
829

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + 67 + col2 FROM tab2 AS cor0 GROUP BY col2
----
125
146
154

query I rowsort
SELECT col0 * - col0 + + - 39 FROM tab0 AS cor0 GROUP BY col0
----
-1888
-6928
-715

query I rowsort
SELECT 59 FROM tab1 GROUP BY col2
----
59
59
59

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT ( ( NULL = NULL ) )
----

query I rowsort
SELECT ALL - col2 + col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col1 + + 97 FROM tab1 GROUP BY col2, col1
----
103
141
154

query I rowsort
SELECT + 24 + - - 74 * + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1604
-2048
-6044

query II rowsort
SELECT ALL col2 / + - ( col0 ) AS col0, col0 / + col1 AS col0 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 90 + - col1 col1 FROM tab2 cor0 GROUP BY col1
----
29
31
49

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4244
SELECT DISTINCT + - col0 * CAST( - 25 AS SIGNED ) AS col2 FROM tab2 cor0 GROUP BY col0
----
2275
2300
375

skipif mysql # not compatible
query I rowsort label-4244
SELECT DISTINCT + - col0 * CAST ( - 25 AS INTEGER ) AS col2 FROM tab2 cor0 GROUP BY col0
----
2275
2300
375

query I rowsort
SELECT - 63 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-63
-63
-63

onlyif mysql # DIV for integer division: 
query I rowsort label-4246
SELECT ALL + col2 DIV + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4246
SELECT ALL + col2 / + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
1
1
1

query I rowsort
SELECT DISTINCT 0 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col1 * - col1 + + col1 col0, - 28 FROM tab0 cor0 GROUP BY col1, col1
----
0
-28
6642
-28

query II rowsort
SELECT DISTINCT - NULLIF ( 87, + 75 ), col0 + + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= - 77
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4250
SELECT + + col2 / + 80 * - col2 + + ( - col2 ) + - CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4250
SELECT + + col2 / + 80 * - col2 + + ( - col2 ) + - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + - col1 - col1 - + 43 FROM tab1 AS cor0 GROUP BY col1
----
-131
-157
-55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4252
SELECT - CAST( NULL AS SIGNED ) - - - col2 col2 FROM tab2 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4252
SELECT - CAST ( NULL AS INTEGER ) - - - col2 col2 FROM tab2 GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-4253
SELECT ALL - col0 DIV + 85 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-4253
SELECT ALL - col0 / + 85 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL + + col2 * + 67 + + + col2 FROM tab2 AS cor0 WHERE 98 < NULL GROUP BY col2, col2 HAVING - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 95 * - + 10 * + - col0 col1 FROM tab0 GROUP BY col0, col2
----
24700
40850
78850

query I rowsort
SELECT col2 * - 19 AS col2 FROM tab2 GROUP BY col0, col2, col1
----
-1102
-1501
-1653

query II rowsort
SELECT ALL col2 AS col0, + ( - 20 ) FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT col0 - 40 - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-26
-29
-57

query I rowsort
SELECT DISTINCT 17 AS col1 FROM tab1 GROUP BY col1, col1
----
17

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 71 col1 FROM tab2 GROUP BY col2
----
71
71
71

query I rowsort
SELECT - 51 FROM tab0 GROUP BY col2 HAVING NOT - 46 IS NULL
----
-51
-51
-51

query I rowsort
SELECT ALL - + col0 + - col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
-153
-30
-73

query I rowsort
SELECT DISTINCT - 11 AS col0 FROM tab2 cor0 GROUP BY col0, col2
----
-11

query I rowsort
SELECT ALL - + 71 FROM tab0 AS cor0 GROUP BY col1
----
-71
-71

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4266
SELECT col2 * 81 - - CAST( NULL AS SIGNED ) FROM tab0 WHERE + 12 * ( + 32 ) * - 40 + - col1 IS NULL AND NULLIF ( 41, col0 * + col1 ) + col1 IS NOT NULL GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-4266
SELECT col2 * 81 - - CAST ( NULL AS INTEGER ) FROM tab0 WHERE + 12 * ( + 32 ) * - 40 + - col1 IS NULL AND NULLIF ( 41, col0 * + col1 ) + col1 IS NOT NULL GROUP BY col2, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4267
SELECT CAST( NULL AS SIGNED ) + 47 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4267
SELECT CAST ( NULL AS INTEGER ) + 47 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT col2, - col2 / col2 + + - col2 * + + 94 FROM tab1 GROUP BY col2 HAVING 9 < - col2
----

query I rowsort
SELECT ALL + 54 - + + 1 + - 5 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
48
48
48

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NULL <= - + 86
----

query I rowsort
SELECT ALL + col1 * col0 AS col0 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

query I rowsort
SELECT + 7 - col1 * col1 * - - 26 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-43699
-90499
-96739

query I rowsort
SELECT ALL - + 57 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING col0 <> 93
----
-57
-57
-57

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - - 67 IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * + - col1 * 79 col1 FROM tab0 GROUP BY col2, col1, col1
----
-153576
0
0

query I rowsort
SELECT ALL + + 45 - + NULLIF ( + 47, ( col2 ) * col0 ) + + 68 * NULLIF ( col2 * 19, col1 ) * col1 AS col2 FROM tab1 WHERE ( ( + col1 - + col1 IS NOT NULL ) ) GROUP BY col2, col0, col1 HAVING NOT ( - col1 + + col2 ) BETWEEN NULL AND ( + col0 )
----

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4279
SELECT DISTINCT + CAST( NULL AS SIGNED ) - + - 13 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4279
SELECT DISTINCT + CAST ( NULL AS INTEGER ) - + - 13 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

onlyif mysql # DIV for integer division: 
query II rowsort label-4280
SELECT col1 DIV + 88 + - 52 - col1 * - + 6 AS col0, + COALESCE ( - 49, + col1 ) * col1 * 91 + + + ( + ( col1 ) ) AS col1 FROM tab2 GROUP BY col1
----
194
-182778
302
-263022
314
-271938

skipif mysql # not compatible
query II rowsort label-4280
SELECT col1 / + 88 + - 52 - col1 * - + 6 AS col0, + COALESCE ( - 49, + col1 ) * col1 * 91 + + + ( + ( col1 ) ) AS col1 FROM tab2 GROUP BY col1
----
194
-182778
302
-263022
314
-271938

query I rowsort
SELECT DISTINCT + - col1 * - col1 * - - col1 * - - 45 + + col1 + + 91 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + - col1 col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col2, col2
----
-44
-57
-6

query I rowsort
SELECT + 63 + - col1 + col1 FROM tab1 GROUP BY col0, col1
----
63
63
63

query I rowsort
SELECT col0 + + 81 * - + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-1200
-7280
-7360

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4288
SELECT DISTINCT ( - col1 ) FROM tab1 GROUP BY col1 HAVING NOT - CAST( - 55 AS SIGNED ) IS NULL
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-4288
SELECT DISTINCT ( - col1 ) FROM tab1 GROUP BY col1 HAVING NOT - CAST ( - 55 AS INTEGER ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT - col2 + + col2 + col2 AS col2 FROM tab2 AS cor0 WHERE 68 IS NULL GROUP BY col2
----

query I rowsort
SELECT 17 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
58
76
78

query I rowsort
SELECT - col0 * - 64 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 > 12
----
1408
1792
5248

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col2, col1, col1 HAVING NOT NULL < + 26 + + col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4293
SELECT 92 - CAST( NULL AS DECIMAL ) + - col1 FROM tab1 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4293
SELECT 92 - CAST ( NULL AS REAL ) + - col1 FROM tab1 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 + - 98 + + - 81 AS col2 FROM tab2 WHERE NOT 78 * + + 51 * col0 - 95 IN ( - - 36 + - 20 - - - col2, - col1 + + - 92 / + - ( + 77 ) ) GROUP BY col2
----
-100
-121
-92

query II rowsort
SELECT ALL + col2, - col2 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT - - 89 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
89
89
89

query I rowsort
SELECT 21 FROM tab2 AS cor0 WHERE NOT - ( - + 84 ) IS NULL GROUP BY col2
----
21
21
21

query I rowsort
SELECT DISTINCT - col0 + + + 66 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT 49 FROM tab0 AS cor0 GROUP BY col0, col1
----
49
49
49

query I rowsort
SELECT - ( 22 ) FROM tab2 AS cor0 GROUP BY col0 HAVING ( + 42 ) IS NOT NULL
----
-22
-22
-22

query I rowsort
SELECT + col1 * 8 FROM tab1 GROUP BY col1
----
352
456
48

query II rowsort
SELECT col2, - col2 AS col2 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4304
SELECT DISTINCT 83 * + col1 + + + CAST( NULL AS DECIMAL ) FROM tab1 GROUP BY col2, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4304
SELECT DISTINCT 83 * + col1 + + + CAST ( NULL AS REAL ) FROM tab1 GROUP BY col2, col1
----
NULL

query I rowsort
SELECT + - col1 * - - col1 AS col1 FROM tab0 AS cor0 WHERE NULL <> + 42 GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT + col1 * - - ( - col1 ) * - 43 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
282123

query I rowsort
SELECT ALL + 41 * + 55 FROM tab1 WHERE NOT - + col1 <= + col2 + + + col1 GROUP BY col1
----

query I rowsort
SELECT 27 * - ( - 32 ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING - 58 IS NOT NULL
----
864
864
864

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4310
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-4310
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT + col2 - - col2 * + - 80 FROM tab2 GROUP BY col2 HAVING 97 = - AVG ( ALL + col2 )
----

query I rowsort
SELECT DISTINCT 59 AS col0 FROM tab0 GROUP BY col2
----
59

query I rowsort
SELECT - - 1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
1
1
1

query I rowsort
SELECT + col0 / + 98 FROM tab0 GROUP BY col0, col1 HAVING NULL = col0
----

query II rowsort
SELECT ALL - col1 / - col0 / col1 AS col1, - col1 * - col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4316
SELECT ALL - 70 + col0 * col1, - 73 col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING ( NULL ) BETWEEN - - CAST( - 92 AS SIGNED ) AND + col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4316
SELECT ALL - 70 + col0 * col1, - 73 col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING ( NULL ) BETWEEN - - CAST ( - 92 AS INTEGER ) AND + col1
----

query I rowsort
SELECT - + col1 + + 78 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
21
34
72

query I rowsort
SELECT col1 + - 89 AS col1 FROM tab1 WHERE NOT NULLIF ( - + col0, - + ( + 39 ) * + col2 ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + 40 FROM tab1 cor0 GROUP BY col1
----
40
40
40

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4320
SELECT - - col1 + - col1 * AVG ( + col1 ) + - - AVG ( NULLIF ( 25, + CASE col0 WHEN + col0 THEN NULL WHEN col0 THEN - 91 ELSE NULL END * - - col0 + - ( COALESCE ( + col0, 11, 35 ) ) ) ) * CAST( NULL AS SIGNED ) + - col1 AS col2, col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
NULL
1936
NULL
3249
NULL
36

skipif mysql # not compatible
query II rowsort label-4320
SELECT - - col1 + - col1 * AVG ( + col1 ) + - - AVG ( NULLIF ( 25, + CASE col0 WHEN + col0 THEN NULL WHEN col0 THEN - 91 ELSE NULL END * - - col0 + - ( COALESCE ( + col0, 11, 35 ) ) ) ) * CAST ( NULL AS INTEGER ) + - col1 AS col2, col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
NULL
1936
NULL
3249
NULL
36

query I rowsort
SELECT ALL + 75 FROM tab2 AS cor0 GROUP BY col2 HAVING + + 31 IS NULL
----

query I rowsort
SELECT ALL + 44 FROM tab1 AS cor0 GROUP BY col0, col0, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT 20 * - col2 * - 69 * + + 4 FROM tab1 GROUP BY col0, col2
----
248400
391920
44160

query I rowsort
SELECT ALL + - 82 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT 18 FROM tab1 AS cor0 GROUP BY col1
----
18
18
18

query I rowsort
SELECT DISTINCT - 84 FROM tab1 GROUP BY col1 HAVING NULL > + 3
----

query II rowsort
SELECT - 47 AS col1, + 20 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-47
20
-47
20
-47
20

query I rowsort
SELECT - ( - col0 ) AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT 94 FROM tab2 GROUP BY col1
----
94
94
94

query I rowsort
SELECT DISTINCT col1 + - - 34 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
75
93
95

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4331
SELECT - col0 * - - ( + CAST( NULL AS SIGNED ) ) + - + 60 + - 80 col2 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4331
SELECT - col0 * - - ( + CAST ( NULL AS INTEGER ) ) + - + 60 + - 80 col2 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + - col2 * - 45 * + col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
25920
280845
64980

query I rowsort
SELECT col1 + + 95 FROM tab2 GROUP BY col1
----
136
154
156

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4334
SELECT + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + CAST( NULL AS DECIMAL ) / + col1 IS NOT NULL
----
164
44
56

skipif mysql # not compatible
query I rowsort label-4334
SELECT + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + CAST ( NULL AS REAL ) / + col1 IS NOT NULL
----
164
44
56

query I rowsort
SELECT 54 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN NULL AND + col1 GROUP BY col2, col0
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING - + col1 IS NULL
----

query I rowsort
SELECT ALL col2 + - + col2 + + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - 49 FROM tab1 GROUP BY col2
----
-49
-49
-49

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col1 * + col1 + - - col1 col0 FROM tab2 cor0 GROUP BY col1
----
-1640
-3422
-3660

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT NULL = ( NULL ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4341
SELECT ALL - 10 + - col1 FROM tab2 GROUP BY col0, col1 HAVING AVG ( + CAST( - - col0 AS SIGNED ) ) BETWEEN ( + + ( col1 ) * + 4 + - - 37 * ( - 46 + + AVG ( col0 ) * 87 ) ) AND ( NULL )
----

skipif mysql # not compatible
query I rowsort label-4341
SELECT ALL - 10 + - col1 FROM tab2 GROUP BY col0, col1 HAVING AVG ( + CAST ( - - col0 AS INTEGER ) ) BETWEEN ( + + ( col1 ) * + 4 + - - 37 * ( - 46 + + AVG ( col0 ) * 87 ) ) AND ( NULL )
----

query I rowsort
SELECT col1 + + col1 - + col1 AS col0 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL ( + 62 ) * + 11 + col2 + - 81 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
668
706
722

query I rowsort
SELECT + col1 - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 89 + - 68 col2 FROM tab1 GROUP BY col1 HAVING NOT col1 + + - 4 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4346
SELECT ( CAST( - - col2 AS SIGNED ) ) * + 60 FROM tab2 GROUP BY col2 HAVING NOT 90 IS NULL
----
3480
4740
5220

skipif mysql # not compatible
query I rowsort label-4346
SELECT ( CAST ( - - col2 AS INTEGER ) ) * + 60 FROM tab2 GROUP BY col2 HAVING NOT 90 IS NULL
----
3480
4740
5220

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 19 * + ( + + 27 ) col0 FROM tab0 GROUP BY col2 HAVING + 29 + - 77 IS NOT NULL
----
513

query I rowsort
SELECT col2 * + + col2 FROM tab1 GROUP BY col0, col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL - + ( + + col0 ) AS col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - 14 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-14
-14
-14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4351
SELECT - col2 * - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4351
SELECT - col2 * - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT 50 FROM tab2 AS cor0 GROUP BY col2
----
50
50
50

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 98 col0 FROM tab1 GROUP BY col1 HAVING NOT + ( - - col1 ) IS NULL
----
-98
-98
-98

query I rowsort
SELECT - 88 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4355
SELECT ALL + col0 DIV - col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1
-2
0

skipif mysql # not compatible
query I rowsort label-4355
SELECT ALL + col0 / - col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1
-2
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( col0 ) col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col2 * + col0 * + col2 FROM tab1 GROUP BY col2, col0
----
-1408
-413362
-56700

query I rowsort
SELECT + 13 / - col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col0 * 5 + - - col0 AS col2 FROM tab0 GROUP BY col1, col0
----
156
258
498

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4360
SELECT DISTINCT + CAST( - 44 AS SIGNED ) AS col2 FROM tab0 GROUP BY col0, col1
----
-44

skipif mysql # not compatible
query I rowsort label-4360
SELECT DISTINCT + CAST ( - 44 AS INTEGER ) AS col2 FROM tab0 GROUP BY col0, col1
----
-44

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4361
SELECT ALL col0 * - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0 HAVING + 9 IS NULL
----

skipif mysql # not compatible
query I rowsort label-4361
SELECT ALL col0 * - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + 9 IS NULL
----

query I rowsort
SELECT ALL + + AVG ( DISTINCT col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN ( NULL ) AND 29
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4363
SELECT ALL + ( col1 ) * + col1 FROM tab0 AS cor0 WHERE - CAST( - ( col0 ) AS DECIMAL ) NOT IN ( col0, col2 ) GROUP BY col1 HAVING NOT + 86 * - 84 < 39
----

skipif mysql # not compatible
query I rowsort label-4363
SELECT ALL + ( col1 ) * + col1 FROM tab0 AS cor0 WHERE - CAST ( - ( col0 ) AS REAL ) NOT IN ( col0, col2 ) GROUP BY col1 HAVING NOT + 86 * - 84 < 39
----

query I rowsort
SELECT 99 FROM tab2 GROUP BY col1, col1
----
99
99
99

query I rowsort
SELECT + + 90 FROM tab1 cor0 GROUP BY col1, col0
----
90
90
90

query II rowsort
SELECT + 49 * - col1, 76 + 53 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 80 FROM tab2 GROUP BY col0, col0
----
80
80
80

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + + 47 IS NULL
----
0
81

query I rowsort
SELECT - NULLIF ( 22, ( - 48 ) ) FROM tab0 GROUP BY col2
----
-22
-22
-22

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 6 * - ( + - 1 ) col2 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * + col0 + col0 AS col0 FROM tab1 WHERE NOT NULL NOT BETWEEN + col2 AND 80 * + col0 - + NULLIF ( - col2, - col1 ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 + col2 col1 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col2 + + - col2 + - - col2 * col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT 23 + + col2 >= NULL
----

query I rowsort
SELECT ( + col0 ) * + 92 + - - col0 FROM tab2 GROUP BY col0
----
1395
8463
8556

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NOT 86 IS NOT NULL GROUP BY col1 HAVING NOT ( + col1 ) <= ( NULL )
----

query I rowsort
SELECT 1 / - col2 FROM tab0 cor0 WHERE NOT ( NULL ) NOT IN ( + col2 ) GROUP BY col2
----

query I rowsort
SELECT col2 + col2 FROM tab2 GROUP BY col2 HAVING ( + ( col2 ) ) IS NOT NULL
----
116
158
174

onlyif mysql # DIV for integer division: 
query I rowsort label-4378
SELECT - 90 DIV - col2 col1 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4378
SELECT - 90 / - col2 col1 FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL + col0 FROM tab0 WHERE NULL IN ( col0 ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT 76 FROM tab0 GROUP BY col0, col2 HAVING NOT ( - 50 ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 * COALESCE ( COALESCE ( 18, - col2 ) * - 87, 13 ) FROM tab0 AS cor0 WHERE NOT 75 + + col0 >= NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NULL < ( - 17 )
----

query I rowsort
SELECT + - 71 FROM tab0 cor0 GROUP BY col1
----
-71
-71

query I rowsort
SELECT ALL - + 36 * - 49 + + + ( - 43 ) FROM tab0 AS cor0 GROUP BY col1, col1
----
1721
1721

query I rowsort
SELECT ALL - col0 * - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT ALL col0 * - col0 + + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1806
-650
-6806

query I rowsort
SELECT DISTINCT 6 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
6

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4388
SELECT col0 * + CAST( - 20 AS DECIMAL ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + 35 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-4388
SELECT col0 * + CAST ( - 20 AS REAL ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + 35 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4389
SELECT ALL + CAST( - 34 AS SIGNED ) * + - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL BETWEEN - col0 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4389
SELECT ALL + CAST ( - 34 AS INTEGER ) * + - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL BETWEEN - col0 AND NULL
----

query II rowsort
SELECT DISTINCT col2, - 20 FROM tab0 GROUP BY col2
----
24
-20
38
-20
79
-20

query I rowsort
SELECT ALL + + 38 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
38
38
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 GROUP BY col0, col1, col2 HAVING NULL NOT IN ( - - col0 + - col0 - col0 )
----

query II rowsort
SELECT DISTINCT + 16, col1 FROM tab1 GROUP BY col1, col2
----
16
44
16
57
16
6

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NOT ( NULL ) >= - 20 + - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 4 * + 99 - + col2 + col2 * col2 col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
1010
156
5766

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4396
SELECT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL <> + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-4396
SELECT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL <> + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 WHERE NOT + + col1 / - - 51 * 27 - 99 NOT IN ( + ( + col0 ) - + 9 ) GROUP BY col2, col1, col0
----

query I rowsort
SELECT 6 FROM tab2 GROUP BY col2 HAVING ( NOT NULL IS NOT NULL )
----
6
6
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 GROUP BY col0 HAVING + col0 <> NULL
----

query I rowsort
SELECT - - 33 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - col1 IS NULL
----

query II rowsort
SELECT DISTINCT 82 * + - col2 / + col2 - + - ( - 30 ), + 16 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL <> col2
----

query I rowsort
SELECT ALL - + 93 FROM tab2 AS cor0 GROUP BY col1, col2
----
-93
-93
-93

query I rowsort
SELECT DISTINCT 35 FROM tab0 AS cor0 GROUP BY col1, col1
----
35

query I rowsort
SELECT + 42 + col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
124
64
70

query I rowsort
SELECT DISTINCT + 15 AS col0 FROM tab1 GROUP BY col0, col1 HAVING ( 54 ) IS NOT NULL
----
15

query I rowsort
SELECT ALL - - 84 FROM tab1 AS cor0 GROUP BY col2
----
84
84
84

query II rowsort
SELECT - col1, + col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT ALL 84 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
84
84
84

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4410
SELECT DISTINCT - col0 * - 92 FROM tab0 WHERE NOT ( CAST( NULL AS SIGNED ) ) IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-4410
SELECT DISTINCT - col0 * - 92 FROM tab0 WHERE NOT ( CAST ( NULL AS INTEGER ) ) IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * + 46 FROM tab2 GROUP BY col0
----
4186
4232
690

query I rowsort
SELECT + col1 * col1 FROM tab2 WHERE NOT col1 >= + col0 / 32 GROUP BY col1
----

query I rowsort
SELECT DISTINCT + ( - ( + 95 ) ) + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4414
SELECT ALL col0 FROM tab1 WHERE ( + CAST( NULL AS SIGNED ) / - col0 ) <= ( col0 ) GROUP BY col0 HAVING NOT 18 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4414
SELECT ALL col0 FROM tab1 WHERE ( + CAST ( NULL AS INTEGER ) / - col0 ) <= ( col0 ) GROUP BY col0 HAVING NOT 18 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST( NULL AS SIGNED ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST ( NULL AS INTEGER ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

query I rowsort
SELECT 52 FROM tab0 GROUP BY col1, col0, col1 HAVING col0 <= ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col1, col2, col0
----
24
38
79

query I rowsort
SELECT col0 FROM tab1 GROUP BY col2, col0, col1, col0
----
22
28
82

query I rowsort
SELECT + 31 AS col0 FROM tab2 GROUP BY col0, col0, col1
----
31
31
31

query I rowsort
SELECT - 93 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT ( col0 ) <= + col0
----

query I rowsort
SELECT ( col2 ) FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - ( col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL <= NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-4423
SELECT ALL col1 - - col1 * 55, + col1 DIV + - 3 AS col0 FROM tab1 WHERE 6 * + 6 <> - - col0 GROUP BY col1
----
2464
-14
3192
-19
336
-2

skipif mysql # not compatible
query II rowsort label-4423
SELECT ALL col1 - - col1 * 55, + col1 / + - 3 AS col0 FROM tab1 WHERE 6 * + 6 <> - - col0 GROUP BY col1
----
2464
-14
3192
-19
336
-2

onlyif mysql # DIV for integer division: 
query I rowsort label-4424
SELECT ALL - - col2 + - col2 - - + col2 DIV + col2 + col2 * - 23 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1034
-1632
-183

skipif mysql # not compatible
query I rowsort label-4424
SELECT ALL - - col2 + - col2 - - + col2 / + col2 + col2 * - 23 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1034
-1632
-183

query II rowsort
SELECT ALL col0 * + col0 + + - col0 AS col2, 35 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col0 HAVING - 14 * - 35 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4426
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4426
SELECT CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col1 + - + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-2
-27
12

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 47 col0 FROM tab2 GROUP BY col1
----
47
47
47

query I rowsort
SELECT ALL + ( - col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - 26 AS col0 FROM tab0 GROUP BY col2, col1
----
-26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 - - - col1, col1 * - - 39 col2 FROM tab2 GROUP BY col1
----
-118
2301
-122
2379
-82
1599

query I rowsort
SELECT ALL ( - 62 ) AS col0 FROM tab2 GROUP BY col1
----
-62
-62
-62

query I rowsort
SELECT col1 - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4435
SELECT col1 col0 FROM tab2 GROUP BY col1 HAVING NOT 46 + + CAST( NULL AS SIGNED ) <> - - col1 - + 33
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4435
SELECT col1 col0 FROM tab2 GROUP BY col1 HAVING NOT 46 + + CAST ( NULL AS INTEGER ) <> - - col1 - + 33
----

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + 58 IS NULL
----
22
28
82

query I rowsort
SELECT ALL + 81 * col0 * + - col0 AS col2 FROM tab0 cor0 WHERE + 23 + - - 0 BETWEEN COALESCE ( - col2, col1 ) AND ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - col1 >= - - 85
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4439
SELECT col2 AS col0, + CAST( + + 11 AS SIGNED ) col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4439
SELECT col2 AS col0, + CAST ( + + 11 AS INTEGER ) col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT + + ( - 17 ) * - col2 + col2 - 11 FROM tab1 AS cor0 GROUP BY col2 HAVING - 76 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 * + - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
1260
176
5822

query II rowsort
SELECT col2, ( - + col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT 91 IS NULL
----
24
-24
38
-38
79
-79

query I rowsort
SELECT ( + + col2 ) / 62 - + - col0 * + 84 * ( - col2 ) FROM tab2 GROUP BY col0, col2 HAVING NOT - col2 <= NULL
----

query I rowsort
SELECT ALL ( + 90 ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
90
90

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL > + 42
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4446
SELECT ALL + col1 DIV ( 73 ) AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-4446
SELECT ALL + col1 / ( 73 ) AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
1

query I rowsort
SELECT ALL - 30 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-30
-30
-30

query I rowsort
SELECT DISTINCT 46 FROM tab2 AS cor0 GROUP BY col0
----
46

query II rowsort
SELECT ALL - - 97, col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
97
24
97
38
97
79

query I rowsort
SELECT - 53 * + - 51 AS col0 FROM tab0 cor0 GROUP BY col2
----
2703
2703
2703

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4452
SELECT - - CAST( NULL AS SIGNED ) * - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - col0 = NULL
----

skipif mysql # not compatible
query I rowsort label-4452
SELECT - - CAST ( NULL AS INTEGER ) * - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - col0 = NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT col1 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-4454
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - CAST( - 24 AS SIGNED ) > - - 11 OR - CAST( NULL AS DECIMAL ) IS NOT NULL
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-4454
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - CAST ( - 24 AS INTEGER ) > - - 11 OR - CAST ( NULL AS REAL ) IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT 47 AS col0 FROM tab0 GROUP BY col2, col1
----
47
47
47

query II rowsort
SELECT 79 + + - col0 AS col0, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + 68 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
68
68
68

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 57 col0 FROM tab0 WHERE ( + + col0 ) IN ( - COALESCE ( + 1, col1 * - + col2 ), - 87 ) GROUP BY col2 HAVING NOT + 14 < ( NULL )
----

query II rowsort
SELECT col0 AS col2, 93 * + col2 + col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4460
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4460
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col1
----
NULL

query I rowsort
SELECT + col1 * ( + col1 ) AS col0 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + col0 * - col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 63 * col1 * - + col1 * - + 22 + - ( + col1 ) col0 FROM tab2 AS cor0 GROUP BY col1
----
2329825
4824607
5157245

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 59 FROM tab1 GROUP BY col0
----
-59
-59
-59

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING + + 12 IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT col0 + + 96 AS col1 FROM tab2 GROUP BY col0
----
111
187
188

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4469
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST( NULL AS DECIMAL ) > + col2
----

skipif mysql # not compatible
query I rowsort label-4469
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST ( NULL AS REAL ) > + col2
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 - 84 FROM tab2 AS cor0 GROUP BY col1
----
-23
-25
-43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4472
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING + CAST( ( col0 ) AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-4472
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING + CAST ( ( col0 ) AS INTEGER ) IS NULL
----

query I rowsort
SELECT + col1 / - col1 * col1 FROM tab0 GROUP BY col1 HAVING + col1 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 * 98 * + COALESCE ( + 7, - col2 ) - col1 * col1 AS col1 FROM tab0 GROUP BY col1
----
0
49005

onlyif mysql # DIV for integer division: 
query I rowsort label-4475
SELECT ALL + 95 * + col1 DIV + col1 + - ( 13 ) FROM tab1 GROUP BY col1, col1
----
82
82
82

skipif mysql # not compatible
query I rowsort label-4475
SELECT ALL + 95 * + col1 / + col1 + - ( 13 ) FROM tab1 GROUP BY col1, col1
----
82
82
82

query I rowsort
SELECT + col2 / col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( col1 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4477
SELECT ALL + - CAST( NULL AS SIGNED ) FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4477
SELECT ALL + - CAST ( NULL AS INTEGER ) FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col2 / col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 * + - 89 col0 FROM tab1 AS cor0 GROUP BY col1
----
3916
5073
534

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
58
79
87

query I rowsort
SELECT ALL + ( - ( 18 ) ) FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL NOT IN ( + col2 )
----

query I rowsort
SELECT ALL col1 + + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT - 82 + + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-3
-44
-58

query I rowsort
SELECT ALL ( - col2 ) * 93 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-134292
-53568
-580413

query I rowsort
SELECT + 63 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND + col2
----

query I rowsort
SELECT + + col0 * + 3 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
246
66
84

query I rowsort
SELECT 46 * + col1 - - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
3807

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT - 93 FROM tab0 GROUP BY col1, col0 HAVING ( + + col1 ) NOT BETWEEN + 48 AND NULL
----
-93

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL <= ( NULL )
----

query I rowsort
SELECT ALL - 21 / col2 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NOT 36 IS NOT NULL
----

query I rowsort
SELECT 18 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NULL <> ( + col2 )
----

query I rowsort
SELECT 95 * + 27 AS col2 FROM tab2 WHERE NOT 67 NOT IN ( - - 24 ) GROUP BY col0 HAVING NOT - 70 IS NULL
----

query I rowsort
SELECT 79 AS col2 FROM tab2 GROUP BY col2 HAVING + + 70 <= NULL
----

query I rowsort
SELECT - 57 AS col1 FROM tab0 WHERE NOT - ( col0 ) * - 29 NOT BETWEEN col2 + col2 AND NULL GROUP BY col0, col2 HAVING NOT ( 29 * col2 ) IS NOT NULL
----

query I rowsort
SELECT - - 79 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * - col0 FROM tab2 AS cor0 WHERE NOT col0 NOT BETWEEN col2 AND NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - 1 AS col1 FROM tab2 cor0 GROUP BY col2, col1
----
-1

query I rowsort
SELECT DISTINCT ( col2 ) AS col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 + - + col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - + ( + + col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 68 * - col2 AS col2 FROM tab2 GROUP BY col0, col2 HAVING - + 73 NOT BETWEEN NULL AND col0
----

query I rowsort
SELECT DISTINCT 3 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL <> col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4504
SELECT ALL - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4504
SELECT ALL - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 99 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL ) > + 80
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST( col0 AS SIGNED ) ) GROUP BY col0 HAVING NOT CAST( NULL AS SIGNED ) <= ( - col1 + + col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST ( col0 AS INTEGER ) ) GROUP BY col0 HAVING NOT CAST ( NULL AS INTEGER ) <= ( - col1 + + col1 )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - 26 + - col1 FROM tab0 GROUP BY col1
----
-107
-26

query I rowsort
SELECT DISTINCT - + 49 * + + ( - 85 ) FROM tab1 cor0 GROUP BY col0 HAVING + 9 + + 71 = ( - - 67 )
----

query I rowsort
SELECT ALL - col2 * - col2 FROM tab0 GROUP BY col2 HAVING NOT + col2 = NULL
----

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab0 cor0 GROUP BY col1, col0
----
0

query I rowsort
SELECT ALL 48 * + 85 AS col2 FROM tab2 GROUP BY col2 HAVING NOT - ( + 56 ) <= ( 15 * col2 )
----

query I rowsort
SELECT + COALESCE ( - 51, - 82 * 76, + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
-51
-51
-51

query I rowsort
SELECT col1 + - ( col1 + + 22 * col1 ) FROM tab1 GROUP BY col1
----
-1254
-132
-968

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4515
SELECT CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2 HAVING NULL < 51
----

skipif mysql # not compatible
query I rowsort label-4515
SELECT CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2 HAVING NULL < 51
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
-81
0

query I rowsort
SELECT 94 FROM tab0 GROUP BY col0
----
94
94
94

onlyif mysql # DIV for integer division: 
query I rowsort label-4518
SELECT - col2 + + - 4 DIV - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-4518
SELECT - col2 + + - 4 / - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query II rowsort
SELECT - col2 AS col1, col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT + COALESCE ( 69, - col1 ) AS col2 FROM tab1 cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4521
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING + + CAST( - - 24 AS SIGNED ) IS NOT NULL
----
44
57
6

skipif mysql # not compatible
query I rowsort label-4521
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING + + CAST ( - - 24 AS INTEGER ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + - 19 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4523
SELECT col0 * + ( + CAST( NULL AS SIGNED ) ) - 36 + + 8 + - 82 + - 84 + - col0 + - - col0, 0 AS col1 FROM tab1 AS cor0 WHERE NULL BETWEEN ( NULL ) AND NULL GROUP BY col0
----

skipif mysql # not compatible
query II rowsort label-4523
SELECT col0 * + ( + CAST ( NULL AS INTEGER ) ) - 36 + + 8 + - 82 + - 84 + - col0 + - - col0, 0 AS col1 FROM tab1 AS cor0 WHERE NULL BETWEEN ( NULL ) AND NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 67 col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
67
67
67

query I rowsort
SELECT ALL - + col2 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING ( col1 ) = + 42 * col0 * + col0
----

query I rowsort
SELECT ALL + col1 * 47 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col1
----
1927
2773
2867

onlyif mysql # DIV for integer division: 
query I rowsort label-4528
SELECT DISTINCT 42 DIV + 61 FROM tab0 GROUP BY col0
----
0

skipif mysql # not compatible
query I rowsort label-4528
SELECT DISTINCT 42 / + 61 FROM tab0 GROUP BY col0
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4529
SELECT + - CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4529
SELECT + - CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 72 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4531
SELECT + CAST( + 5 AS SIGNED ) AS col1 FROM tab1 cor0 GROUP BY col2
----
5
5
5

skipif mysql # not compatible
query I rowsort label-4531
SELECT + CAST ( + 5 AS INTEGER ) AS col1 FROM tab1 cor0 GROUP BY col2
----
5
5
5

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT + - col1 + - col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 * + - ( + 43 ) AS col2 FROM tab0 GROUP BY col0, col2
----
-1032
-1634
-3397

query I rowsort
SELECT DISTINCT col2 * col2 - - - col2 - col2 + col2 * col2 * + + col2 + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
198418
499201
665985

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + 10 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
10

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4539
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN NULLIF ( col2, + - col2 ) + col2 + - 85 / col2 * + ( - - 48 ) AND - col2 GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-4539
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN NULLIF ( col2, + - col2 ) + col2 + - 85 / col2 * + ( - - 48 ) AND - col2 GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + ( + + 75 ) FROM tab0 cor0 GROUP BY col1
----
75

query I rowsort
SELECT DISTINCT - col0 * 4 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NOT + col1 <= NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col0 * + col2 - - col0 FROM tab1 GROUP BY col2, col0, col2 HAVING NULL IS NULL
----
1288
198
5904

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4544
SELECT ALL - col0 + CAST( CASE + + 77 WHEN 1 THEN - col0 END AS SIGNED ) * + 60 AS col2, col0 AS col2 FROM tab2 WHERE - + col0 IS NOT NULL GROUP BY col0
----
NULL
15
NULL
91
NULL
92

skipif mysql # not compatible
query II rowsort label-4544
SELECT ALL - col0 + CAST ( CASE + + 77 WHEN 1 THEN - col0 END AS INTEGER ) * + 60 AS col2, col0 AS col2 FROM tab2 WHERE - + col0 IS NOT NULL GROUP BY col0
----
NULL
15
NULL
91
NULL
92

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0, col1, col1
----
15
91
92

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 AS cor0 WHERE NOT col1 IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT - 34 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-34
-34
-34

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4548
SELECT DISTINCT CAST( ( - 67 ) AS SIGNED ) + + - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-149
-89
-95

skipif mysql # not compatible
query I rowsort label-4548
SELECT DISTINCT CAST ( ( - 67 ) AS INTEGER ) + + - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-149
-89
-95

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col2 * col2 + - ( col1 ) col0, col2 * col2 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1444
54872
-6241
493039
-657
13824

query II rowsort
SELECT col0, 68 * - col0 + - 28 AS col0 FROM tab0 GROUP BY col0
----
26
-1796
43
-2952
83
-5672

query I rowsort
SELECT DISTINCT 45 FROM tab0 GROUP BY col2
----
45

query I rowsort
SELECT DISTINCT - 3 + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
21
35
76

query I rowsort
SELECT DISTINCT 15 FROM tab0 GROUP BY col1, col1
----
15

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT ( - 28 ) IS NULL
----
-81
0

query I rowsort
SELECT 98 FROM tab0 GROUP BY col2 HAVING NOT - + col2 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4556
SELECT ALL CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col0 HAVING - 17 * + col2 * - 10 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4556
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col0 HAVING - 17 * + col2 * - 10 IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 + - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-11
-14
17

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST( + col0 AS SIGNED ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST ( + col0 AS INTEGER ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT - + 68 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
-68
-68
-68

query I rowsort
SELECT DISTINCT - ( + - col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT - col2 * + 91 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-5278
-7189
-7917

query I rowsort
SELECT + 31 FROM tab2 GROUP BY col0, col0 HAVING NOT + col0 = NULL
----

query I rowsort
SELECT + col2 * - - col2 + 95 + + col2 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
10177
223
4145

query I rowsort
SELECT - - col0 - - 93 * - + col2 FROM tab1 WHERE NOT NULL BETWEEN - - col1 AND - col1 GROUP BY col2, col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 62 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NULL <> + 68 * + COALESCE ( 83, - ( 17 ) + + - col0 )
----

query I rowsort
SELECT ALL col1 * - + col1 AS col0 FROM tab1 GROUP BY col1 HAVING ( - col1 ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 * - 43 FROM tab1 AS cor0 GROUP BY col2, col2, col0
----
-1935
-3053
-344

query I rowsort
SELECT col2 * + col2 FROM tab0 GROUP BY col2, col0
----
1444
576
6241

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + - 58 FROM tab2 AS cor0 GROUP BY col1
----
-58
-58
-58

query I rowsort
SELECT ALL + + col2 * - 61 - - col2 / + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4572
SELECT col0 col2, CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
92
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4572
SELECT col0 col2, CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
92
NULL

query I rowsort
SELECT + - col0 + + col0 + - - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
484
6724
784

query I rowsort
SELECT - col0 * + col0 + col0 - - 97 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1709
-553
-6709

onlyif mysql # DIV for integer division: 
query I rowsort label-4575
SELECT + COALESCE ( - col0, - 30 ) DIV - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4575
SELECT + COALESCE ( - col0, - 30 ) / - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT + + col1 * 56 FROM tab1 AS cor0 GROUP BY col1, col1
----
2464
3192
336

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - 7 * + col1 * - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL >= - col0
----

query I rowsort
SELECT - 33 FROM tab2 GROUP BY col2
----
-33
-33
-33

onlyif mysql # DIV for integer division: 
query I rowsort label-4579
SELECT - 75 DIV + - 71 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT ( NOT ( ( + 62 ) > - col1 + + 76 ) )
----
1
1

skipif mysql # not compatible
query I rowsort label-4579
SELECT - 75 / + - 71 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT ( NOT ( ( + 62 ) > - col1 + + 76 ) )
----
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 AS col1, 25 col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
58
25
79
25
87
25

query I rowsort
SELECT ALL ( + col2 ) FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 WHERE NOT + 46 > NULL GROUP BY col1, col0, col1 HAVING - + col1 * + - col1 IS NULL
----

query I rowsort
SELECT col0 - + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
182
184
30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4584
SELECT DISTINCT CAST( - - 43 AS SIGNED ) AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-4584
SELECT DISTINCT CAST ( - - 43 AS INTEGER ) AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4586
SELECT ALL CAST( NULL AS SIGNED ) - col1 * - AVG ( + 13 ) col0, col1 AS col2 FROM tab1 GROUP BY col1, col1
----
NULL
44
NULL
57
NULL
6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4586
SELECT ALL CAST ( NULL AS INTEGER ) - col1 * - AVG ( + 13 ) col0, col1 AS col2 FROM tab1 GROUP BY col1, col1
----
NULL
44
NULL
57
NULL
6

query I rowsort
SELECT ALL 39 + col1 FROM tab2 GROUP BY col1
----
100
80
98

query II rowsort
SELECT col0 AS col2, - 11 FROM tab2 GROUP BY col0, col2 HAVING NOT - 15 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4589
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4589
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 + - - col2 * + col2 + - - 73 AS col0 FROM tab2 AS cor0 WHERE - col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col2 * + + col1 * + col2 * - 61 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
2846016

query I rowsort
SELECT DISTINCT + 67 AS col0 FROM tab1 AS cor0 WHERE ( + - col2 ) IS NOT NULL GROUP BY col0, col2, col0
----
67

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 cor0 GROUP BY col1
----
-6642
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 94 col2 FROM tab2 AS cor0 GROUP BY col0
----
94

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * - - col1 AS col2 FROM tab1 GROUP BY col1, col2
----
-1936
-3249
-36

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4598
SELECT - col0 AS col0, + CAST( + col0 AS SIGNED ) AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
-22
22
-28
28
-82
82

skipif mysql # not compatible
query II rowsort label-4598
SELECT - col0 AS col0, + CAST ( + col0 AS INTEGER ) AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT - col2 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-4600
SELECT + + col2 * col2 DIV col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-4600
SELECT + + col2 * col2 / col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4601
SELECT DISTINCT + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - 39 + + - 7 + 3 ) NOT BETWEEN - 83 AND - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-4601
SELECT DISTINCT + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - 39 + + - 7 + 3 ) NOT BETWEEN - 83 AND - CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-4602
SELECT DISTINCT - col1 AS col0, + CAST( NULL AS DECIMAL ) + + - col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
NULL
-59
NULL
-61
NULL

skipif mysql # not compatible
query II rowsort label-4602
SELECT DISTINCT - col1 AS col0, + CAST ( NULL AS REAL ) + + - col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
NULL
-59
NULL
-61
NULL

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT ALL - NULLIF ( + col1, 44 ) AS col0 FROM tab1 GROUP BY col0, col1
----
-57
-6
NULL

query I rowsort
SELECT + 26 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
26
26
26

query I rowsort
SELECT ALL col0 + 86 FROM tab1 GROUP BY col0
----
108
114
168

query I rowsort
SELECT + 1 FROM tab2 cor0 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) >= NULL AND + ( 56 ) IS NULL
----

query I rowsort
SELECT DISTINCT + 67 FROM tab2 GROUP BY col0, col0
----
67

query I rowsort
SELECT DISTINCT 5 - - 36 + + col0 FROM tab2 GROUP BY col0, col0
----
132
133
56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4611
SELECT col1 + CAST( - col1 AS SIGNED ) + - col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-4611
SELECT col1 + CAST ( - col1 AS INTEGER ) + - col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col0 * 47 FROM tab2 GROUP BY col0
----
4277
4324
705

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 / - - col0 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 AS cor0 WHERE NOT + 7 IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
-118
-122
-82

query I rowsort
SELECT ALL + ( col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT 39 AS col1 FROM tab0 GROUP BY col1
----
39

query II rowsort
SELECT + + col2, col2 + + col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
174
79
237
87
261

onlyif mysql # DIV for integer division: 
query I rowsort label-4619
SELECT - col1 DIV - col1 + - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-4619
SELECT - col1 / - col1 + - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-40
-58
-60

query I rowsort
SELECT col2 * + 47 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL < - col2
----

query II rowsort
SELECT + col1, ( col0 ) AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NULL ) BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4622
SELECT ALL col1 * col1 DIV + 53 + + 3 AS col1 FROM tab0 GROUP BY col1
----
126
3

skipif mysql # not compatible
query I rowsort label-4622
SELECT ALL col1 * col1 / + 53 + + 3 AS col1 FROM tab0 GROUP BY col1
----
126
3

query I rowsort
SELECT col2 + col2 FROM tab2 WHERE col0 + col1 < - ( + NULLIF ( - 72, + + 40 ) ) GROUP BY col2
----

query II rowsort
SELECT - - 33 + 5 AS col2, 56 * + 34 FROM tab1 AS cor0 GROUP BY col0
----
38
1904
38
1904
38
1904

query I rowsort
SELECT ALL - - col2 * col2 + + 51 + 31 + col2 + col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
1564
6402
763

query I rowsort
SELECT + 73 AS col0 FROM tab1 WHERE - col1 / - col1 <= - + 47 GROUP BY col1
----

query I rowsort
SELECT - 31 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-31
-31

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col0, col1, col2
----
-24
-38
-79

query II rowsort
SELECT 37 + + + col1 - + - col0 / - col1 + - - COALESCE ( + 73, col0 ) AS col1, + col1 + + col0 FROM tab2 GROUP BY col2, col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 14 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING - + 82 * - - col0 IS NULL
----

query I rowsort
SELECT ALL + col0 - - - 98 * - - col0 AS col1 FROM tab0 GROUP BY col0 HAVING - 66 IS NOT NULL
----
-2522
-4171
-8051

onlyif mysql # DIV for integer division: 
query I rowsort label-4632
SELECT col1 DIV - + ( - 78 ) col2 FROM tab0 GROUP BY col1
----
0
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4632
SELECT col1 / - + ( - 78 ) col2 FROM tab0 GROUP BY col1
----
0
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 + - col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT ALL col1 + COALESCE ( + - 82, + col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-25
-38
-76

query I rowsort
SELECT ALL + 55 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - - 99 * + col2 * col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT - 78 * + + 30 >= ( - col2 )
----
124740
17424
576378

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4637
SELECT + CASE - - 35 WHEN 60 THEN - - COALESCE ( - col1, CAST( NULL AS DECIMAL ) ) / - 13 END * col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4637
SELECT + CASE - - 35 WHEN 60 THEN - - COALESCE ( - col1, CAST ( NULL AS REAL ) ) / - 13 END * col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT - col1 AS col1, + ( + ( + ( col0 ) ) ) * - - 2 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL >= - 74 * + 65
----

query I rowsort
SELECT DISTINCT ( col0 ) AS col0 FROM tab0 WHERE + - col0 IS NOT NULL GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 28 col2 FROM tab1 GROUP BY col0
----
28
28
28

query I rowsort
SELECT + col1 - + + col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - 10 FROM tab1 GROUP BY col2
----
-10
-10
-10

query I rowsort
SELECT ALL + 7 FROM tab0 GROUP BY col0, col0 HAVING NOT + + col0 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4645
SELECT + CAST( NULL AS SIGNED ) + - 82 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4645
SELECT + CAST ( NULL AS INTEGER ) + - 82 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT + 70 FROM tab1 GROUP BY col1, col2, col1
----
70
70
70

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 * + col2 col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 * + 99 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
8019

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( + + ( + 22 ), + - 99 * + - CASE + - col0 WHEN - col0 THEN - col2 ELSE NULL END * + col0 - + col0 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
22
22
22

query I rowsort
SELECT - 1 - + col0 FROM tab1 AS cor0 GROUP BY col0
----
-23
-29
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4651
SELECT - ( + AVG ( ALL + CAST( + - col1 AS SIGNED ) ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-4651
SELECT - ( + AVG ( ALL + CAST ( + - col1 AS INTEGER ) ) ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL - - 36 * - 61 + - col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2220
-2234
-2275

query I rowsort
SELECT DISTINCT ( - col1 ) AS col0 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 54 col1 FROM tab0 cor0 GROUP BY col2, col2
----
54

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col0 * + - 38 * - 68 FROM tab0 AS cor0 GROUP BY col0
----
111112
214472
67184

query I rowsort
SELECT - 35 * col2 FROM tab1 GROUP BY col2, col1
----
-1575
-2485
-280

onlyif mysql # DIV for integer division: 
query II rowsort label-4658
SELECT + col2 + - col2 DIV - col2, col2 FROM tab2 WHERE - - col1 + + + col2 * - col2 IS NOT NULL GROUP BY col2 HAVING - 6 IS NOT NULL
----
59
58
80
79
88
87

skipif mysql # not compatible
query II rowsort label-4658
SELECT + col2 + - col2 / - col2, col2 FROM tab2 WHERE - - col1 + + + col2 * - col2 IS NOT NULL GROUP BY col2 HAVING - 6 IS NOT NULL
----
59
58
80
79
88
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + 95 col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-95

query I rowsort
SELECT 16 FROM tab1 cor0 GROUP BY col0
----
16
16
16

query I rowsort
SELECT + 50 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-11
-9
9

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 7 + - col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT NULL BETWEEN + - COALESCE ( + - 37, - col1 - - + col1 ) AND col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2 + + CASE + - 82 WHEN - 28 THEN - col0 + - col2 END AS col1, - col1 / + col1 FROM tab0 GROUP BY col1, col2 HAVING + col1 > col1
----

query II rowsort
SELECT - col0 AS col0, 54 AS col0 FROM tab2 GROUP BY col0, col0, col0
----
-15
54
-91
54
-92
54

query I rowsort
SELECT + ( 25 ) FROM tab0 AS cor0 GROUP BY col0
----
25
25
25

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 WHERE NOT 62 IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT + + 41 + + 15 * - 65 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
21491
27341
79991

query I rowsort
SELECT ALL + col1 * - col1 + - AVG ( ALL + - 82 ) * - col1 - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - 27 * + col1 / - 62 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + 63 - - col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0
----
-20
-37
20

onlyif mysql # DIV for integer division: 
query I rowsort label-4672
SELECT + col2 DIV + + col2 AS col0 FROM tab0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4672
SELECT + col2 / + + col2 AS col0 FROM tab0 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT DISTINCT - 30 AS col0 FROM tab2 GROUP BY col2, col0
----
-30

query I rowsort
SELECT DISTINCT - ( + - col2 ) FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL < + + col0
----

query I rowsort
SELECT col1 * + + col1 FROM tab2 cor0 GROUP BY col0, col1, col1 HAVING NOT + 56 > + 45
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 WHERE NOT + 58 * + 43 IS NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4677
SELECT - col1 - + + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( - col0 * + + col0 + - col1 ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4677
SELECT - col1 - + + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( - col0 * + + col0 + - col1 ) IS NOT NULL
----
NULL
NULL
NULL

query II rowsort
SELECT ALL - col0 AS col0, - col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-6
-28
-57
-82
-44

query I rowsort
SELECT DISTINCT + NULLIF ( 10, 73 ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
10

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 30 FROM tab1 GROUP BY col2, col1
----
-30
-30
-30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 13 col0, - col2 AS col0 FROM tab0 GROUP BY col2
----
13
-24
13
-38
13
-79

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE NOT + 23 * - - col1 * + - col2 IS NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT 69 FROM tab1 GROUP BY col1
----
69
69
69

query II rowsort
SELECT DISTINCT - - col0 AS col1, 40 FROM tab1 AS cor0 GROUP BY col0 HAVING 18 + - ( - 57 ) IS NOT NULL
----
22
40
28
40
82
40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab2 WHERE ( - 24 + + - 24 NOT IN ( col0, col2 ) ) GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - 20 FROM tab1 AS cor0 GROUP BY col1
----
-20
-20
-20

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4688
SELECT - 6 * - + col1 / ( - - CAST( 68 AS SIGNED ) ) * - + col2 + + 77 AS col0 FROM tab1 cor0 WHERE NOT ( - 67 ) IS NOT NULL GROUP BY col2, col1 HAVING ( + 85 ) IN ( 19 )
----

skipif mysql # not compatible
query I rowsort label-4688
SELECT - 6 * - + col1 / ( - - CAST ( 68 AS INTEGER ) ) * - + col2 + + 77 AS col0 FROM tab1 cor0 WHERE NOT ( - 67 ) IS NOT NULL GROUP BY col2, col1 HAVING ( + 85 ) IN ( 19 )
----

query I rowsort
SELECT 84 * col0 * + col0 * 76 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
11804016
4315584
43979376

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col0 AS col0, col0 * + col0 col0 FROM tab1 cor0 GROUP BY col0
----
22
484
28
784
82
6724

query I rowsort
SELECT DISTINCT + col2 * col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NOT NULL < NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4693
SELECT DISTINCT + 13 * + CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-4693
SELECT DISTINCT + 13 * + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - col2 * - + col2 * 85 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
122740
48960
530485

query I rowsort
SELECT DISTINCT - + col1 * - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - ( col1 ) * - 24 col2 FROM tab1 AS cor0 WHERE NOT NULL NOT IN ( col0, + NULLIF ( + - ( col1 ), col1 + - col2 ) * + - 25 ) GROUP BY col1
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT + - col2 IS NOT NULL
----

query I rowsort
SELECT + col0 + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING - + 91 + 11 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4702
SELECT ( - + CAST( NULL AS SIGNED ) ) AS col0 FROM tab2 GROUP BY col1, col2 HAVING - CAST( NULL AS SIGNED ) NOT BETWEEN - 27 AND NULL
----

skipif mysql # not compatible
query I rowsort label-4702
SELECT ( - + CAST ( NULL AS INTEGER ) ) AS col0 FROM tab2 GROUP BY col1, col2 HAVING - CAST ( NULL AS INTEGER ) NOT BETWEEN - 27 AND NULL
----

query II rowsort
SELECT DISTINCT + 81 AS col1, + 50 AS col1 FROM tab1 GROUP BY col0
----
81
50

query I rowsort
SELECT + 24 AS col0 FROM tab1 cor0 GROUP BY col1
----
24
24
24

query I rowsort
SELECT + col0 * - col0 - + col0 / + 2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL 38 * 11 + col1 FROM tab1 GROUP BY col1
----
424
462
475

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING ( - col1 NOT BETWEEN + col1 AND - + 99 * col1 )
----
-22
-28
-82

query I rowsort
SELECT + ( - col0 ) FROM tab2 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING + col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL = NULL
----

query II rowsort
SELECT DISTINCT + col0, col0 * - 99 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT - 76 IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 WHERE + CASE col1 WHEN + col1 THEN 27 ELSE - col1 END NOT BETWEEN ( - ( - col0 ) ) AND NULL GROUP BY col1
----
41
59

query I rowsort
SELECT 26 AS col2 FROM tab0 GROUP BY col0, col0
----
26
26
26

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col1, col0, col2
----
22
28
82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT - ( + 59 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4716
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col1 HAVING NULL NOT BETWEEN ( 41 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-4716
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col1 HAVING NULL NOT BETWEEN ( 41 ) AND NULL
----

query I rowsort
SELECT DISTINCT ( - col2 ) AS col1 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT col2 - ( 8 ) * col2 FROM tab1 GROUP BY col2 HAVING NULL = ( 21 ) + 79
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 WHERE ( + - col1 ) IS NOT NULL GROUP BY col2, col1, col2 HAVING ( - 82 ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col1 - col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0

query I rowsort
SELECT + 60 AS col2 FROM tab0 GROUP BY col0, col0, col0 HAVING ( NULL ) BETWEEN col0 * + 31 AND ( NULL )
----

query II rowsort
SELECT - 9 AS col2, - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING ( NULL ) BETWEEN col1 AND - col0 * - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col1, + col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
45
71
71
8
8

query I rowsort
SELECT ALL - col1 + 83 * - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT + AVG ( DISTINCT - col0 ) FROM tab0 AS cor0 GROUP BY col2, col0 HAVING ( 11 * - 58 ) >= - col2
----

query I rowsort
SELECT 48 - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-35
22
5

query I rowsort
SELECT ALL - 1 + - - 32 * - col2 + + + col2 FROM tab2 cor0 GROUP BY col2
----
-1799
-2450
-2698

query I rowsort
SELECT ALL - 96 + + col0 - + - col0 FROM tab2 GROUP BY col0
----
-66
86
88

query II rowsort
SELECT - 11, col1 FROM tab1 GROUP BY col1
----
-11
44
-11
57
-11
6

query I rowsort
SELECT - 32 * col1 + - - 95 * + - 44 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-5492
-6068
-6132

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col2 HAVING col2 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 + - col2 - - 25 * + ( + col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 10 AS col0 FROM tab0 GROUP BY col1, col0, col2
----
10
10
10

query I rowsort
SELECT 79 FROM tab2 cor0 GROUP BY col2
----
79
79
79

query I rowsort
SELECT 62 + + 70 FROM tab0 GROUP BY col2
----
132
132
132

query I rowsort
SELECT DISTINCT 53 AS col2 FROM tab2 WHERE NULL NOT IN ( + col0 ) GROUP BY col0 HAVING col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 80 AS col1 FROM tab1 GROUP BY col0, col2
----
80
80
80

query I rowsort
SELECT col1 * + 8 FROM tab0 AS cor0 GROUP BY col1
----
0
648

query I rowsort
SELECT + 72 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL <> ( + col0 )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col2, col2, col0 HAVING 2 IS NULL
----

query I rowsort
SELECT DISTINCT ( col2 ) AS col0 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT col1 * ( col1 ) FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
6561

query I rowsort
SELECT - 39 FROM tab2 GROUP BY col0, col0, col2 HAVING - CASE col0 WHEN 79 * + col2 THEN NULL ELSE + col2 + - 63 * + col0 END BETWEEN ( NULL ) AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4744
SELECT + 93 * + - ( + 60 ) FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IN ( CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-4744
SELECT + 93 * + - ( + 60 ) FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IN ( CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NOT - col0 IS NULL
----
0
0
81

query I rowsort
SELECT + 43 FROM tab0 GROUP BY col2
----
43
43
43

query I rowsort
SELECT 63 + - col2 FROM tab1 WHERE NOT ( NULL ) = - col2 GROUP BY col2
----

query I rowsort
SELECT - ( + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + 88 col2 FROM tab1 GROUP BY col1 HAVING - 12 IS NULL
----

query I rowsort
SELECT DISTINCT - + 48 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-48

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( - col1 ) BETWEEN NULL AND ( - col1 + 42 )
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 WHERE NOT col0 <= + col0 GROUP BY col2
----

query I rowsort
SELECT - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-4754
SELECT DISTINCT - col2 DIV + + 23 AS col1 FROM tab0 GROUP BY col2
----
-1
-3

skipif mysql # not compatible
query I rowsort label-4754
SELECT DISTINCT - col2 / + + 23 AS col1 FROM tab0 GROUP BY col2
----
-1
-3

query I rowsort
SELECT + col0 * + - 10 * - 55 FROM tab0 AS cor0 GROUP BY col0
----
14300
23650
45650

query I rowsort
SELECT 97 * - ( col0 ) FROM tab2 AS cor0 GROUP BY col0
----
-1455
-8827
-8924

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + ( + ( - 27 ) ) AS col1 FROM tab0 GROUP BY col1, col2
----
-27

query I rowsort
SELECT DISTINCT col0 * - + col1 + - + col0 - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING + - col0 IS NULL
----

query I rowsort
SELECT ALL - NULLIF ( + + col1, 5 * + + col1 ) AS col1 FROM tab0 GROUP BY col1
----
-81
NULL

query I rowsort
SELECT col1 - 31 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-25
13
26

onlyif mysql # DIV for integer division: 
query I rowsort label-4762
SELECT DISTINCT + col1 DIV - col1 + + 24 * + col1 AS col1 FROM tab2 GROUP BY col1
----
1415
1463
983

skipif mysql # not compatible
query I rowsort label-4762
SELECT DISTINCT + col1 / - col1 + + 24 * + col1 AS col1 FROM tab2 GROUP BY col1
----
1415
1463
983

onlyif mysql # DIV for integer division: 
query II rowsort label-4763
SELECT ALL - ( - + 40 ) AS col1, - col0 DIV + + 51 + - COALESCE ( + 6, - col0 ) FROM tab2 GROUP BY col0 HAVING - ( + + ( - 3 ) ) <> - 57
----
40
-6
40
-7
40
-7

skipif mysql # not compatible
query II rowsort label-4763
SELECT ALL - ( - + 40 ) AS col1, - col0 / + + 51 + - COALESCE ( + 6, - col0 ) FROM tab2 GROUP BY col0 HAVING - ( + + ( - 3 ) ) <> - 57
----
40
-6
40
-7
40
-7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 - + col2 + - col2 col0 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT 67 + - 22 + + col0 - - col0 FROM tab1 GROUP BY col2, col0
----
101
209
89

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4766
SELECT ALL CAST( - col2 AS SIGNED ) AS col1, + col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

skipif mysql # not compatible
query II rowsort label-4766
SELECT ALL CAST ( - col2 AS INTEGER ) AS col1, + col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT 55 FROM tab0 GROUP BY col1
----
55
55

query I rowsort
SELECT - 1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4771
SELECT ALL + - col0 * + CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4771
SELECT ALL + - col0 * + CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ( col0 ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + 62 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
62
62
62

query I rowsort
SELECT DISTINCT - 3 AS col1 FROM tab0 AS cor0 WHERE 50 / ( - - col2 ) + + 15 * col2 - 37 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + - 29 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-108
-53
-67

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 + - 68 FROM tab2 GROUP BY col1, col2
----
-126
-147
-155

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4778
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col2 HAVING - + 18 IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-4778
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col2 HAVING - + 18 IS NOT NULL
----
NULL

query I rowsort
SELECT DISTINCT + col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT - 21 FROM tab0 GROUP BY col1, col0
----
-21
-21
-21

query II rowsort
SELECT DISTINCT - 98 * 35 * + col0, + col0 AS col1 FROM tab2 GROUP BY col0
----
-312130
91
-315560
92
-51450
15

query I rowsort
SELECT DISTINCT + 84 AS col0 FROM tab2 GROUP BY col2
----
84

query I rowsort
SELECT - 7 AS col0 FROM tab2 GROUP BY col2
----
-7
-7
-7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 84 * col1 + + ( - col2 ) col2 FROM tab0 cor0 GROUP BY col2, col1, col2
----
-38
-6828
-79

query I rowsort
SELECT + 93 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
93
93
93

query I rowsort
SELECT + ( - + 5 ) / - + 49 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - col2 AS col1, - 78 FROM tab1 AS cor0 GROUP BY col2
----
-45
-78
-71
-78
-8
-78

query II rowsort
SELECT + col0, col0 * col0 * - 84 AS col2 FROM tab1 GROUP BY col0
----
22
-40656
28
-65856
82
-564816

query I rowsort
SELECT DISTINCT + ( col2 ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4790
SELECT ALL CAST( 40 AS SIGNED ) + + + col1 FROM tab1 cor0 GROUP BY col2, col0, col1
----
46
84
97

skipif mysql # not compatible
query I rowsort label-4790
SELECT ALL CAST ( 40 AS INTEGER ) + + + col1 FROM tab1 cor0 GROUP BY col2, col0, col1
----
46
84
97

query I rowsort
SELECT - 3 * - col2 - - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
158
48
76

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4792
SELECT - + CAST( NULL AS SIGNED ) * + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1, col2 HAVING NOT + col0 * + col2 * - + 38 + - - col1 + col2 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4792
SELECT - + CAST ( NULL AS INTEGER ) * + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1, col2 HAVING NOT + col0 * + col2 * - + 38 + - - col1 + col2 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + 56 FROM tab1 GROUP BY col0, col1 HAVING + col0 IS NOT NULL
----
56
56
56

query I rowsort
SELECT ALL + 80 + 77 FROM tab1 GROUP BY col1, col2 HAVING + 39 - + col1 / col2 * - 4 IS NULL
----

query I rowsort
SELECT DISTINCT - 53 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-53

query I rowsort
SELECT ALL 71 * - col1 AS col1 FROM tab2 GROUP BY col1, col0
----
-2911
-4189
-4331

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4797
SELECT CAST( NULL AS SIGNED ) col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4797
SELECT CAST ( NULL AS INTEGER ) col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL ( + col2 ) + + ( - col2 ) FROM tab1 GROUP BY col2 HAVING + 84 IS NOT NULL
----
0
0
0

query II rowsort
SELECT DISTINCT + col1 AS col2, + AVG ( - 57 ) - + col1 FROM tab2 WHERE NOT ( - 60 ) IS NOT NULL GROUP BY col1, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-4800
SELECT col2 * CAST( NULL AS SIGNED ), col2 + + col2 + - col2 AS col0, - col2 + + - CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col2
----
9 values hashing to 28b547b47793a5fac8bab4d4e4b17a4e

skipif mysql # not compatible
query III rowsort label-4800
SELECT col2 * CAST ( NULL AS INTEGER ), col2 + + col2 + - col2 AS col0, - col2 + + - CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col2
----
9 values hashing to 28b547b47793a5fac8bab4d4e4b17a4e

query I rowsort
SELECT ALL + col1 - + ( 15 ) AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT 2 * 40 AS col0 FROM tab1 GROUP BY col0, col1
----
80
80
80

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4803
SELECT + col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING - - col0 + - + CAST( NULL AS SIGNED ) + 68 - - col0 NOT BETWEEN NULL AND col0
----

skipif mysql # not compatible
query I rowsort label-4803
SELECT + col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING - - col0 + - + CAST ( NULL AS INTEGER ) + 68 - - col0 NOT BETWEEN NULL AND col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4804
SELECT ALL - col0 DIV - + 41 FROM tab0 AS cor0 GROUP BY col0, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-4804
SELECT ALL - col0 / - + 41 FROM tab0 AS cor0 GROUP BY col0, col0
----
0
1
2

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 WHERE col0 * + 47 IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL + + 32 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
113
32
32

query I rowsort
SELECT 30 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + + 42 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + 78 + col1 col0 FROM tab2 cor0 GROUP BY col1, col2
----
-17
-19
-37

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 85 * - + col2 + - - col2 + 54 + + 58 + - col2 * + col2 * - col2 / + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT 79 * - + col2 * - col0 >= NULL
----

query I rowsort
SELECT ALL + 83 FROM tab0 GROUP BY col2, col0
----
83
83
83

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT + col1 - - col1 + + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL NOT IN ( col0, + col1, - - col0 )
----

query I rowsort
SELECT DISTINCT col2 + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING ( NOT ( NULL ) < + 86 )
----

query I rowsort
SELECT ALL - 55 FROM tab2 AS cor0 GROUP BY col2, col0
----
-55
-55
-55

query I rowsort
SELECT - col0 * - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 3 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
3
3
3

query I rowsort
SELECT - ( - 51 ) * 62 FROM tab2 AS cor0 GROUP BY col0
----
3162
3162
3162

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4818
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab2 WHERE NOT NULL <> NULL GROUP BY col1, col0 HAVING + + 90 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4818
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab2 WHERE NOT NULL <> NULL GROUP BY col1, col0 HAVING + + 90 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + col0 * - - 68 * col0, col0 FROM tab2 AS cor0 GROUP BY col0
----
15300
15
563108
91
575552
92

query I rowsort
SELECT DISTINCT + 70 FROM tab2 GROUP BY col2, col1 HAVING + + col1 - + col1 IS NOT NULL
----
70

query I rowsort
SELECT + + 87 + 53 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + 17 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
17
17
17

query I rowsort
SELECT ALL col2 * - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + ( - ( - - 13 ) ) FROM tab1 GROUP BY col2, col2
----
-13

query I rowsort
SELECT col1 * + + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NOT col1 NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT ALL + 36 AS col1 FROM tab0 GROUP BY col2
----
36
36
36

query I rowsort
SELECT DISTINCT + col1 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL + - col0 * + + col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-484
-6724
-784

onlyif mysql # DIV for integer division: 
query I rowsort label-4830
SELECT DISTINCT + + col2 DIV - 83 + 79 AS col1 FROM tab0 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
79

skipif mysql # not compatible
query I rowsort label-4830
SELECT DISTINCT + + col2 / - 83 + 79 AS col1 FROM tab0 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
79

query I rowsort
SELECT ALL - ( - col1 ) FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - + col0 + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING + NULLIF ( - 37, 37 * 37 ) IS NULL
----

query I rowsort
SELECT ALL col0 * - 89 AS col2 FROM tab1 AS cor0 WHERE - 48 * + ( - 62 ) * + + col2 - + 1 IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + 7 FROM tab2 cor0 GROUP BY col2, col0
----
7
7
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 * - col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col1
----

query II rowsort
SELECT ALL col1 AS col2, + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1, col2
----
0
26
0
83
81
43

query I rowsort
SELECT DISTINCT - col2 * - - col2 * - col2 * 95 AS col1 FROM tab0 GROUP BY col2
----
1313280
46838705
5212840

query I rowsort
SELECT DISTINCT - col1 + + 75 + col1 AS col1 FROM tab1 GROUP BY col1
----
75

query I rowsort
SELECT - + col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT - - ( 23 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( - 32 ) BETWEEN - col1 AND ( 70 + 2 )
----
23

query I rowsort
SELECT DISTINCT + col0 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL col1 * col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 77 col1 FROM tab0 WHERE NOT NULL IN ( 41, + col1 ) GROUP BY col1, col2, col2 HAVING NOT NULL >= + col2 * + 66
----

query I rowsort
SELECT col2 * - + 91 * col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT + - ( - 80 ) IS NULL
----
-184275
-458731
-5824

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4846
SELECT DISTINCT - - CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-4846
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
NULL

query I rowsort
SELECT DISTINCT col2 FROM tab0 cor0 WHERE NOT col2 NOT BETWEEN + + col1 * - 1 AND ( + 41 + - ( 53 ) ) GROUP BY col2, col2 HAVING ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * ( + col2 * + 63 ) col2 FROM tab0 WHERE NOT + ( 10 ) <= ( NULL ) GROUP BY col2
----

query I rowsort
SELECT 40 FROM tab1 GROUP BY col1
----
40
40
40

query I rowsort
SELECT ALL + col1 + + 65 FROM tab1 GROUP BY col1
----
109
122
71

query I rowsort
SELECT DISTINCT 82 AS col0 FROM tab0 GROUP BY col1
----
82

query I rowsort
SELECT - col2 AS col0 FROM tab1 WHERE col2 <= NULL GROUP BY col2, col2
----

query I rowsort
SELECT 92 FROM tab0 GROUP BY col2
----
92
92
92

query II rowsort
SELECT + 51 AS col1, col2 FROM tab1 cor0 GROUP BY col2
----
51
45
51
71
51
8

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4857
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL = + CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
query I rowsort label-4857
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL = + CAST ( NULL AS REAL )
----

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT col1 * 96 FROM tab1 AS cor0 GROUP BY col1, col2
----
4224
5472
576

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-4860
SELECT - ( CAST( NULL AS DECIMAL ) ) + col0 FROM tab2 GROUP BY col2, col0 HAVING NOT 4 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4860
SELECT - ( CAST ( NULL AS REAL ) ) + col0 FROM tab2 GROUP BY col2, col0 HAVING NOT 4 IS NULL
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT col2 FROM tab1 WHERE + col0 = ( + 15 ) GROUP BY col2, col2 HAVING NOT ( + ( - col2 ) ) IS NOT NULL
----

query I rowsort
SELECT + col1 * ( + AVG ( 8 ) ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST( + 33 AS SIGNED ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST ( + 33 AS INTEGER ) )
----

query I rowsort
SELECT ALL 15 AS col0 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
15
15
15

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING ( + 17 ) IN ( + 15 * + col0 )
----

query I rowsort
SELECT - 39 AS col1 FROM tab1 GROUP BY col0, col1 HAVING ( + col0 ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 - + col2 * + 23 FROM tab1 WHERE NULL IN ( col1 * - col0 ) GROUP BY col2
----

query I rowsort
SELECT ALL - 3 FROM tab0 GROUP BY col0
----
-3
-3
-3

onlyif mysql # DIV for integer division: 
query I rowsort label-4871
SELECT DISTINCT col0 DIV col1 AS col2 FROM tab1 GROUP BY col1, col0
----
0
1
3

skipif mysql # not compatible
query I rowsort label-4871
SELECT DISTINCT col0 / col1 AS col2 FROM tab1 GROUP BY col1, col0
----
0
1
3

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 65 col2 FROM tab2 GROUP BY col2 HAVING col2 > + 92
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL >= - col2 * + col0
----

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col0, col1 HAVING col1 NOT IN ( + 22 + col1 * + 54 )
----
44
57
6

query I rowsort
SELECT DISTINCT col1 + 24 * - 88 FROM tab0 AS cor0 WHERE ( col0 * 54 ) < ( col2 * col0 ) GROUP BY col1, col2, col1
----
-2112

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( + 41 ) IS NOT NULL
----

query I rowsort
SELECT - 42 * col0 - ( col0 + col0 ) * col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-3870
-5200
-9794

query I rowsort
SELECT ALL + ( - ( 75 ) ) * + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-4350
-5925
-6525

query I rowsort
SELECT ALL 6 + 6 * col2 FROM tab0 GROUP BY col2, col2
----
150
234
480

query I rowsort
SELECT + - col2 * + col2 FROM tab1 cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 WHERE NOT ( col0 ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + + 7 FROM tab2 AS cor0 GROUP BY col0
----
7
7
7

query I rowsort
SELECT - col2 + - 53 FROM tab2 GROUP BY col2
----
-111
-132
-140

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL BETWEEN col0 + + col0 AND col0
----

query II rowsort
SELECT ALL + ( - col0 ) AS col1, + col0 AS col1 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT 49 FROM tab0 AS cor0 WHERE + 99 * col2 IS NULL GROUP BY col0, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4887
SELECT + COALESCE ( + 85, col0 DIV + ( col2 ) ) FROM tab0 AS cor0 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-4887
SELECT + COALESCE ( + 85, col0 / + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

query I rowsort
SELECT - 26 FROM tab0 AS cor0 GROUP BY col1
----
-26
-26

query I rowsort
SELECT DISTINCT col0 FROM tab0 cor0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT 40 * 14 * + 56 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4891
SELECT - CAST( + col2 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + + col0 * + - 26 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-4891
SELECT - CAST ( + col2 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + + col0 * + - 26 IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab0 WHERE NOT col2 * col1 > NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + COALESCE ( - - 26, ( + ( 73 ) ) ) + + 45 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4894
SELECT DISTINCT - CAST( NULL AS SIGNED ) * + 2 / 58 AS col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4894
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * + 2 / 58 AS col2 FROM tab1 GROUP BY col1
----
NULL

query I rowsort
SELECT DISTINCT + - AVG ( + - col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 / + + ( - - 46 ) FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + 80 * + col1 col2, ( - col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
3520
-44
4560
-57
480
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col1 * + col1 * - - 24 * + col1 FROM tab0 AS cor0 WHERE + col0 * - col2 * col1 * col0 IS NOT NULL GROUP BY col1, col1
----
-12754584
0

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT + + 77 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4901
SELECT DISTINCT + 51 + + - 61 DIV - col1 AS col1 FROM tab2 GROUP BY col1
----
52

skipif mysql # not compatible
query I rowsort label-4901
SELECT DISTINCT + 51 + + - 61 / - col1 AS col1 FROM tab2 GROUP BY col1
----
52

query I rowsort
SELECT ALL 23 * + ( - + col0 ) FROM tab1 GROUP BY col0, col2
----
-1886
-506
-644

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING + 83 IS NOT NULL
----
26
43
83

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL >= 75 AND NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 0 col2 FROM tab1 GROUP BY col2
----
0

query I rowsort
SELECT - 17 AS col0 FROM tab0 GROUP BY col1 HAVING - - 6 IS NOT NULL
----
-17
-17

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 + col1 * + - col1 FROM tab2 GROUP BY col1, col1
----
-1722
-3540
-3782

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4911
SELECT DISTINCT + CAST( 88 AS SIGNED ) * - + 22 / + + col0 * + 84 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col0
----

skipif mysql # not compatible
query I rowsort label-4911
SELECT DISTINCT + CAST ( 88 AS INTEGER ) * - + 22 / + + col0 * + 84 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col0
----

query I rowsort
SELECT DISTINCT - col2 + - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

onlyif mysql # DIV for integer division: 
query I rowsort label-4913
SELECT + - col2 + + col2 + col2 * col2 + - col2 DIV + + 78 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6240

skipif mysql # not compatible
query I rowsort label-4913
SELECT + - col2 + + col2 + col2 * col2 + - col2 / + + 78 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6240

query I rowsort
SELECT ALL 31 / - col2 AS col1 FROM tab0 GROUP BY col2 HAVING col2 <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST( col2 AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST ( col2 AS INTEGER )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT 10 * col1 FROM tab1 GROUP BY col1
----
440
570
60

query I rowsort
SELECT ALL - + ( 85 ) + + ( 72 ) FROM tab1 AS cor0 WHERE NULL BETWEEN NULL AND - col0 + + col0 / - + col1 GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col1 * col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
185193
216
85184

query I rowsort
SELECT col1 + + 27 + + 19 * - col2 AS col0 FROM tab0 GROUP BY col1, col2
----
-1474
-348
-695

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col0, col0 FROM tab0 GROUP BY col0, col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL + 83 FROM tab0 GROUP BY col2
----
83
83
83

query I rowsort
SELECT 26 + - 97 + - + col1 * col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
-1752
-3552
-3792

query I rowsort
SELECT col2 AS col1 FROM tab0 cor0 WHERE NOT ( NULL > - 81 ) GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4925
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT + + CAST( NULL AS SIGNED ) IS NOT NULL
----
44
57
6

skipif mysql # not compatible
query I rowsort label-4925
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT + + CAST ( NULL AS INTEGER ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT + 34 * + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
2754

query I rowsort
SELECT col1 FROM tab2 WHERE NULL <= 0 GROUP BY col1
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0, col2, col0 HAVING + 44 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + - 57 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 74 AS col0 FROM tab0 GROUP BY col1
----
-74

query I rowsort
SELECT + 97 + + col0 FROM tab2 GROUP BY col0, col0
----
112
188
189

query I rowsort
SELECT col1 + + + 77 FROM tab1 GROUP BY col0, col1
----
121
134
83

query I rowsort
SELECT DISTINCT + 25 FROM tab2 cor0 GROUP BY col0, col0
----
25

onlyif mysql # DIV for integer division: 
query I rowsort label-4936
SELECT DISTINCT + - col0 DIV + 92 + + + 47 + ( - + 18 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
29

skipif mysql # not compatible
query I rowsort label-4936
SELECT DISTINCT + - col0 / + 92 + + + 47 + ( - + 18 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
29

query II rowsort
SELECT col2, 54 FROM tab0 AS cor0 WHERE ( NULL IS NULL ) GROUP BY col2
----
24
54
38
54
79
54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 57 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-57
-57
-57

query I rowsort
SELECT DISTINCT + NULLIF ( 64, - 92 ) FROM tab0 GROUP BY col2, col2
----
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT - 10 + + 24 FROM tab1 GROUP BY col1
----
14
14
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4942
SELECT ALL CAST( NULL AS SIGNED ) / - - ( col0 ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4942
SELECT ALL CAST ( NULL AS INTEGER ) / - - ( col0 ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 14 AS col1 FROM tab2 GROUP BY col1, col0
----
14
14
14

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 WHERE NOT - - ( - col2 ) <> NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - 54 IN ( 23, 96 )
----
-22
-28
-82

query I rowsort
SELECT 65 AS col0 FROM tab2 GROUP BY col1
----
65
65
65

query I rowsort
SELECT + col1 * + 15 * col1 AS col2 FROM tab1 GROUP BY col1
----
29040
48735
540

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) BETWEEN + ( - + col2 ) * + 68 + - col0 AND ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query II rowsort
SELECT + col2 AS col1, - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT 14 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query II rowsort
SELECT + - 87 AS col1, 99 + + 22 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-87
121
-87
121
-87
121

query I rowsort
SELECT ALL col2 + - col2 FROM tab1 GROUP BY col2, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 90 + - + 29 - - col2 + - + col2 col0 FROM tab1 GROUP BY col2
----
-119
-119
-119

query I rowsort
SELECT DISTINCT + 99 + - - ( - col1 ) + - - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING + + 36 >= + + col1
----

query I rowsort
SELECT 53 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
53
53

query I rowsort
SELECT ALL + + col1 FROM tab0 WHERE NOT - 53 * + col0 IN ( - NULLIF ( 12, - col2 ) - col1, NULLIF ( col1, col1 * + col0 ) ) GROUP BY col1
----
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4958
SELECT ALL - col0 * + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0 HAVING ( NULL IS NULL )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-4958
SELECT ALL - col0 * + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0 HAVING ( NULL IS NULL )
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col0 + + col0 + col0 + col0 * col0 FROM tab2 GROUP BY col0
----
270
8554
8740

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 99 * + + 81 FROM tab0 cor0 GROUP BY col2 HAVING + col2 <= + col2
----
8019
8019
8019

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4962
SELECT - col2 AS col0 FROM tab1 WHERE + - col2 * + col1 * + - 34 - CAST( NULL AS SIGNED ) <= NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-4962
SELECT - col2 AS col0 FROM tab1 WHERE + - col2 * + col1 * + - 34 - CAST ( NULL AS INTEGER ) <= NULL GROUP BY col2
----

query I rowsort
SELECT ALL 79 FROM tab1 WHERE NOT NULL = NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL 92 + + 75 + ( col0 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
193
210
250

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4965
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE NULL = + CAST( NULL AS SIGNED ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-4965
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE NULL = + CAST ( NULL AS INTEGER ) GROUP BY col0
----

query II rowsort
SELECT ALL 72 * ( - + col2 ) AS col1, col2 * - col2 / + col2 + AVG ( - - col2 ) FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT - 24 + - col0 < NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 * - col2 * - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
137965
368278
461770

query I rowsort
SELECT + 14 FROM tab0 cor0 GROUP BY col0
----
14
14
14

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 * + col1 * - col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL BETWEEN col0 AND - - NULLIF ( col0, col0 * - col2 / + col0 )
----

query I rowsort
SELECT ALL - 29 * - col1 - - col1 * + - 39 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-440
-570
-60

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - - col1 IS NULL
----

query I rowsort
SELECT ALL - - col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT - 57 - - + 2 + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-25
127
129

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - 49 BETWEEN + 69 / - 52 AND 49
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - 2 - + 73 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-75
-75
-75

query I rowsort
SELECT ALL + ( col1 ) - 79 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-22
-35
-73

query I rowsort
SELECT DISTINCT 10 AS col2 FROM tab0 GROUP BY col0 HAVING NULL <= + col0
----

query I rowsort
SELECT - col1 + - - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-38
26
83

query I rowsort
SELECT DISTINCT + 16 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
1264
1392
928

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + 6 col1, - 40 FROM tab2 GROUP BY col0 HAVING NULL NOT IN ( - col1 * col1 * - col1 - - + 84, 62 - + 15 * + col1 )
----

query I rowsort
SELECT DISTINCT - 98 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NOT col2 * 22 / + + col2 IS NULL GROUP BY col0, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL + + 43 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
43
43
43

query I rowsort
SELECT col1 + - + col1 * - col1 FROM tab0 cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT ALL + 80 FROM tab1 GROUP BY col1 HAVING - + NULLIF ( col1, + 94 ) IS NOT NULL
----
80
80
80

query I rowsort
SELECT DISTINCT + 63 - + - 90 FROM tab2 WHERE NOT 70 > NULL GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING + 51 IS NULL
----

query I rowsort
SELECT ALL 98 + col0 / col0 FROM tab2 WHERE - 2 * + 66 * col2 IN ( + col2 * + - col2 + - col0 + - 54 * col1 ) GROUP BY col0, col0 HAVING NULL NOT IN ( - col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4989
SELECT DISTINCT CAST( NULL AS SIGNED ) * + + col1 AS col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-4989
SELECT DISTINCT CAST ( NULL AS INTEGER ) * + + col1 AS col2 FROM tab1 GROUP BY col1
----
NULL

query I rowsort
SELECT DISTINCT 27 + + col0 AS col0 FROM tab1 GROUP BY col0
----
109
49
55

query II rowsort
SELECT 69 * + col2 AS col0, - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
3105
-45
4899
-71
552
-8

query I rowsort
SELECT ALL + col1 + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
114
12
88

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL 48 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
48
48
48

query I rowsort
SELECT DISTINCT - - col2 + 23 FROM tab0 AS cor0 GROUP BY col0, col2
----
102
47
61

query I rowsort
SELECT ALL - + 66 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL BETWEEN + + col2 AND 15
----

query I rowsort
SELECT - 91 FROM tab2 GROUP BY col1, col2
----
-91
-91
-91

query II rowsort
SELECT ALL + col1 + - col0 - 1 AS col2, + col0 * - + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-27
0
-84
0
37
-3483

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + 35 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + col2 AS col2, + col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

onlyif mysql # DIV for integer division: 
query I rowsort label-5005
SELECT DISTINCT + 50 DIV + col2 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT 80 - + 60 IS NULL
----
12
44
58

skipif mysql # not compatible
query I rowsort label-5005
SELECT DISTINCT + 50 / + col2 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT 80 - + 60 IS NULL
----
12
44
58

query I rowsort
SELECT DISTINCT - col0 * + 65 AS col1 FROM tab2 AS cor0 WHERE NOT - col0 < ( - - 54 ) GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + 37 FROM tab2 cor0 GROUP BY col1 HAVING NOT - - 8 * - - 82 < NULL
----

query I rowsort
SELECT + ( col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-5009
SELECT + 74 DIV - - col2 + col2 + + col2 * ( + - col2 ) * - + col2 FROM tab1 cor0 GROUP BY col2
----
357983
529
91171

skipif mysql # not compatible
query I rowsort label-5009
SELECT + 74 / - - col2 + col2 + + col2 * ( + - col2 ) * - + col2 FROM tab1 cor0 GROUP BY col2
----
357983
529
91171

query I rowsort
SELECT DISTINCT + col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query II rowsort
SELECT - col0, - col0 FROM tab1 GROUP BY col0, col1
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT DISTINCT + NULLIF ( - 33, - col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-33

query I rowsort
SELECT + col0 * - col0 * 64 FROM tab1 GROUP BY col2, col0
----
-30976
-430336
-50176

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5015
SELECT col0 + + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5015
SELECT col0 + + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT - col0 + + + 78 AS col2, - 66 + + col0 * + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING 75 IS NOT NULL
----
-4
-6790
50
-850
56
-550

query I rowsort
SELECT + - ( + + 15 ) FROM tab0 AS cor0 GROUP BY col0
----
-15
-15
-15

query I rowsort
SELECT - 6 * + 59 + + ( - - 76 ) FROM tab0 GROUP BY col1 HAVING NOT - AVG ( COALESCE ( col1, col0 + + ( 19 ) ) ) + - + col1 IS NULL
----
-278
-278

query I rowsort
SELECT col0 * col0 - ( 36 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * - + 54 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
4455

query I rowsort
SELECT col2 * col2 FROM tab2 GROUP BY col2, col1, col1
----
3364
6241
7569

query I rowsort
SELECT + 52 AS col0 FROM tab1 GROUP BY col1
----
52
52
52

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT ( - + col1 ) AS col2, + 69 * col1 + - + AVG ( DISTINCT - col1 ) + + 17 AS col2 FROM tab0 GROUP BY col1 HAVING NOT 42 * - col2 = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5024
SELECT - - col0 + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) AS col1, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > - 21
----

skipif mysql # not compatible
query II rowsort label-5024
SELECT - - col0 + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) AS col1, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > - 21
----

query I rowsort
SELECT - 53 + + - col1 AS col1 FROM tab2 GROUP BY col1, col2
----
-112
-114
-94

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5026
SELECT col2 AS col2 FROM tab1 cor0 WHERE 40 * + col2 + + 60 * CAST( NULL AS SIGNED ) / - 21 = + col1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5026
SELECT col2 AS col2 FROM tab1 cor0 WHERE 40 * + col2 + + 60 * CAST ( NULL AS INTEGER ) / - 21 = + col1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * + 6 col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
264
342
36

query I rowsort
SELECT ALL + ( + + col2 ) FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT 13 FROM tab1 GROUP BY col0, col0 HAVING ( 73 ) IS NOT NULL
----
13
13
13

query I rowsort
SELECT ALL + 65 AS col1 FROM tab0 GROUP BY col2, col2
----
65
65
65

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL col0 * - 57 * 20 AS col1 FROM tab0 GROUP BY col0
----
-29640
-49020
-94620

query I rowsort
SELECT DISTINCT - - col0 + - - 33 FROM tab2 AS cor0 GROUP BY col0
----
124
125
48

query I rowsort
SELECT - 91 * + col2 FROM tab2 WHERE NOT + - col2 IS NOT NULL GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + 64 FROM tab1 AS cor0 GROUP BY col1
----
64
64
64

query II rowsort
SELECT ALL - col2 AS col1, + 7 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
7
-79
7
-87
7

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5037
SELECT - CAST( NULL AS SIGNED ) + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5037
SELECT - CAST ( NULL AS INTEGER ) + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query II rowsort
SELECT ALL - col2 AS col2, - col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT col0 + + col1 * + 9 * 17 + - col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING ( NOT NULL IS NOT NULL )
----
6324
9059
9287

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1, col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 + + col1 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 1 * 36 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT - 19 + - col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1, col1
----
-25
-63
-76

query II rowsort
SELECT + col0 + + col0 AS col0, col0 * + - 34 FROM tab2 GROUP BY col0
----
182
-3094
184
-3128
30
-510

query II rowsort
SELECT + 86 AS col1, 88 * - col2 FROM tab2 GROUP BY col2
----
86
-5104
86
-6952
86
-7656

query II rowsort
SELECT ALL col0, - col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT ( + + col0 ) FROM tab0 GROUP BY col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + - - col0 + + col0 * + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
255
8463
8648

query I rowsort
SELECT DISTINCT - col2 * - col2 AS col1 FROM tab0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - ( - - 38 ) * - col2 col1 FROM tab1 GROUP BY col2
----
1710
2698
304

query I rowsort
SELECT + 21 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL + - 27, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-27
15
-27
91
-27
92

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT - 70 <= 26
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL - 99 AS col2 FROM tab1 GROUP BY col1
----
-99
-99
-99

query I rowsort
SELECT 41 AS col1 FROM tab2 GROUP BY col2, col2 HAVING NOT 36 IS NULL
----
41
41
41

query I rowsort
SELECT + 51 AS col2 FROM tab1 GROUP BY col2, col2 HAVING NOT ( NOT NULL = NULL )
----

query I rowsort
SELECT DISTINCT + - col0 * + - 14 - + col0 + - - col0 * - 56 - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-4004
-4048
-660

onlyif mysql # DIV for integer division: 
query I rowsort label-5060
SELECT ALL - 84 + - + col2 + - col2 DIV - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NULL
----
-107
-121
-162

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5060
SELECT ALL - 84 + - + col2 + - col2 / - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NULL
----
-107
-121
-162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 col0, col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT 80 * - col0 FROM tab2 cor0 GROUP BY col0
----
-1200
-7280
-7360

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * + ( 21 ) col0 FROM tab0 AS cor0 GROUP BY col2
----
-1659
-504
-798

query I rowsort
SELECT ALL col2 + - 78 + - col2 * + col2 AS col0 FROM tab1 GROUP BY col2
----
-134
-2058
-5048

query II rowsort
SELECT - col2 + 73 AS col2, + col2 + - col2 + + col2 * col2 FROM tab1 GROUP BY col2 HAVING col2 IS NOT NULL
----
2
5041
28
2025
65
64

query I rowsort
SELECT col1 - col1 AS col0 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + 85 FROM tab1 AS cor0 GROUP BY col0
----
85
85
85

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5069
SELECT ALL + CAST( + col2 AS SIGNED ) * - ( - col2 ) + col2 + - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5069
SELECT ALL + CAST ( + col2 AS INTEGER ) * - ( - col2 ) + col2 + - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5070
SELECT DISTINCT + + CAST( + 61 AS SIGNED ) AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
61

skipif mysql # not compatible
query I rowsort label-5070
SELECT DISTINCT + + CAST ( + 61 AS INTEGER ) AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
61

query I rowsort
SELECT DISTINCT + + 55 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab1 AS cor0 WHERE NOT - COALESCE ( col2, - + 32 * ( + 28 ), + - 80 + - col1 / + col1 ) IS NULL GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0 HAVING NOT NULL > - 75 OR NOT + col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL 12 + + 65 FROM tab2 AS cor0 GROUP BY col1, col1
----
77
77
77

query I rowsort
SELECT - - col1 * - + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING 87 IS NOT NULL
----
-1681
-3481
-3721

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5076
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5076
SELECT CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - ( + col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col2, col2
----
15
91
92

query II rowsort
SELECT - 10, 80 * + + 60 AS col0 FROM tab0 GROUP BY col2 HAVING NULL = col2
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT ( NOT col1 >= NULL )
----

query I rowsort
SELECT DISTINCT - + col1 * col1 + 42 AS col0 FROM tab1 WHERE NOT ( NULL ) < 42 * 27 / + 94 * + + 93 GROUP BY col1, col2 HAVING NOT CASE 45 WHEN col2 THEN NULL ELSE - col2 END IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5082
SELECT - ( - - col1 ) DIV - - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5082
SELECT - ( - - col1 ) / - - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - 22 AS col0 FROM tab1 WHERE NOT - ( + COALESCE ( - + 77, + - 49 ) ) + - ( + - 33 ) + col0 IN ( + 35 ) GROUP BY col1
----
-22

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 + col1 + COALESCE ( - + 65, + + ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( + col1 ) IS NOT NULL )
----
-65
97

query I rowsort
SELECT + + col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5087
SELECT col2 * - 51 * 58 AS col1 FROM tab1 GROUP BY col2 HAVING col2 NOT BETWEEN - col2 AND CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5087
SELECT col2 * - 51 * 58 AS col1 FROM tab1 GROUP BY col2 HAVING col2 NOT BETWEEN - col2 AND CAST ( NULL AS INTEGER )
----

query II rowsort
SELECT DISTINCT + + 99 + - col1, - 31 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
42
-31
55
-31
93
-31

query I rowsort
SELECT DISTINCT - + 36 FROM tab2 AS cor0 GROUP BY col1
----
-36

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - + 2 IS NULL
----
41
59
61

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2 HAVING + ( + 69 ) + - - ( - col2 ) >= NULL
----

query I rowsort
SELECT - col1 FROM tab0 WHERE NULL = NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 24 FROM tab1 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE col2 / + 65 > ( NULL ) GROUP BY col0, col1, col1
----

query I rowsort
SELECT - + 19 * - col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
1577
494
817

query I rowsort
SELECT DISTINCT 20 FROM tab0 AS cor0 WHERE NOT ( col2 + col2 * - + col0 > - col2 + - - 21 * - col2 + col1 * 86 * - col1 - - col2 ) GROUP BY col0
----
20

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5097
SELECT ALL CAST( - col1 AS SIGNED ) FROM tab1 GROUP BY col0, col1, col0
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-5097
SELECT ALL CAST ( - col1 AS INTEGER ) FROM tab1 GROUP BY col0, col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 17 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-17
-17
-17

query I rowsort
SELECT - 60 AS col2 FROM tab0 cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col2, col1 HAVING ( NOT ( - 19 + 45 ) IS NOT NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5100
SELECT DISTINCT AVG ( - - CAST( + col2 AS SIGNED ) ) / + - CAST( - col2 AS SIGNED ) - - - NULLIF ( col0, - 86 ) col1 FROM tab2 AS cor0 GROUP BY col0, col0, col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5100
SELECT DISTINCT AVG ( - - CAST ( + col2 AS INTEGER ) ) / + - CAST ( - col2 AS INTEGER ) - - - NULLIF ( col0, - 86 ) col1 FROM tab2 AS cor0 GROUP BY col0, col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col2, + 10 col0 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + 14 FROM tab2 GROUP BY col0, col0
----
14
14
14

query I rowsort
SELECT DISTINCT + CASE + col0 WHEN 11 THEN NULL WHEN 76 THEN NULL ELSE + 22 END FROM tab1 AS cor0 GROUP BY col0
----
22

query I rowsort
SELECT + col2 + - - 23 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
102
110
81

query I rowsort
SELECT ALL ( col1 ) FROM tab1 cor0 WHERE NOT col1 IS NULL GROUP BY col1 HAVING NOT NULL <> ( + 37 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5106
SELECT - col0 DIV + col2 - - col0 FROM tab2 GROUP BY col0, col2, col0
----
15
90
91

skipif mysql # not compatible
query I rowsort label-5106
SELECT - col0 / + col2 - - col0 FROM tab2 GROUP BY col0, col2, col0
----
15
90
91

query I rowsort
SELECT DISTINCT + col2 + 17 - 48 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col2 * + col2 FROM tab0 GROUP BY col2 HAVING - 86 IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING 39 * 52 IN ( - 25 )
----

query I rowsort
SELECT col2 * - col2 * - col2 + - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
357982
520
91170

query I rowsort
SELECT DISTINCT - col0 * - col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5112
SELECT + col1 FROM tab1 WHERE NOT col0 NOT IN ( col1 ) GROUP BY col0, col2, col0, col1 HAVING NOT ( + col2 + + CAST( NULL AS SIGNED ) ) < 86 + 72
----

skipif mysql # not compatible
query I rowsort label-5112
SELECT + col1 FROM tab1 WHERE NOT col0 NOT IN ( col1 ) GROUP BY col0, col2, col0, col1 HAVING NOT ( + col2 + + CAST ( NULL AS INTEGER ) ) < 86 + 72
----

query I rowsort
SELECT 38 FROM tab0 WHERE NOT - col2 NOT IN ( col0 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT - 71 + + 23 FROM tab1 GROUP BY col0, col2, col1
----
-48

query I rowsort
SELECT + 27 + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
68
86
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 + col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
0
0

query I rowsort
SELECT - col2 AS col0 FROM tab0 WHERE NOT 97 IS NOT NULL GROUP BY col2, col2 HAVING ( col2 ) >= + 54
----

query I rowsort
SELECT - 17 AS col2 FROM tab1 WHERE NOT 3 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL + 46 FROM tab2 AS cor0 GROUP BY col1
----
46
46
46

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT col1 * + - col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
-6642
0

query I rowsort
SELECT ALL + 88 - - 82 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 - + col0 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - 30 FROM tab2 GROUP BY col0, col0
----
-30
-30
-30

query I rowsort
SELECT ALL - col0 * + + 50 - + col0 FROM tab2 GROUP BY col2, col0 HAVING NULL < NULL
----

query I rowsort
SELECT + ( + 70 ) FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( 32 ) + + col2 col0 FROM tab0 GROUP BY col2, col2
----
111
56
70

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5128
SELECT DISTINCT ( + ( col1 ) ) + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( + CAST( col1 AS SIGNED ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5128
SELECT DISTINCT ( + ( col1 ) ) + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( + CAST ( col1 AS INTEGER ) ) IS NULL
----

query I rowsort
SELECT ALL 84 FROM tab0 GROUP BY col2
----
84
84
84

query I rowsort
SELECT ALL 4 AS col1 FROM tab0 GROUP BY col0
----
4
4
4

query I rowsort
SELECT - ( col1 ) AS col0 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-15
-91
-92

query I rowsort
SELECT ALL - ( ( + 94 ) ) FROM tab1 AS cor0 WHERE NULL <= ( + 82 ) GROUP BY col2 HAVING - col2 BETWEEN col2 + + NULLIF ( col2 + col2, 16 ) AND NULL
----

query I rowsort
SELECT DISTINCT 42 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
42

query I rowsort
SELECT + 35 AS col1 FROM tab0 cor0 GROUP BY col2
----
35
35
35

query I rowsort
SELECT 69 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col2 + + col2 * - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1406
-552
-6162

query I rowsort
SELECT DISTINCT + - 52 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-52

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query II rowsort
SELECT ALL - + col1 + - + 0, 67 + + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT 74 FROM tab1 GROUP BY col1, col2
----
74

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5143
SELECT - CAST( NULL AS DECIMAL ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - ( - col2 ) IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5143
SELECT - CAST ( NULL AS REAL ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - ( - col2 ) IS NULL
----
NULL
NULL
NULL

query II rowsort
SELECT col0 AS col2, + 16 * + + 26 + - ( - + 67 ) FROM tab1 GROUP BY col0
----
22
483
28
483
82
483

query I rowsort
SELECT - 28 AS col1 FROM tab1 GROUP BY col0
----
-28
-28
-28

query I rowsort
SELECT col1 * + col2 + 37 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 IS NULL
----
2602
3161
85

query I rowsort
SELECT ALL + 21 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - 83 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-83
-83
-83

query I rowsort
SELECT - 40 * - col1 FROM tab0 GROUP BY col1
----
0
3240

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0 HAVING - AVG ( col2 ) * - col0 > + 7
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5151
SELECT CAST( + - 62 AS SIGNED ) AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5151
SELECT CAST ( + - 62 AS INTEGER ) AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 69 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
160
161
84

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NOT NULL <= 77 GROUP BY col0, col2 HAVING NULL < - col2 * col0 + + 14
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 WHERE NOT - 29 IS NULL GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5156
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-5156
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5157
SELECT 3 + + - 83 + col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-79
-79
-79

skipif mysql # not compatible
query I rowsort label-5157
SELECT 3 + + - 83 + col1 / + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-79
-79
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 49 + - - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
131
71
77

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 * + 13 AS col1, + 36 * + + col0 col1 FROM tab1 GROUP BY col0
----
1066
2952
286
792
364
1008

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5160
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0 HAVING ( - CAST( - 8 AS SIGNED ) IS NOT NULL )
----
22
28
82

skipif mysql # not compatible
query I rowsort label-5160
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0 HAVING ( - CAST ( - 8 AS INTEGER ) IS NOT NULL )
----
22
28
82

query I rowsort
SELECT ALL + 90 AS col1 FROM tab0 GROUP BY col2, col0
----
90
90
90

query I rowsort
SELECT DISTINCT + 28 + + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
34
72
85

query I rowsort
SELECT DISTINCT + + col0 + + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
133
150
76

query II rowsort
SELECT col2, - col2 FROM tab1 AS cor0 WHERE col2 + + col0 BETWEEN + - col0 * col2 AND + 60 * - - col2 * + - col1 * - + col1 + - 62 GROUP BY col2 HAVING ( NULL ) = NULL
----

query I rowsort
SELECT + col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - - 93 FROM tab1 AS cor0 GROUP BY col0
----
93
93
93

query I rowsort
SELECT - 28 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-28
-28
-28

query II rowsort
SELECT DISTINCT - col1, col1 AS col0 FROM tab0 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
81
0
0

query I rowsort
SELECT ALL - + col0 + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN - AVG ( - + ( col1 ) ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 * + - col0 + + 87 - - - 23 FROM tab1 GROUP BY col1, col0
----
-420
-6660
-720

query I rowsort
SELECT - COALESCE ( col1, + col1 * + + 3 ) AS col1 FROM tab1 GROUP BY col2, col2, col1 HAVING + col1 * - AVG ( - - ( - col2 ) ) NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT ALL + col0 / 6 AS col1, + col0 * - + 11 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( NOT + - ( + + 35 ) IS NULL )
----
13
-913
4
-286
7
-473

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5174
SELECT 13 col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + CAST( + col1 AS SIGNED ) + + - 91 * - col0 * + 78 IS NOT NULL
----
13
13
13

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5174
SELECT 13 col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + CAST ( + col1 AS INTEGER ) + + - 91 * - col0 * + 78 IS NOT NULL
----
13
13
13

query I rowsort
SELECT DISTINCT 84 FROM tab1 AS cor0 GROUP BY col0, col0
----
84

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col0 HAVING NOT + 35 - + + 33 IS NOT NULL
----

query I rowsort
SELECT - col0 - 81 AS col2 FROM tab1 GROUP BY col0, col0
----
-103
-109
-163

query I rowsort
SELECT DISTINCT 60 * - + col0 * col0 - + + 88 FROM tab0 GROUP BY col0, col2
----
-111028
-40648
-413428

query I rowsort
SELECT 25 FROM tab0 GROUP BY col0, col0, col1
----
25
25
25

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT 21 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
21
21
21

query I rowsort
SELECT col0 + + 81 * + - col2 * + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-164042
-408310
-5170

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT col1 + + 76 + + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
102
159
200

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5186
SELECT - + 61 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( - CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-5186
SELECT - + 61 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( - CAST ( + CAST ( NULL AS INTEGER ) AS INTEGER ) )
----

query I rowsort
SELECT ALL - + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-162
0

query I rowsort
SELECT DISTINCT + + ( ( - 15 ) ) - - - col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-15

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 69 col2 FROM tab1 GROUP BY col0
----
69
69
69

onlyif mysql # DIV for integer division: 
query I rowsort label-5190
SELECT - col1 DIV - + 50 + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT + - 39 IS NULL
----
41
60
62

skipif mysql # not compatible
query I rowsort label-5190
SELECT - col1 / - + 50 + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT + - 39 IS NULL
----
41
60
62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5191
SELECT ALL + CAST( + col0 AS SIGNED ) * - col1 * - 79 - + 18 + + + ( col0 ) FROM tab2 GROUP BY col1, col0
----
298062
424224
72282

skipif mysql # not compatible
query I rowsort label-5191
SELECT ALL + CAST ( + col0 AS INTEGER ) * - col1 * - 79 - + 18 + + + ( col0 ) FROM tab2 GROUP BY col1, col0
----
298062
424224
72282

query I rowsort
SELECT + 29 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT DISTINCT + - ( + + col0 ) AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + 61 col2 FROM tab0 WHERE NOT - 1 IS NULL GROUP BY col1 HAVING NOT - col1 >= col1
----
61

query I rowsort
SELECT col2 FROM tab2 WHERE NOT ( - NULLIF ( - ( - col0 ), col2 ) ) IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NULL = NULL AND - 24 * - COALESCE ( + col1, COALESCE ( 61, 72 * ( + col0 * col0 ), 55 ) + - col1, + 46 ) < + col1 GROUP BY col2, col1 HAVING NULL NOT IN ( + 62 )
----

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab0 AS cor0 WHERE col1 * + col2 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 - CASE ( + - col1 ) WHEN + - 2 THEN + 56 END col0 FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT + 25 FROM tab0 AS cor0 GROUP BY col1
----
25
25

query I rowsort
SELECT - 63 FROM tab2 AS cor0 GROUP BY col0
----
-63
-63
-63

query I rowsort
SELECT ALL - + col0 * - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2 AS col2, col2 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT + + col2 AS col2 FROM tab0 WHERE + + col1 + - 54 IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col2 + - col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

onlyif mysql # DIV for integer division: 
query I rowsort label-5208
SELECT ALL - col1 * col1 + 29 + - - col1 DIV + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1653
-3453
-3693

skipif mysql # not compatible
query I rowsort label-5208
SELECT ALL - col1 * col1 + 29 + - - col1 / + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1653
-3453
-3693

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT col2 / - col2 + col2 * - col2 AS col1, 67 col1, 24 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
9 values hashing to 442b706f32baefbb061d0cc9d3a2d7a7

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 36 col0 FROM tab1 cor0 GROUP BY col1, col0
----
-36
-36
-36

onlyif mysql # DIV for integer division: 
query I rowsort label-5212
SELECT ALL col2 - + + col2 DIV col2 FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

skipif mysql # not compatible
query I rowsort label-5212
SELECT ALL col2 - + + col2 / col2 FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

query I rowsort
SELECT DISTINCT 81 FROM tab0 GROUP BY col1, col2, col2
----
81

query I rowsort
SELECT DISTINCT - ( - 56 ) AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT ( - col1 * + col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 * + 53 FROM tab1 GROUP BY col0, col2
----
2385
3763
424

query I rowsort
SELECT 1 FROM tab1 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col2 * 91 AS col2 FROM tab0 GROUP BY col2 HAVING NOT ( 7 ) BETWEEN ( + 50 ) AND ( NULL )
----
2184
3458
7189

query I rowsort
SELECT DISTINCT 76 AS col2 FROM tab1 GROUP BY col0 HAVING NULL < col0 * + 30
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - 74 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-3256
-4218
-444

query I rowsort
SELECT DISTINCT 38 * + 22 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 + col0 IS NULL
----
18392
23408
68552

onlyif mysql # DIV for integer division: 
query I rowsort label-5223
SELECT DISTINCT + col1 DIV - ( - col2 ) AS col2 FROM tab2 GROUP BY col2, col1
----
0

skipif mysql # not compatible
query I rowsort label-5223
SELECT DISTINCT + col1 / - ( - col2 ) AS col2 FROM tab2 GROUP BY col2, col1
----
0

query I rowsort
SELECT + col2 + - col2 + + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT 68 IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 + col2 * 68 FROM tab0 GROUP BY col2, col1
----
1656
2622
5451

query I rowsort
SELECT ALL - col2 * + col2 AS col0 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - 28 + col0 FROM tab1 GROUP BY col0
----
-6
0
54

query I rowsort
SELECT DISTINCT - 45 AS col0 FROM tab2 GROUP BY col2
----
-45

query I rowsort
SELECT - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL > ( - col1 )
----

query I rowsort
SELECT col1 - 48 * col1 AS col2 FROM tab0 WHERE NOT NULL BETWEEN + - col0 AND 18 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5233
SELECT ALL + CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5233
SELECT ALL + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT - + 95 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col1 * ( - 42 / 30 ) IS NOT NULL
----
-95
-95
-95

onlyif mysql # DIV for integer division: 
query I rowsort label-5235
SELECT DISTINCT col2 DIV - - 8 + - + 59 AS col1 FROM tab0 GROUP BY col2
----
-50
-55
-56

skipif mysql # not compatible
query I rowsort label-5235
SELECT DISTINCT col2 / - - 8 + - + 59 AS col1 FROM tab0 GROUP BY col2
----
-50
-55
-56

query I rowsort
SELECT 94 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT ALL - ( - AVG ( ALL col0 ) ) * - 61 + + col0 AS col2 FROM tab0 GROUP BY col0 HAVING ( NULL ) < - col0 + 10
----

query I rowsort
SELECT - ( - 13 ) * col2 AS col2 FROM tab0 WHERE NOT col0 IS NOT NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5239
SELECT ALL 89 DIV col2 + - 92 FROM tab2 GROUP BY col2, col0
----
-91
-91
-91

skipif mysql # not compatible
query I rowsort label-5239
SELECT ALL 89 / col2 + - 92 FROM tab2 GROUP BY col2, col0
----
-91
-91
-91

onlyif mysql # DIV for integer division: 
query I rowsort label-5240
SELECT - col2 DIV - - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5240
SELECT - col2 / - - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

query II rowsort
SELECT DISTINCT col2 + 62 * col2 AS col1, 45 AS col1 FROM tab1 GROUP BY col2
----
2835
45
4473
45
504
45

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( col2 / + 15 + + 88 ) IN ( AVG ( col2 ) )
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 WHERE NOT ( - col2 ) IS NULL GROUP BY col1, col2
----
24
38
79

query II rowsort
SELECT DISTINCT + + col2, col2 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT 46 AS col2 FROM tab2 cor0 GROUP BY col2
----
46

query I rowsort
SELECT ALL 12 + + 14 FROM tab2 AS cor0 GROUP BY col2
----
26
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 27 * col2 * - col2 + + 70 col0 FROM tab0 cor0 GROUP BY col2
----
-15482
-168437
-38918

query I rowsort
SELECT col1 * col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
0
0
6561

query I rowsort
SELECT + + 57 * + - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1482
-2451
-4731

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT + 42 - - 87 FROM tab0 GROUP BY col1
----
129
129

query I rowsort
SELECT 19 * + col2 + - 54 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 + 39 FROM tab1 GROUP BY col0
----
121
61
67

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1 HAVING NULL < NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT 15 IS NOT NULL
----

query I rowsort
SELECT ( - col2 ) FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + ( + col2 ) AS col0 FROM tab0 WHERE NOT - 58 IS NULL GROUP BY col0, col2 HAVING NOT col2 * ( ( ( col0 ) ) ) IS NOT NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 * + AVG ( - + ( - col2 ) ) - + + 81 AS col0 FROM tab2 AS cor0 WHERE NULL = + col2 GROUP BY col2
----

query I rowsort
SELECT + 31 + 14 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
45
45
45

query I rowsort
SELECT 52 * + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT col1 - - 30 FROM tab2 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT + col2 * - col2 + + col0 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-765
112
781

query I rowsort
SELECT + + col1 * - col1 * - + col1 + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 94 * + 47 FROM tab0 GROUP BY col2
----
4418
4418
4418

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 67 * col1 col1 FROM tab0 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col1, col1
----
-5427
0

query I rowsort
SELECT - col0 + - 0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT 11 FROM tab0 cor0 GROUP BY col1, col1
----
11
11

query I rowsort
SELECT ALL + 71 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
71
71
71

query I rowsort
SELECT ALL + 51 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING ( ( NULL > NULL ) )
----

query I rowsort
SELECT DISTINCT 45 AS col2 FROM tab0 GROUP BY col2
----
45

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
225
8281
8464

query II rowsort
SELECT DISTINCT 87 * col0 + - col0 - + col0, - col0 * + 42 AS col2 FROM tab2 GROUP BY col0
----
1275
-630
7735
-3822
7820
-3864

onlyif mysql # DIV for integer division: 
query I rowsort label-5277
SELECT 90 DIV + col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
2

skipif mysql # not compatible
query I rowsort label-5277
SELECT 90 / + col1 AS col2 FROM tab2 GROUP BY col1
----
1
1
2

query I rowsort
SELECT - 26 / + col2 * + 87 FROM tab0 GROUP BY col2, col2 HAVING 14 IS NULL
----

query I rowsort
SELECT DISTINCT col2 * 93 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) <= 26
----

query II rowsort
SELECT col1, 34 FROM tab2 GROUP BY col1, col1, col2
----
41
34
59
34
61
34

query I rowsort
SELECT ALL 7 FROM tab1 AS cor0 GROUP BY col1, col1
----
7
7
7

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING + 98 IS NOT NULL
----
-24
-38
-79

query II rowsort
SELECT ALL col1 AS col2, col1 + - col1 FROM tab1 GROUP BY col1
----
44
0
57
0
6
0

query I rowsort
SELECT 59 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
59
59
59

query I rowsort
SELECT ALL + - col2 + + col2 FROM tab0 AS cor0 WHERE + col1 BETWEEN + col0 AND NULL GROUP BY col2, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5286
SELECT col2 DIV col2 * + col2 * + 50 AS col0 FROM tab1 GROUP BY col2, col2, col2
----
2250
3550
400

skipif mysql # not compatible
query I rowsort label-5286
SELECT col2 / col2 * + col2 * + 50 AS col0 FROM tab1 GROUP BY col2, col2, col2
----
2250
3550
400

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NULL IS NULL AND ( NULL ) NOT BETWEEN col0 AND - 53 * 31 * col2 + - col2 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 65 FROM tab2 GROUP BY col2
----
-65

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5290
SELECT DISTINCT + - col1 + + 80 + - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( - - CAST( NULL AS SIGNED ) ) IS NULL
----
80

skipif mysql # not compatible
query I rowsort label-5290
SELECT DISTINCT + - col1 + + 80 + - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( - - CAST ( NULL AS INTEGER ) ) IS NULL
----
80

query I rowsort
SELECT - col1 - + 46 FROM tab1 cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NULL IS NULL
----

query II rowsort
SELECT DISTINCT + - col1, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5293
SELECT 59 col0, + CAST( - col0 AS SIGNED ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5293
SELECT 59 col0, + CAST ( - col0 AS INTEGER ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 + col2 FROM tab1 GROUP BY col2, col0 HAVING NOT + + col2 BETWEEN NULL AND col0
----
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5295
SELECT ALL + 9 FROM tab2 GROUP BY col2, col2 HAVING - CAST( + col2 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5295
SELECT ALL + 9 FROM tab2 GROUP BY col2, col2 HAVING - CAST ( + col2 AS INTEGER ) IS NULL
----

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5297
SELECT + 40 FROM tab2 GROUP BY col2, col0 HAVING NOT + + col0 < CASE col2 WHEN 51 + + - col0 THEN - + CASE 9 WHEN + col2 THEN - + col0 + 3 WHEN + 40 THEN NULL ELSE - + CAST( - 86 AS SIGNED ) END END
----

skipif mysql # not compatible
query I rowsort label-5297
SELECT + 40 FROM tab2 GROUP BY col2, col0 HAVING NOT + + col0 < CASE col2 WHEN 51 + + - col0 THEN - + CASE 9 WHEN + col2 THEN - + col0 + 3 WHEN + 40 THEN NULL ELSE - + CAST ( - 86 AS INTEGER ) END END
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING + col0 + col0 IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + - 91 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - col2 NOT BETWEEN - col1 + - + 72 AND ( 23 )
----
-91
-91

query II rowsort
SELECT DISTINCT col2 - - 82, col2 AS col2 FROM tab2 GROUP BY col2
----
140
58
161
79
169
87

query I rowsort
SELECT ALL + 98 FROM tab0 GROUP BY col1
----
98
98

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING - 67 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5303
SELECT - - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5303
SELECT - - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5304
SELECT - col0 / - 47 + - + col0 AS col0, col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST( NULL AS SIGNED ) IS NULL GROUP BY col0 HAVING NULL > - 30 + - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query II rowsort label-5304
SELECT - col0 / - 47 + - + col0 AS col0, col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col0 HAVING NULL > - 30 + - CAST ( NULL AS INTEGER )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - 1, 9 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT - 76 = - ( col2 ) + COALESCE ( + + 86, + + col0 )
----
-1
9

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT 64 / + ( - 7 ) NOT BETWEEN + 20 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5307
SELECT DISTINCT + col2 / col2 * + CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-5307
SELECT DISTINCT + col2 / col2 * + CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col2
----
NULL

query I rowsort
SELECT 86 * - col1 AS col0 FROM tab2 GROUP BY col1
----
-3526
-5074
-5246

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 + + 80 - - - 78 * + col2 col1 FROM tab1 AS cor0 WHERE ( NULL ) <= NULL GROUP BY col2, col1
----

query I rowsort
SELECT - 15 FROM tab1 AS cor0 WHERE ( NOT ( + - 97 / - col1 ) IS NOT NULL ) GROUP BY col0
----

query I rowsort
SELECT - ( - col0 ) AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 FROM tab0 WHERE NOT - - col1 <> NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5313
SELECT - col0 AS col0 FROM tab2 WHERE + 15 NOT IN ( + CAST( NULL AS SIGNED ) + - col2 + + 93 + col2 + col0, + col1 ) GROUP BY col2, col0, col1 HAVING NOT - 45 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5313
SELECT - col0 AS col0 FROM tab2 WHERE + 15 NOT IN ( + CAST ( NULL AS INTEGER ) + - col2 + + 93 + col2 + col0, + col1 ) GROUP BY col2, col0, col1 HAVING NOT - 45 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5314
SELECT + + col0 + + + 94 * CAST( + col0 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1, col0
----
2090
2660
7790

skipif mysql # not compatible
query I rowsort label-5314
SELECT + + col0 + + + 94 * CAST ( + col0 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1, col0
----
2090
2660
7790

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5315
SELECT - - CAST( NULL AS SIGNED ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5315
SELECT - - CAST ( NULL AS INTEGER ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5317
SELECT - + col1 * + col1 * + NULLIF ( - CAST( NULL AS SIGNED ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5317
SELECT - + col1 * + col1 * + NULLIF ( - CAST ( NULL AS INTEGER ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col2 * - col2 * + - 66 + ( + + col2 ) FROM tab0 GROUP BY col2
----
38040
411985
95342

query I rowsort
SELECT ALL - col2 - - 94 FROM tab1 GROUP BY col2
----
23
49
86

query I rowsort
SELECT ALL + 58 * - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
4698

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + + col1 ) FROM tab1 GROUP BY col1 HAVING NOT NULL > NULL
----

query II rowsort
SELECT + col2 AS col2, col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
24
38
38
79
79

query I rowsort
SELECT + 51 AS col0 FROM tab1 GROUP BY col1, col1, col1
----
51
51
51

query I rowsort
SELECT ALL + 7 * - col1 FROM tab0 GROUP BY col1, col2
----
-567
0
0

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) BETWEEN - - col0 AND - col0 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 * col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col0 + + col0 <= NULL
----

query I rowsort
SELECT 55 AS col0 FROM tab0 AS cor0 WHERE NULL <= + 98 GROUP BY col2
----

query I rowsort
SELECT DISTINCT + - 81 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81

query I rowsort
SELECT 58 + col1 FROM tab2 cor0 WHERE - col1 + + col2 NOT BETWEEN NULL AND + col2 * + col2 / col0 * + + 44 GROUP BY col1, col0 HAVING - col1 BETWEEN col0 AND NULL OR ( ( col1 ) ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5330
SELECT ALL col2, CAST( NULL AS SIGNED ) * - 4 + - 57 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-5330
SELECT ALL col2, CAST ( NULL AS INTEGER ) * - 4 + - 57 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2 HAVING ( + AVG ( - 55 ) + - - 28 ) > NULL
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT 24 <> - col2 * - - 12 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5333
SELECT + NULLIF ( - 30, - 65 ) FROM tab2 WHERE NOT + col0 <> + + ( + - CAST( NULL AS SIGNED ) ) * + col0 GROUP BY col0, col0, col0
----

skipif mysql # not compatible
query I rowsort label-5333
SELECT + NULLIF ( - 30, - 65 ) FROM tab2 WHERE NOT + col0 <> + + ( + - CAST ( NULL AS INTEGER ) ) * + col0 GROUP BY col0, col0, col0
----

query I rowsort
SELECT 56 AS col2 FROM tab2 GROUP BY col2 HAVING NOT - 52 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5335
SELECT - CAST( 56 AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-56
-56
-56

skipif mysql # not compatible
query I rowsort label-5335
SELECT - CAST ( 56 AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-56
-56
-56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5336
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - - CAST( NULL AS SIGNED ) <= NULL
----

skipif mysql # not compatible
query I rowsort label-5336
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - - CAST ( NULL AS INTEGER ) <= NULL
----

query I rowsort
SELECT ALL - + ( + ( + col0 ) ) * - ( - - col0 ) FROM tab2 AS cor0 WHERE - col0 * + + col2 IS NOT NULL GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 * 30 AS col0 FROM tab0 GROUP BY col0
----
1290
2490
780

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5339
SELECT DISTINCT 84 * + - ( + - CAST( NULL AS SIGNED ) ) + - - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-5339
SELECT DISTINCT 84 * + - ( + - CAST ( NULL AS INTEGER ) ) + - - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
NULL

query I rowsort
SELECT ALL - col0 * 37 FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING + 89 + - col2 IS NULL
----

query I rowsort
SELECT ALL 72 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
72
72
72

query I rowsort
SELECT + + ( - - col2 ) * + col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL = + 63
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 24 AS col0, col2 col1 FROM tab2 GROUP BY col1, col2
----
24
58
24
79
24
87

query I rowsort
SELECT ALL - 31 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-31
-31
-31

query I rowsort
SELECT - 57 FROM tab2 WHERE NOT - col1 / - col2 IS NULL GROUP BY col2
----
-57
-57
-57

query I rowsort
SELECT 36 FROM tab2 GROUP BY col2
----
36
36
36

query I rowsort
SELECT DISTINCT col2 * col2 AS col0 FROM tab1 WHERE NULL <= + 30 GROUP BY col2
----

query I rowsort
SELECT ALL 59 + col2 FROM tab1 GROUP BY col2
----
104
130
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 76 * col2 col2 FROM tab0 GROUP BY col2
----
1824
2888
6004

query I rowsort
SELECT - col0 - - ( col0 ) FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - 89 + + col2 AS col2 FROM tab0 GROUP BY col2
----
-10
-51
-65

query I rowsort
SELECT DISTINCT ( - 31 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col0 - + col0 AS col2 FROM tab2 GROUP BY col0 HAVING col0 IN ( 3 )
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col0, col1, col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT + ( - col1 ) FROM tab2 GROUP BY col1
----
-41
-59
-61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5356
SELECT DISTINCT col0 FROM tab0 WHERE NULL NOT IN ( 91 + - CAST( NULL AS DECIMAL ) ) GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-5356
SELECT DISTINCT col0 FROM tab0 WHERE NULL NOT IN ( 91 + - CAST ( NULL AS REAL ) ) GROUP BY col2, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5357
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5357
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT ALL col0 + - col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + 43 * 11 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) BETWEEN col2 AND - col0 * + + col2 * - + 17 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT 17 AS col0, - col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
17
-81
17
0

query I rowsort
SELECT 66 AS col1 FROM tab1 cor0 GROUP BY col2
----
66
66
66

query I rowsort
SELECT ALL col0 * col0 * col0 + + 43 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
3418
753614
778731

query I rowsort
SELECT + + col2 * - - col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL 96 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5365
SELECT ALL + 2 + - ( 63 ) AS col1 FROM tab2 AS cor0 WHERE NOT CAST( NULL AS SIGNED ) IS NOT NULL GROUP BY col0
----
-61
-61
-61

skipif mysql # not compatible
query I rowsort label-5365
SELECT ALL + 2 + - ( 63 ) AS col1 FROM tab2 AS cor0 WHERE NOT CAST ( NULL AS INTEGER ) IS NOT NULL GROUP BY col0
----
-61
-61
-61

query I rowsort
SELECT ALL - 15 FROM tab2 GROUP BY col1
----
-15
-15
-15

query I rowsort
SELECT DISTINCT 39 FROM tab0 GROUP BY col0, col2
----
39

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5368
SELECT ALL + ( + 21 ) * + + NULLIF ( - 70, - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING + 54 / - col1 * - CAST( NULL AS SIGNED ) + - + col1 - - col0 + - + col2 IS NULL
----
-1470
-1470
-1470

skipif mysql # not compatible
query I rowsort label-5368
SELECT ALL + ( + 21 ) * + + NULLIF ( - 70, - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING + 54 / - col1 * - CAST ( NULL AS INTEGER ) + - + col1 - - col0 + - + col2 IS NULL
----
-1470
-1470
-1470

query I rowsort
SELECT + col0 + - - col0 FROM tab0 WHERE NOT + 29 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL 46 AS col2 FROM tab2 GROUP BY col0
----
46
46
46

query I rowsort
SELECT - 78 * + col0 AS col1 FROM tab2 WHERE + col1 * - + col0 - + col1 IS NULL GROUP BY col1, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT IN ( - col1 * - col1 + - col1 * + 43, col1 * - - 95, col1 + col1 * 40, - col1, col1 * + col1 * - col1 )
----

query I rowsort
SELECT ALL - ( col1 ) FROM tab2 GROUP BY col1 HAVING NOT 18 IS NULL
----
-41
-59
-61

query I rowsort
SELECT + 94 AS col1 FROM tab0 GROUP BY col2
----
94
94
94

query I rowsort
SELECT 4 * col2 FROM tab1 GROUP BY col2
----
180
284
32

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-5377
SELECT ALL 98 * + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5377
SELECT ALL 98 * + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 6 + - + 58 - col0 AS col2 FROM tab1 GROUP BY col0
----
-134
-74
-80

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 40 * 23 * - + col1 col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
37720
54280
56120

query II rowsort
SELECT ALL - 30 * + + 90 AS col2, + col2 * + - 93 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2700
-4185
-2700
-6603
-2700
-744

query I rowsort
SELECT + 0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT - - ( 70 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - 55 = NULL
----

query I rowsort
SELECT DISTINCT + 20 + col1 * + - 77 AS col2 FROM tab1 cor0 GROUP BY col1
----
-3368
-4369
-442

query I rowsort
SELECT col1 * + 41 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
3321

query I rowsort
SELECT + 42 - + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-39
42
42

query I rowsort
SELECT ALL + 1 + - + 50 FROM tab2 GROUP BY col1
----
-49
-49
-49

query I rowsort
SELECT - 16 + - col0 * - 55 FROM tab2 GROUP BY col0
----
4989
5044
809

query I rowsort
SELECT DISTINCT 77 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
77

query I rowsort
SELECT DISTINCT 78 AS col2 FROM tab2 GROUP BY col0
----
78

query I rowsort
SELECT DISTINCT + 28 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL AND NOT + ( + COALESCE ( - col1, + COALESCE ( col1, - 43 ) ) ) IS NULL
----
28

onlyif mysql # DIV for integer division: 
query I rowsort label-5391
SELECT + col0 + - col0 DIV ( col0 ) DIV + + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

skipif mysql # not compatible
query I rowsort label-5391
SELECT + col0 + - col0 / ( col0 ) / + + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab1 cor0 GROUP BY col0, col0
----
484
6724
784

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE col2 IS NULL GROUP BY col1
----

query II rowsort
SELECT + col2 + + col2, col2 * + + 74 AS col0 FROM tab1 cor0 GROUP BY col2, col2
----
142
5254
16
592
90
3330

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-5395
SELECT - CAST( + + col2 AS SIGNED ) + col2 - 50 * col2 DIV - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-50
-50
-50

skipif mysql # not compatible
query I rowsort label-5395
SELECT - CAST ( + + col2 AS INTEGER ) + col2 - 50 * col2 / - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-50
-50
-50

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5396
SELECT - CAST( NULL AS SIGNED ) * - + col0 * - 73 AS col2 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5396
SELECT - CAST ( NULL AS INTEGER ) * - + col0 * - 73 AS col2 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 15 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
15
15
15

query I rowsort
SELECT + + col1 * + col1 * col1 + - - 20 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
185213
236
85204

query II rowsort
SELECT - + 46 + + col2 AS col2, ( - - 90 ) FROM tab0 AS cor0 GROUP BY col2
----
-22
90
-8
90
33
90

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT + col1 * col1 * + + col1 + - col1 FROM tab1 GROUP BY col1
----
185136
210
85140

query I rowsort
SELECT DISTINCT col0 * - - 85 FROM tab0 GROUP BY col0, col1
----
2210
3655
7055

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5403
SELECT ALL CAST( NULL AS SIGNED ) + 67 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5403
SELECT ALL CAST ( NULL AS INTEGER ) + 67 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col1 + + ( + + col1 ) AS col0 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 WHERE NOT NULL BETWEEN col0 AND ( + - 53 ) GROUP BY col2, col1
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - 79 IN ( - col1 + + col2, col1 )
----
44
57
6

query I rowsort
SELECT ALL col2 * - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + ( - col1 ) - - 32 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-27
-29
-9

query I rowsort
SELECT DISTINCT + - ( + + col2 ) AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col2 + + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-5413
SELECT ALL + 77 + col0 DIV col1 col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
77
78
80

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5413
SELECT ALL + 77 + col0 / col1 col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
77
78
80

query I rowsort
SELECT ALL 75 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - 39 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
-39
-39
-39

query I rowsort
SELECT ( - col1 ) - col0 FROM tab1 WHERE NOT ( NULL ) BETWEEN NULL AND 9 * - 80 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( ( 38 ) IS NULL )
----
0
81

query I rowsort
SELECT col2 + - 16 FROM tab1 GROUP BY col2
----
-8
29
55

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND - 53
----

query I rowsort
SELECT col2 FROM tab1 WHERE NOT - 43 + + col1 + - col2 - - 57 + + col2 IN ( col0 ) GROUP BY col2
----
45
71
8

query I rowsort
SELECT 31 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - 21 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5423
SELECT ALL 58 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT CAST( 47 AS SIGNED ) < + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5423
SELECT ALL 58 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT CAST ( 47 AS INTEGER ) < + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL ( 78 ) FROM tab2 AS cor0 GROUP BY col0, col2
----
78
78
78

query I rowsort
SELECT DISTINCT + - 57 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-57

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT col0 * + + 57 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1482
2451
4731

query I rowsort
SELECT + + 40 + - 38 + - + 43 / + ( - - col0 ) + - + 25 * - - col0 FROM tab2 cor0 WHERE + col2 IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT ALL - 75 FROM tab0 AS cor0 GROUP BY col2
----
-75
-75
-75

query I rowsort
SELECT DISTINCT - ( col1 ) * - col1 FROM tab2 GROUP BY col1 HAVING NULL >= - col1
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING - 98 NOT BETWEEN NULL AND - - ( + ( - 11 ) )
----

query I rowsort
SELECT + ( - col1 ) + - 75 FROM tab0 AS cor0 GROUP BY col1, col2
----
-156
-75
-75

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5435
SELECT col0 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= + + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-5435
SELECT col0 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= + + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT + + 50 FROM tab2 AS cor0 WHERE 44 - + - col2 * - - col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT + + ( + + 50 ) AS col2 FROM tab2 cor0 GROUP BY col0
----
50
50
50

query I rowsort
SELECT ALL 39 + + 0 FROM tab1 GROUP BY col1, col0
----
39
39
39

query I rowsort
SELECT - col0 + + col0 - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5440
SELECT DISTINCT - - 63 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT CAST( NULL AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5440
SELECT DISTINCT - - 63 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT CAST ( NULL AS REAL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5441
SELECT DISTINCT CAST( + COALESCE ( - + col1, - CAST( - 7 AS SIGNED ) * col0 + + ( - 81 ) + - col0 ) AS SIGNED ) FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-5441
SELECT DISTINCT CAST ( + COALESCE ( - + col1, - CAST ( - 7 AS INTEGER ) * col0 + + ( - 81 ) + - col0 ) AS INTEGER ) FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + 49 FROM tab0 AS cor0 GROUP BY col0, col2
----
49
49
49

query I rowsort
SELECT 56 FROM tab1 AS cor0 GROUP BY col0, col1
----
56
56
56

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING - col1 IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - 38 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT - col2 + - - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
1444
576
6241

query I rowsort
SELECT + + 41 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
41
41
41

query I rowsort
SELECT ALL + 11 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 - col0 * - 65 FROM tab0 AS cor0 GROUP BY col0
----
1716
2838
5478

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - - 46 col0, - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col0 ) IS NOT NULL
----

query I rowsort
SELECT col2 + + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
153
30
73

query I rowsort
SELECT ALL - col2 * 91 + col2 AS col2 FROM tab0 cor0 WHERE NOT 34 + 75 < + 91 * - + col2 + - + col1 * + 96 * ( - 64 ) GROUP BY col2
----
-3420
-7110

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5453
SELECT - NULLIF ( - ( - - CAST( + 98 AS SIGNED ) ), - - col0 ) * - col0 AS col0 FROM tab0 cor0 WHERE NOT 0 + + 61 IS NOT NULL GROUP BY col1, col0
----

skipif mysql # not compatible
query I rowsort label-5453
SELECT - NULLIF ( - ( - - CAST ( + 98 AS INTEGER ) ), - - col0 ) * - col0 AS col0 FROM tab0 cor0 WHERE NOT 0 + + 61 IS NOT NULL GROUP BY col1, col0
----

query II rowsort
SELECT col0, - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT ALL ( - 13 ) * - + 58 - + col1 - 31 FROM tab0 GROUP BY col1 HAVING NULL IN ( col1 )
----

query I rowsort
SELECT ALL - 95 * - 40 FROM tab2 GROUP BY col1 HAVING NOT - 5 * + + col1 * + 84 IS NOT NULL
----

query I rowsort
SELECT 39 AS col1 FROM tab2 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-5458
SELECT ALL + - col1 DIV - col1 AS col0, ( col1 ) FROM tab2 AS cor0 GROUP BY col1
----
1
41
1
59
1
61

skipif mysql # not compatible
query II rowsort label-5458
SELECT ALL + - col1 / - col1 AS col0, ( col1 ) FROM tab2 AS cor0 GROUP BY col1
----
1
41
1
59
1
61

query I rowsort
SELECT DISTINCT - + 0 + 76 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
76

query I rowsort
SELECT 19 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 WHERE NOT NULL <> NULL GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT 76, - ( + + col0 ) * + ( - col0 ) + - col0 AS col1 FROM tab0 GROUP BY col0
----
76
1806
76
650
76
6806

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col2, col1
----
-15
-91
-92

query I rowsort
SELECT - col1 - + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( - + 3 ) IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * 38 * col0 + + ( ( - col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( - 36 ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 * + 84 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT 19 - - col0 * + col0 FROM tab1 AS cor0 WHERE NOT col1 <= NULL GROUP BY col0, col1
----

query I rowsort
SELECT col2 AS col0 FROM tab2 WHERE NOT 75 IN ( - col2 ) GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col2 * + + col2 FROM tab2 GROUP BY col2, col0
----
-3364
-6241
-7569

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 36 AS col0 FROM tab0 AS cor0 WHERE NULL <= NULL GROUP BY col0, col1 HAVING NOT 35 * 88 IS NOT NULL
----

query I rowsort
SELECT ( ( col1 ) ) FROM tab1 AS cor0 GROUP BY col1 HAVING 34 IS NOT NULL
----
44
57
6

query I rowsort
SELECT 30 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( + col0 * + col0 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + col1 col2 FROM tab0 AS cor0 WHERE NOT 82 + - col0 IS NULL GROUP BY col1, col2, col0
----
0
0
6561

query I rowsort
SELECT + col1 * + + col2 * 68 + 8 * col1 + - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL = col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5476
SELECT - 95 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( + CAST( - 23 AS SIGNED ) ) = - CAST( NULL AS SIGNED ) * + col1 OR NOT 60 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5476
SELECT - 95 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( + CAST ( - 23 AS INTEGER ) ) = - CAST ( NULL AS INTEGER ) * + col1 OR NOT 60 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 59 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
59

query I rowsort
SELECT DISTINCT + 87 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( + NULLIF ( + - col1, + col2 / - 4 ) * 16 ) GROUP BY col2, col1
----

query I rowsort
SELECT - ( - 89 ) FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT - 33 + + col2 NOT BETWEEN + col2 AND ( col2 + - col0 )
----

query I rowsort
SELECT + - col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col1, col2, col2 HAVING NOT col2 + - col1 IS NULL
----

query I rowsort
SELECT + 55 * + ( + 8 ) AS col1 FROM tab0 cor0 GROUP BY col0 HAVING + ( + 31 ) * 68 IS NOT NULL
----
440
440
440

query I rowsort
SELECT + 10 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( - 62 ) IS NOT NULL
----

query I rowsort
SELECT 13 FROM tab0 GROUP BY col0
----
13
13
13

query I rowsort
SELECT 67 AS col1 FROM tab0 GROUP BY col2
----
67
67
67

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NULL <> - - col0
----

query I rowsort
SELECT ALL + ( + col1 ) FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + 51 FROM tab0 GROUP BY col2
----
51
51
51

query I rowsort
SELECT ALL col1 * + - col1 + - 31 FROM tab0 GROUP BY col1
----
-31
-6592

query I rowsort
SELECT + 11 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
891

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5491
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL > - CASE - + CAST( NULL AS SIGNED ) WHEN + 0 * + 66 THEN - 38 END
----

skipif mysql # not compatible
query I rowsort label-5491
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL > - CASE - + CAST ( NULL AS INTEGER ) WHEN + 0 * + 66 THEN - 38 END
----

query II rowsort
SELECT + 5 * - col1, col1 + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-205
82
-295
118
-305
122

query I rowsort
SELECT - col2 + - + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-105
-121
-67

query I rowsort
SELECT - col0 * - ( + + 18 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
1638
1656
270

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5495
SELECT - col0 AS col0 FROM tab2 WHERE - 38 >= ( + 87 * - CAST( NULL AS SIGNED ) ) GROUP BY col0, col0
----

skipif mysql # not compatible
query I rowsort label-5495
SELECT - col0 AS col0 FROM tab2 WHERE - 38 >= ( + 87 * - CAST ( NULL AS INTEGER ) ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + 38 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL OR NULL IN ( + col1, col0, - 97, + col2 ) GROUP BY col1
----
38

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
484
6724
784

query II rowsort
SELECT col1, col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + + 56 IS NOT NULL
----
2025
5041
64

query I rowsort
SELECT ALL 73 * + col1 FROM tab2 GROUP BY col1, col2, col1
----
2993
4307
4453

query I rowsort
SELECT - col2 + + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 39 col2 FROM tab2 AS cor0 GROUP BY col0
----
-39

query I rowsort
SELECT DISTINCT ( - col0 ) AS col1 FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT 93 * + 34 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( NULL IS NULL ) )
----
3162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 96 col2 FROM tab0 GROUP BY col0
----
96
96
96

query I rowsort
SELECT DISTINCT + col0 * + 56 FROM tab2 AS cor0 GROUP BY col0, col2
----
5096
5152
840

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col2 HAVING - + col0 > NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-5508
SELECT col0 DIV - 46 AS col1, col0 + - - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT 33 IS NULL
----
-1
182
-2
184
0
30

skipif mysql # not compatible
query II rowsort label-5508
SELECT col0 / - 46 AS col1, col0 + - - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT 33 IS NULL
----
-1
182
-2
184
0
30

query I rowsort
SELECT + 29 - + col2 FROM tab0 GROUP BY col2
----
-50
-9
5

query I rowsort
SELECT DISTINCT + ( - - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5511
SELECT + - col1 + + CAST( NULL AS SIGNED ) + col1 * + - col2 * - + col2 - + - 71 FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5511
SELECT + - col1 + + CAST ( NULL AS INTEGER ) + col1 * + - col2 * - + col2 - + - 71 FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col1 - + col1 / + + col1 * + 56 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 94 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING + 60 IS NULL
----

query I rowsort
SELECT + col1 - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT - col0 * + - 26 + 82 FROM tab2 GROUP BY col2, col0
----
2448
2474
472

query I rowsort
SELECT - col0 / - col1 * + 44 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 86 FROM tab2 GROUP BY col2
----
-86
-86
-86

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT + 82 * 40 IN ( - 52, + col1, col2, + + col2 + - col1 ) GROUP BY col2
----
58
79
87

query I rowsort
SELECT + + 6 FROM tab1 cor0 GROUP BY col1
----
6
6
6

query II rowsort
SELECT + ( col1 ) AS col2, - ( ( + + col1 ) ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
41
-41
59
-59
61
-61

query I rowsort
SELECT + col2 + - 74 * - - 24 AS col1 FROM tab1 GROUP BY col2
----
-1705
-1731
-1768

query I rowsort
SELECT 99 FROM tab0 GROUP BY col1
----
99
99

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5523
SELECT DISTINCT - col0 * + + CAST( NULL AS DECIMAL ) AS col0 FROM tab2 cor0 GROUP BY col2, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-5523
SELECT DISTINCT - col0 * + + CAST ( NULL AS REAL ) AS col0 FROM tab2 cor0 GROUP BY col2, col0
----
NULL

query I rowsort
SELECT ALL 50 * col2 + + col2 FROM tab1 cor0 GROUP BY col2
----
2295
3621
408

query I rowsort
SELECT ALL - 56 + 43 FROM tab1 GROUP BY col2
----
-13
-13
-13

onlyif mysql # DIV for integer division: 
query II rowsort label-5526
SELECT DISTINCT - - 28 + - col2 * - ( + + col2 ) AS col2, col2 DIV col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2053
1
5069
1
92
1

skipif mysql # not compatible
query II rowsort label-5526
SELECT DISTINCT - - 28 + - col2 * - ( + + col2 ) AS col2, col2 / col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2053
1
5069
1
92
1

query I rowsort
SELECT + 77 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL <> ( NULL ) )
----

query I rowsort
SELECT col2 FROM tab1 WHERE NULL BETWEEN - - 39 AND 43 * 45 GROUP BY col2
----

query I rowsort
SELECT 1 AS col2 FROM tab2 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT + 24 FROM tab2 GROUP BY col0, col1
----
24
24
24

query I rowsort
SELECT DISTINCT - col0 + + - 92 FROM tab0 WHERE ( col2 IS NOT NULL ) GROUP BY col2, col0
----
-118
-135
-175

query I rowsort
SELECT col0 - col0 FROM tab0 WHERE NOT ( NOT - col1 <> NULL ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5534
SELECT - - 78, + 72 AS col1 FROM tab1 WHERE NOT - + CAST( NULL AS SIGNED ) IS NULL GROUP BY col2, col0
----

skipif mysql # not compatible
query II rowsort label-5534
SELECT - - 78, + 72 AS col1 FROM tab1 WHERE NOT - + CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col0 * - ( col0 ) FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT 90 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT 64 * + - 70 FROM tab1 AS cor0 GROUP BY col1
----
-4480
-4480
-4480

query I rowsort
SELECT ALL + 43 FROM tab2 GROUP BY col2, col2
----
43
43
43

query I rowsort
SELECT + 91 AS col1 FROM tab2 GROUP BY col0, col0
----
91
91
91

query I rowsort
SELECT + + 51 * - 67 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-3417
-3417
-3417

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col1 * - - col1 AS col0 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT ( col1 ) AS col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

query II rowsort
SELECT DISTINCT - col0 AS col2, 38 FROM tab1 GROUP BY col2, col0
----
-22
38
-28
38
-82
38

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5546
SELECT DISTINCT - CAST( NULL AS SIGNED ) col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5546
SELECT DISTINCT - CAST ( NULL AS INTEGER ) col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT + ( - + col0 ) FROM tab0 GROUP BY col2, col0 HAVING NOT + + 84 NOT BETWEEN - col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5548
SELECT ALL + CAST( NULL AS SIGNED ) * - + CAST( CAST( NULL AS DECIMAL ) AS SIGNED ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5548
SELECT ALL + CAST ( NULL AS INTEGER ) * - + CAST ( CAST ( NULL AS REAL ) AS INTEGER ) FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 21 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5550
SELECT DISTINCT + col1 + - 48 DIV + 29 FROM tab1 cor0 GROUP BY col1, col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-5550
SELECT DISTINCT + col1 + - 48 / + 29 FROM tab1 cor0 GROUP BY col1, col1
----
43
5
56

onlyif mysql # DIV for integer division: 
query II rowsort label-5551
SELECT 31 * + - col2 + - col2 AS col1, - col2 DIV - - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1440
-1
-2272
-1
-256
-1

skipif mysql # not compatible
query II rowsort label-5551
SELECT 31 * + - col2 + - col2 AS col1, - col2 / - - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1440
-1
-2272
-1
-256
-1

onlyif mysql # DIV for integer division: 
query II rowsort label-5552
SELECT col2 DIV + 3 AS col1, 83 + 78 - - - 94 * + 8 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IN ( - 64 )
----
19
-591
26
-591
29
-591

skipif mysql # not compatible
query II rowsort label-5552
SELECT col2 / + 3 AS col1, 83 + 78 - - - 94 * + 8 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IN ( - 64 )
----
19
-591
26
-591
29
-591

query I rowsort
SELECT DISTINCT + 3 FROM tab0 GROUP BY col0
----
3

query I rowsort
SELECT + 46 FROM tab2 AS cor0 WHERE - col1 IS NULL GROUP BY col0, col2 HAVING NOT NULL > + 4
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - - 2 * - + col2 col0, ( - col1 ) + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL <= + col2
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT - 93 NOT BETWEEN - col1 / - 99 AND NULL
----

query I rowsort
SELECT DISTINCT 73 - - ( - 32 ) AS col2 FROM tab0 GROUP BY col1
----
41

query I rowsort
SELECT ALL 56 - - + col0 * col0 FROM tab2 GROUP BY col0
----
281
8337
8520

query I rowsort
SELECT 76 FROM tab2 GROUP BY col2
----
76
76
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 / + 8 col1, col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) <> col0
----

query II rowsort
SELECT ALL col2 * col1 + + - col2 AS col1, + 71 / - col1 * - COALESCE ( + col2, + col1 + - col1 ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL <= 4
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + 40 col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT + - 12 IS NOT NULL
----

query I rowsort
SELECT col2 - + 7 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING - col1 IS NOT NULL
----
17
31
72

query II rowsort
SELECT - 62, 85 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-62
85
-62
85

query II rowsort
SELECT ALL + 92 AS col1, col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
92
58
92
79
92
87

query I rowsort
SELECT ALL - col0 * + col0 AS col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT col2 >= + col2 * - 30
----

query I rowsort
SELECT ALL + 46 FROM tab1 cor0 GROUP BY col1
----
46
46
46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5570
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT CAST( NULL AS SIGNED ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-5570
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT CAST ( NULL AS INTEGER ) <> NULL
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN ( + col2 ) AND 23
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5572
SELECT ALL 56 DIV col2 AS col2 FROM tab2 GROUP BY col2, col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-5572
SELECT ALL 56 / col2 AS col2 FROM tab2 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT - col2 * - - 29 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-1682
-2291
-2523

query I rowsort
SELECT DISTINCT - 49 FROM tab0 GROUP BY col2, col0 HAVING NOT - - 79 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 85 col2 FROM tab1 GROUP BY col1, col2, col1 HAVING NOT - - 36 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 2 AS col0 FROM tab2 GROUP BY col1, col2, col2
----
2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5577
SELECT ALL COALESCE ( - CAST( NULL AS SIGNED ), + + 99, 18 ) * col1 AS col2 FROM tab0 GROUP BY col1
----
0
8019

skipif mysql # not compatible
query I rowsort label-5577
SELECT ALL COALESCE ( - CAST ( NULL AS INTEGER ), + + 99, 18 ) * col1 AS col2 FROM tab0 GROUP BY col1
----
0
8019

query I rowsort
SELECT - - col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT + + 16 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
16
16

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NULL BETWEEN 17 / - - col1 AND ( NULL ) GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 + - + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 IS NULL
----
-17
-20
-26

query I rowsort
SELECT col0 * - 87 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-1914
-2436
-7134

query I rowsort
SELECT ALL 92 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
92
92
92

onlyif mysql # DIV for integer division: 
query I rowsort label-5584
SELECT DISTINCT col2 DIV + col2 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-5584
SELECT DISTINCT col2 / + col2 FROM tab2 GROUP BY col2
----
1

query I rowsort
SELECT + 61 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + ( + col1 ) col1 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - 59 / - - col0 * - col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT col2 + + col2 * col2 AS col0 FROM tab1 GROUP BY col2
----
2070
5112
72

query I rowsort
SELECT DISTINCT col0 * + 4 FROM tab1 GROUP BY col1, col0
----
112
328
88

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 WHERE NOT - 28 + + ( - col1 ) NOT IN ( - col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col1, col0, col0 HAVING NULL >= 47 * col0
----

query I rowsort
SELECT ( + col1 ) FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + - 60 FROM tab0 AS cor0 GROUP BY col0
----
-60
-60
-60

query I rowsort
SELECT DISTINCT - + col2 + + - 25 * 31 * - col2 - - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
34875
55025
6200

query I rowsort
SELECT 52 FROM tab0 AS cor0 GROUP BY col2, col1
----
52
52
52

query I rowsort
SELECT ALL col0 * - col0 AS col0 FROM tab0 WHERE NOT 86 - + col1 < - 33 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT 48 * - col1 FROM tab1 GROUP BY col1, col1
----
-2112
-2736
-288

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT 54 * col1 NOT BETWEEN NULL AND + col2
----

query I rowsort
SELECT 19 FROM tab0 GROUP BY col0, col1, col2 HAVING NOT - col2 BETWEEN ( col1 / 4 + + COALESCE ( col2, col2 ) ) AND ( - 9 )
----
19
19
19

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5602
SELECT DISTINCT CAST( NULL AS SIGNED ) + ( 47 ) * - 58 col0 FROM tab1 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5602
SELECT DISTINCT CAST ( NULL AS INTEGER ) + ( 47 ) * - 58 col0 FROM tab1 GROUP BY col2, col2
----
NULL

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT AVG ( DISTINCT 85 ) FROM tab0 cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-5607
SELECT DISTINCT - col1 + - - 25 FROM tab2 WHERE NULL BETWEEN + CAST( + - CAST( NULL AS DECIMAL ) AS SIGNED ) * ( + + ( + - col2 ) ) AND + col0 + - col1 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5607
SELECT DISTINCT - col1 + - - 25 FROM tab2 WHERE NULL BETWEEN + CAST ( + - CAST ( NULL AS REAL ) AS INTEGER ) * ( + + ( + - col2 ) ) AND + col0 + - col1 GROUP BY col1
----

query I rowsort
SELECT + 71 * + col2 FROM tab2 AS cor0 WHERE NOT NULL <= ( NULL ) GROUP BY col2, col2
----

query II rowsort
SELECT DISTINCT 69 * - ( - col0 ), - 55 * + - col0 / - 78 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT col2 * col2 + col2 * 15 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL <> + col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5611
SELECT col0 * + - col0 * + ( + col0 ) DIV + col0 + + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5611
SELECT col0 * + - col0 * + ( + col0 ) / + col0 + + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT - AVG ( NULLIF ( + 42, + col2 ) ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL NOT BETWEEN 56 AND 79 )
----

query I rowsort
SELECT 78 FROM tab2 AS cor0 GROUP BY col2
----
78
78
78

query I rowsort
SELECT ALL + col0 * + col0 FROM tab0 AS cor0 WHERE + col2 > NULL GROUP BY col0
----

query II rowsort
SELECT col2 + - col1 + + - col2 * col2, ( col2 ) FROM tab1 GROUP BY col2, col1
----
-2037
45
-5014
71
-62
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 44 col1 FROM tab0 GROUP BY col1
----
44

query I rowsort
SELECT DISTINCT - - 23 FROM tab2 WHERE col1 IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 30 col1 FROM tab0 AS cor0 GROUP BY col2
----
30
30
30

query I rowsort
SELECT ALL + col2 * - - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL - col0 * 41 AS col1 FROM tab0 GROUP BY col0
----
-1066
-1763
-3403

query I rowsort
SELECT DISTINCT 57 AS col0 FROM tab0 GROUP BY col0, col1
----
57

query I rowsort
SELECT - 77 AS col0 FROM tab2 GROUP BY col0, col2 HAVING - + col0 = ( + 23 )
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT + + 93 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 31 * - - 77 AS col0 FROM tab1 WHERE NULL IN ( - 11 + + 77, + COALESCE ( - + 67, - - 70 ) + - col1 + - 82 * + col0 * + col0, - 22, - col0 ) GROUP BY col2, col0 HAVING NOT - col2 >= NULL
----

query I rowsort
SELECT DISTINCT + 83 AS col0 FROM tab0 GROUP BY col1, col1
----
83

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT + 33 IS NULL
----
44
57
6

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 - - 20 AS col0 FROM tab1 cor0 GROUP BY col1, col2
----
20
20
20

query II rowsort
SELECT ALL - col2 AS col0, 90 * + col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - col1 + ( - - col1 ) IN ( + 17 )
----

query I rowsort
SELECT 17 * + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-5632
SELECT CASE col0 WHEN - 79 THEN NULL WHEN + + ( + CAST( col1 AS DECIMAL ) ) + - col0 THEN - 96 END, + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-5632
SELECT CASE col0 WHEN - 79 THEN NULL WHEN + + ( + CAST ( col1 AS REAL ) ) + - col0 THEN - 96 END, + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
22
NULL
28
NULL
82

query I rowsort
SELECT - col1 + - 57 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-116
-118
-98

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - 52 NOT BETWEEN NULL AND - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT DISTINCT 20 + - col2 AS col0, + col2 col0, - 95 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
9 values hashing to 44912f0b8cb9b18845e83ac435de9c5f

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5636
SELECT ALL - - col2 * - + col2 * + col2 + + col2 * CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5636
SELECT ALL - - col2 * - + col2 * + col2 + + col2 * CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + + 37 FROM tab2 AS cor0 GROUP BY col0, col1
----
37
37
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5638
SELECT CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5638
SELECT CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col1, col2, col0
----
-15
-91
-92

query I rowsort
SELECT 82 * + 72 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL 10 + 27 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL CASE col2 WHEN + col1 THEN - col2 + - - ( 90 ) * - 0 ELSE NULL END + - 97 * - AVG ( + + 68 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 16 FROM tab1 cor0 GROUP BY col1, col0
----
-16

query I rowsort
SELECT - 78 * col0 * - + col0 AS col0 FROM tab1 GROUP BY col0, col0 HAVING + ( - 62 ) IS NULL
----

query I rowsort
SELECT + col1 * + col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query II rowsort
SELECT col0, - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
-26
43
-43
83
-83

query II rowsort
SELECT - col1 AS col2, ( col1 ) AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT + ( - col0 ) IS NULL
----
-44
44
-57
57
-6
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 63 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT ( + 68 ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL ( - 57 ) FROM tab2 AS cor0 GROUP BY col2, col0
----
-57
-57
-57

query I rowsort
SELECT ALL + col0 / col0 + + - 51 + - col1 + - 54 FROM tab2 WHERE NOT ( NOT ( NOT NULL IS NULL ) ) GROUP BY col1, col0, col1
----

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab2 GROUP BY col0 HAVING NULL BETWEEN + + 67 AND NULL
----

query I rowsort
SELECT + 84 FROM tab2 WHERE col0 * + - 91 * + col2 <> NULL GROUP BY col2
----

query I rowsort
SELECT col2 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + 46 FROM tab2 AS cor0 GROUP BY col1, col0
----
46

query I rowsort
SELECT DISTINCT col1 * 7 * + col1 + - col1 AS col1 FROM tab0 GROUP BY col2, col1, col2
----
0
45846

query I rowsort
SELECT ( - - col2 ) FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col2 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT - + 4 * + col2 FROM tab0 cor0 GROUP BY col2
----
-152
-316
-96

query I rowsort
SELECT 34 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
34
34
34

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL - 34 FROM tab2 GROUP BY col2
----
-34
-34
-34

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT col2 + - 97 FROM tab1 GROUP BY col2
----
-26
-52
-89

query I rowsort
SELECT + col2 + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
2070
5112
72

query I rowsort
SELECT - 78 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-78
-78
-78

query I rowsort
SELECT + 79 * - col1 + - ( 43 ) FROM tab0 cor0 GROUP BY col1
----
-43
-6442

query I rowsort
SELECT - + 0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - + ( - col1 ) + + + col0 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5669
SELECT ALL CAST( 59 AS SIGNED ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5669
SELECT ALL CAST ( 59 AS INTEGER ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5670
SELECT ALL + 68 * - CAST( NULL AS SIGNED ) / + col2 * - + col2 AS col0, col2 * + col2 - 2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
1442
NULL
574
NULL
6239

skipif mysql # not compatible
query II rowsort label-5670
SELECT ALL + 68 * - CAST ( NULL AS INTEGER ) / + col2 * - + col2 AS col0, col2 * + col2 - 2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
1442
NULL
574
NULL
6239

query I rowsort
SELECT + col0 * - col2 AS col2 FROM tab1 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT + 30 AS col1 FROM tab2 WHERE ( - - ( col2 ) ) NOT BETWEEN + col1 AND + 45 * + + col2 GROUP BY col1 HAVING NOT + 34 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 col0, col1 col1 FROM tab1 GROUP BY col1, col1 HAVING - 72 IS NULL
----

query II rowsort
SELECT col2, + 20 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + 92 AS col2 FROM tab2 GROUP BY col1, col1
----
92

query I rowsort
SELECT + 55 * + col1 FROM tab1 WHERE ( + ( col1 ) ) IS NOT NULL GROUP BY col1, col2, col1
----
2420
3135
330

query I rowsort
SELECT ALL + - 30 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
-30
-30

query I rowsort
SELECT - 55 * - col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
1430
2365
4565

query II rowsort
SELECT DISTINCT col2, - ( - col2 ) FROM tab0 GROUP BY col2, col2 HAVING NOT 71 IS NULL
----
24
24
38
38
79
79

query I rowsort
SELECT + 13 FROM tab1 GROUP BY col0, col2, col1
----
13
13
13

query I rowsort
SELECT ALL - col0 * col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING ( - col1 ) <> NULL
----

query I rowsort
SELECT + 30 AS col1 FROM tab0 GROUP BY col0 HAVING - 45 IS NOT NULL
----
30
30
30

onlyif mysql # DIV for integer division: 
query I rowsort label-5683
SELECT DISTINCT 20 DIV 89 + 22 * ( + col1 ) AS col2 FROM tab0 GROUP BY col1, col1
----
0
1782

skipif mysql # not compatible
query I rowsort label-5683
SELECT DISTINCT 20 / 89 + 22 * ( + col1 ) AS col2 FROM tab0 GROUP BY col1, col1
----
0
1782

query I rowsort
SELECT ALL col2 * 90 FROM tab1 GROUP BY col2 HAVING ( NULL ) IN ( + NULLIF ( - 15, + col2 ) - - col2 )
----

query I rowsort
SELECT col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 * - col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5687
SELECT CASE CAST( - col0 AS SIGNED ) WHEN + CAST( NULL AS SIGNED ) THEN 26 ELSE + col0 + 43 END * 28 FROM tab2 GROUP BY col0
----
1624
3752
3780

skipif mysql # not compatible
query I rowsort label-5687
SELECT CASE CAST ( - col0 AS INTEGER ) WHEN + CAST ( NULL AS INTEGER ) THEN 26 ELSE + col0 + 43 END * 28 FROM tab2 GROUP BY col0
----
1624
3752
3780

query I rowsort
SELECT ALL 76 FROM tab2 GROUP BY col0
----
76
76
76

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5689
SELECT + col2 + CAST( NULL AS DECIMAL ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5689
SELECT + col2 + CAST ( NULL AS REAL ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT - col2 * + col2 FROM tab0 WHERE ( - col2 - col0 ) IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col0 - 60 * - 7 AS col1 FROM tab1 GROUP BY col0
----
338
392
398

query I rowsort
SELECT col0 + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL > - CASE - ( AVG ( ALL - 86 ) ) WHEN - 30 THEN - 91 END
----

query I rowsort
SELECT ALL - ( col0 ) FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 * col0 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
1260
176
5822

query I rowsort
SELECT + 57 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
57
57
57

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5696
SELECT col1 AS col0 FROM tab0 cor0 WHERE NOT col0 NOT BETWEEN CAST( NULL AS SIGNED ) / col2 + - col1 * - 76 AND ( NULL ) GROUP BY col1, col0
----

skipif mysql # not compatible
query I rowsort label-5696
SELECT col1 AS col0 FROM tab0 cor0 WHERE NOT col0 NOT BETWEEN CAST ( NULL AS INTEGER ) / col2 + - col1 * - 76 AND ( NULL ) GROUP BY col1, col0
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE NOT - col2 + ( - col1 ) IS NOT NULL GROUP BY col1 HAVING NOT 65 <= + 12
----

query I rowsort
SELECT + col0 + + ( 68 ) AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT - ( - col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING - col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 13 col0 FROM tab1 AS cor0 WHERE NOT - 35 + col0 <= - col0 GROUP BY col1, col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT DISTINCT 58 * 67 + - 76 * 48 AS col1 FROM tab0 AS cor0 WHERE NOT + col2 * - 74 IS NOT NULL GROUP BY col0 HAVING NULL BETWEEN ( NULL ) AND + col0 / 46
----

query I rowsort
SELECT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT 16 * 81 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
1296
1296
1296

query I rowsort
SELECT - AVG ( ALL - ( CASE - ( ( - col2 ) ) WHEN + col0 THEN col2 / col0 END ) ) AS col0 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5705
SELECT 3 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT CAST( col0 AS SIGNED ) BETWEEN ( - AVG ( ALL col1 ) ) AND + 39
----
-273
-276

skipif mysql # not compatible
query I rowsort label-5705
SELECT 3 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT CAST ( col0 AS INTEGER ) BETWEEN ( - AVG ( ALL col1 ) ) AND + 39
----
-273
-276

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + 65 * + 65 * col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
101400
160550
333775

query I rowsort
SELECT - 74 * col2 * ( col2 ) + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-106818
-42600
-461755

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5709
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST( 29 * + col2 AS SIGNED ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5709
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST ( 29 * + col2 AS INTEGER ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5710
SELECT ALL col1 AS col1 FROM tab2 WHERE ( + CAST( - 22 AS SIGNED ) ) IS NULL GROUP BY col0, col1 HAVING NOT + col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5710
SELECT ALL col1 AS col1 FROM tab2 WHERE ( + CAST ( - 22 AS INTEGER ) ) IS NULL GROUP BY col0, col1 HAVING NOT + col0 IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING + col2 * col2 = NULL
----

query I rowsort
SELECT DISTINCT 11 AS col0 FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NULL
----
11

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 WHERE NOT 21 IS NULL GROUP BY col0, col1 HAVING - col0 IS NOT NULL
----
41
59
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT - col1 + + 77, col1 * + - 34 AS col2 FROM tab2 GROUP BY col1 HAVING col2 BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT DISTINCT 2 AS col0 FROM tab0 GROUP BY col1
----
2

onlyif mysql # DIV for integer division: 
query I rowsort label-5716
SELECT ALL - col2 * 93 DIV + ( - + col2 ) + - col2 col0 FROM tab1 GROUP BY col2
----
22
48
85

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5716
SELECT ALL - col2 * 93 / + ( - + col2 ) + - col2 col0 FROM tab1 GROUP BY col2
----
22
48
85

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5717
SELECT + 95 * CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5717
SELECT + 95 * CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-5718
SELECT + col1 + - col1 DIV col1 + + 92 - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
173
209
213

skipif mysql # not compatible
query I rowsort label-5718
SELECT + col1 + - col1 / col1 + + 92 - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
173
209
213

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST( + 60 AS DECIMAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST ( + 60 AS REAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 * + - ( + 30 ) col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT col2 + - ( + ( - col1 ) ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT 45 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5724
SELECT CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5724
SELECT CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL
NULL

query I rowsort
SELECT DISTINCT + 11 AS col2 FROM tab2 GROUP BY col1
----
11

query I rowsort
SELECT - + 58 FROM tab2 AS cor0 GROUP BY col2
----
-58
-58
-58

query I rowsort
SELECT ALL + 91 FROM tab1 GROUP BY col1
----
91
91
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 GROUP BY col2, col1, col1 HAVING + + 61 IS NULL
----

query I rowsort
SELECT ALL 31 + ( + col0 ) AS col1 FROM tab1 GROUP BY col0
----
113
53
59

query I rowsort
SELECT - 62 AS col0 FROM tab2 GROUP BY col2
----
-62
-62
-62

query I rowsort
SELECT - 70 FROM tab0 GROUP BY col2 HAVING NOT - col2 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5732
SELECT DISTINCT + 21 FROM tab0 GROUP BY col0 HAVING NOT ( + CAST( NULL AS SIGNED ) IS NULL )
----

skipif mysql # not compatible
query I rowsort label-5732
SELECT DISTINCT + 21 FROM tab0 GROUP BY col0 HAVING NOT ( + CAST ( NULL AS INTEGER ) IS NULL )
----

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 9 IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 + col0 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
0
0
0

query I rowsort
SELECT - + col1 AS col1 FROM tab1 cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 46 col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - 93 IS NULL
----

query I rowsort
SELECT ALL + 61 FROM tab1 GROUP BY col2, col0, col2
----
61
61
61

query I rowsort
SELECT ALL + + ( + col1 ) AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 * + + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT + 93 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
93

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 + - col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
0
0
0

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col2, col2
----
-24
-38
-79

query II rowsort
SELECT ALL + + col1, - col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
44
1936
57
3249
6
36

query I rowsort
SELECT DISTINCT + ( + 95 ) AS col0 FROM tab2 GROUP BY col2
----
95

query I rowsort
SELECT + 50 AS col2 FROM tab0 GROUP BY col0
----
50
50
50

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5748
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0, 30 col2 FROM tab1 GROUP BY col2
----
NULL
30

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5748
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0, 30 col2 FROM tab1 GROUP BY col2
----
NULL
30

query I rowsort
SELECT ALL - ( + + col1 ) FROM tab1 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 47 + - + col2 col2, 17 FROM tab0 GROUP BY col2 HAVING NOT col2 >= AVG ( - 86 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5751
SELECT - col0 * + - col0 AS col2 FROM tab2 AS cor0 WHERE - col0 IN ( - col1, - col0, + col2, + - 36 * + 54 * + CAST( - col0 AS SIGNED ), - col2 + - ( - col1 ), col1 ) GROUP BY col2, col0
----
225
8281
8464

skipif mysql # not compatible
query I rowsort label-5751
SELECT - col0 * + - col0 AS col2 FROM tab2 AS cor0 WHERE - col0 IN ( - col1, - col0, + col2, + - 36 * + 54 * + CAST ( - col0 AS INTEGER ), - col2 + - ( - col1 ), col1 ) GROUP BY col2, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col1, col0
----
-81
0

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE NOT col0 NOT BETWEEN NULL AND 31 GROUP BY col2
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + NULLIF ( - ( col2 ), 24 ) <> - col2 + 77
----

query I rowsort
SELECT col2 + - + col1 + + - 78 FROM tab1 GROUP BY col2, col1
----
-51
-76
-90

query I rowsort
SELECT ALL + col1 + + col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NOT + + col1 IS NULL
----
0
162

query I rowsort
SELECT + ( + col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING + col0 <> - + col0
----
22
28
82

query I rowsort
SELECT 97 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5760
SELECT DISTINCT + 49, + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1 HAVING 66 * + - 94 IS NULL
----

skipif mysql # not compatible
query II rowsort label-5760
SELECT DISTINCT + 49, + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1 HAVING 66 * + - 94 IS NULL
----

query I rowsort
SELECT ALL - - col0 + 84 FROM tab0 AS cor0 GROUP BY col1, col0
----
110
127
167

query I rowsort
SELECT DISTINCT + col0 FROM tab2 WHERE ( NOT NULL BETWEEN NULL AND col1 * - ( - - col2 ) ) GROUP BY col0
----

query I rowsort
SELECT 42 FROM tab1 GROUP BY col1
----
42
42
42

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT 21 * + - 19 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0 HAVING NULL IS NULL
----

query II rowsort
SELECT col2, + col2 * + + col2 FROM tab2 GROUP BY col0, col2, col2
----
58
3364
79
6241
87
7569

query I rowsort
SELECT ALL + 86 AS col2 FROM tab0 cor0 GROUP BY col1
----
86
86

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 8 + + col1 * col1 col2 FROM tab0 GROUP BY col1
----
6569
8

query I rowsort
SELECT + 92 FROM tab1 GROUP BY col0
----
92
92
92

query I rowsort
SELECT DISTINCT 12 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
12

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5772
SELECT DISTINCT + + COALESCE ( col2, + 67 ) * + CAST( NULL AS DECIMAL ) FROM tab0 AS cor0 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-5772
SELECT DISTINCT + + COALESCE ( col2, + 67 ) * + CAST ( NULL AS REAL ) FROM tab0 AS cor0 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT ALL - + 2 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT 31 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN NULL AND NULL
----

query II rowsort
SELECT + col0 * - - 40 - 26, - ( 61 ) * 31 FROM tab0 GROUP BY col0, col2, col0 HAVING NOT ( NULL ) <= - + col2
----

query I rowsort
SELECT + 14 FROM tab0 AS cor0 GROUP BY col0
----
14
14
14

query I rowsort
SELECT ALL - + col1 + 36 - + col1 * - col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col1, col0 HAVING NOT NULL IN ( - col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5778
SELECT DISTINCT - col0 + + + col2 FROM tab2 GROUP BY col0, col1, col2 HAVING NOT - 6 * col0 + + - col0 + - NULLIF ( col1, - CAST( NULL AS SIGNED ) + col2 ) * + col2 IS NOT NULL AND - 25 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-5778
SELECT DISTINCT - col0 + + + col2 FROM tab2 GROUP BY col0, col1, col2 HAVING NOT - 6 * col0 + + - col0 + - NULLIF ( col1, - CAST ( NULL AS INTEGER ) + col2 ) * + col2 IS NOT NULL AND - 25 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col0 * col0 FROM tab2 GROUP BY col1, col0, col1
----
225
8281
8464

query I rowsort
SELECT DISTINCT col2 + + + col2 AS col1 FROM tab0 GROUP BY col1, col2
----
158
48
76

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT 80 * + col1 FROM tab2 cor0 GROUP BY col1
----
3280
4720
4880

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 = + 36
----

query I rowsort
SELECT DISTINCT + col2 * - + col2 + - 63 * - ( - col2 ) * - 35 + 39 * + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( - - col2 ) IS NULL
----
154283
17888
98955

query I rowsort
SELECT + col0 - + 70 FROM tab1 cor0 WHERE NOT ( NULL ) < NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL col1 + + + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
162

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5788
SELECT ALL + col0 FROM tab0 WHERE - + CAST( NULL AS DECIMAL ) * + 49 BETWEEN + col0 - - 4 - + col1 * + col0 AND col1 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-5788
SELECT ALL + col0 FROM tab0 WHERE - + CAST ( NULL AS REAL ) * + 49 BETWEEN + col0 - - 4 - + col1 * + col0 AND col1 GROUP BY col0
----

query I rowsort
SELECT ALL + - col2 * - - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST( 14 / + col0 AS SIGNED ) > NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST ( 14 / + col0 AS INTEGER ) > NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5791
SELECT - CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5791
SELECT - CAST ( NULL AS REAL ) FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

query II rowsort
SELECT AVG ( DISTINCT - col1 ), col2 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) > ( - col2 ) + col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5793
SELECT col2 * 9 * + - col2 + - 87 DIV - col2 AS col0 FROM tab1 GROUP BY col1, col2
----
-18224
-45368
-566

skipif mysql # not compatible
query I rowsort label-5793
SELECT col2 * 9 * + - col2 + - 87 / - col2 AS col0 FROM tab1 GROUP BY col1, col2
----
-18224
-45368
-566

query I rowsort
SELECT col1 * + + 15 * - 70 * - 84 FROM tab1 GROUP BY col1, col1 HAVING NOT ( + col1 ) < NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT + 52 IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE - col1 IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5797
SELECT - 76 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NOT CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-5797
SELECT - 76 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NOT CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT col2 * NULLIF ( + + col2, - ( - 61 ) * 83 ) FROM tab1 cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 64 FROM tab1 GROUP BY col2
----
64
64
64

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 WHERE + col0 * 39 / + col1 > ( - col0 ) GROUP BY col2
----
45
71
8

query I rowsort
SELECT ( - - col2 ) FROM tab0 GROUP BY col2
----
24
38
79

query II rowsort
SELECT + col0 + - - 63, col2 FROM tab1 GROUP BY col0, col2
----
145
71
85
8
91
45

query I rowsort
SELECT - ( col1 ) AS col0 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT 86 AS col2 FROM tab1 GROUP BY col0
----
86
86
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5806
SELECT + col1 * + col1 AS col1 FROM tab0 WHERE NOT 5 * - 51 IN ( + + CAST( NULL AS SIGNED ), - 20 / - col2 * + col2 ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-5806
SELECT + col1 * + col1 AS col1 FROM tab0 WHERE NOT 5 * - 51 IN ( + + CAST ( NULL AS INTEGER ), - 20 / - col2 * + col2 ) GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5807
SELECT ALL col1 * - 68 + - CAST( NULL AS SIGNED ), col1 FROM tab1 GROUP BY col1 HAVING 51 NOT IN ( + 12 )
----
NULL
44
NULL
57
NULL
6

skipif mysql # not compatible
query II rowsort label-5807
SELECT ALL col1 * - 68 + - CAST ( NULL AS INTEGER ), col1 FROM tab1 GROUP BY col1 HAVING 51 NOT IN ( + 12 )
----
NULL
44
NULL
57
NULL
6

query I rowsort
SELECT ALL 60 * + + col0 AS col0 FROM tab1 GROUP BY col0
----
1320
1680
4920

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 * + col2 + + ( - 6 ) * - ( - col1 ) / + col2 * 89 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 + + - 9 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING + + col0 IS NOT NULL
----
13
19
73

query I rowsort
SELECT DISTINCT - 37 * - col1 AS col2 FROM tab2 GROUP BY col1, col0
----
1517
2183
2257

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 GROUP BY col1, col0, col0 HAVING NOT + + 44 IS NULL
----
41
59
61

query I rowsort
SELECT 12 AS col2 FROM tab0 GROUP BY col0, col1, col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT + 11 * + - col0 * - col0 / - 97 FROM tab2 cor0 WHERE col2 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 * 84 + ( + - 68 ) col1, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - 46 AS col2 FROM tab0 cor0 GROUP BY col0
----
-46
-46
-46

query I rowsort
SELECT DISTINCT 76 + + - 83 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-7

onlyif mysql # DIV for integer division: 
query I rowsort label-5820
SELECT ALL col2 DIV + col2 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5820
SELECT ALL col2 / + col2 FROM tab0 GROUP BY col2
----
1
1
1

query II rowsort
SELECT ALL + col1, 12 + + + col1 FROM tab2 GROUP BY col1
----
41
53
59
71
61
73

query II rowsort
SELECT ALL + 90, col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1, col1
----
90
41
90
59
90
61

query I rowsort
SELECT ALL - col2 - 23 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-102
-47
-61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5824
SELECT DISTINCT - COALESCE ( + col2, col1 ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT + CAST( NULL AS SIGNED ) * - col1 * - col2 = NULL
----

skipif mysql # not compatible
query I rowsort label-5824
SELECT DISTINCT - COALESCE ( + col2, col1 ) AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT + CAST ( NULL AS INTEGER ) * - col1 * - col2 = NULL
----

query I rowsort
SELECT - 43 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + 98 FROM tab2 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT + col0 + + - 98 * - + col0 + + 81 * 57 FROM tab2 AS cor0 GROUP BY col0
----
13626
13725
6102

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING - 77 > 96 * col2
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 GROUP BY col1, col2, col2 HAVING NULL = - col2 + + col2 * + col2
----

query I rowsort
SELECT ALL 85 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT - col2 > NULL )
----

query I rowsort
SELECT - + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col2, col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 WHERE NOT + 72 + + col1 + + col2 * 70 NOT IN ( - - col2 ) GROUP BY col2
----

query I rowsort
SELECT - 67 + 28 AS col2 FROM tab0 GROUP BY col1
----
-39
-39

query I rowsort
SELECT + col2 - + - col2 FROM tab2 GROUP BY col1, col2, col2
----
116
158
174

query I rowsort
SELECT DISTINCT ( - 77 ) + + - 3 FROM tab2 AS cor0 GROUP BY col2
----
-80

query I rowsort
SELECT - 38 + 90 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
52
52

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 cor0 WHERE - col1 <= NULL GROUP BY col1
----

query I rowsort
SELECT + col0 * - - col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL + - ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT + 65 >= - - col0
----
91
92

query I rowsort
SELECT - 6 * - col1 AS col0 FROM tab0 GROUP BY col1
----
0
486

query I rowsort
SELECT DISTINCT + 98 AS col0 FROM tab1 GROUP BY col2
----
98

query I rowsort
SELECT - - col0 FROM tab1 WHERE NOT ( NOT - 22 + + - col1 + + 45 < - col2 ) OR NULL BETWEEN NULL AND - + col0 * col2 - - col0 GROUP BY col0
----

query I rowsort
SELECT 78 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
78
78
78

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col0, col1 HAVING - + col1 IS NOT NULL
----
0
81

query I rowsort
SELECT - col0 * - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 23 col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL BETWEEN - 12 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5851
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab1 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-5851
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab1 GROUP BY col2
----
NULL

query I rowsort
SELECT 86 FROM tab2 GROUP BY col0
----
86
86
86

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT ALL ( - col0 ) FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + ( + 61 ) * + col2 - col1 + - - col2 + 5 * - ( - col1 ) col1 FROM tab0 GROUP BY col1, col2
----
1812
2356
4898

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5856
SELECT ALL + ( CAST( NULL AS DECIMAL ) ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - + col2 = - 67
----

skipif mysql # not compatible
query I rowsort label-5856
SELECT ALL + ( CAST ( NULL AS REAL ) ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - + col2 = - 67
----

query I rowsort
SELECT DISTINCT + 7 AS col1 FROM tab0 GROUP BY col1, col1, col1
----
7

query I rowsort
SELECT - col1 * - 43 * + col1 AS col1 FROM tab0 GROUP BY col1
----
0
282123

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

query II rowsort
SELECT + col2 * col2 * - 62 AS col1, col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-208568
58
-386942
79
-469278
87

query I rowsort
SELECT col1 + + 63 FROM tab0 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
144
63
63

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT 3 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-26
-43
-83

query II rowsort
SELECT - 77, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 85 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) > NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - - 67 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5868
SELECT col0 / - CAST( NULL AS DECIMAL ) * 29 + - col0 + - + ( + + col0 ) FROM tab1 WHERE NULL IS NULL GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5868
SELECT col0 / - CAST ( NULL AS REAL ) * 29 + - col0 + - + ( + + col0 ) FROM tab1 WHERE NULL IS NULL GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 67 * + col2 AS col0 FROM tab0 GROUP BY col2
----
1608
2546
5293

query I rowsort
SELECT ALL - - col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( ( NOT NULL IS NOT NULL ) )
----

query I rowsort
SELECT - col1 + 9 + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-153
9

onlyif mysql # DIV for integer division: 
query I rowsort label-5872
SELECT ALL 55 DIV + - col0 col1 FROM tab2 GROUP BY col0
----
-3
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5872
SELECT ALL 55 / + - col0 col1 FROM tab2 GROUP BY col0
----
-3
0
0

query I rowsort
SELECT DISTINCT - ( 40 ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5874
SELECT DISTINCT + col2 DIV - 26 AS col0 FROM tab0 GROUP BY col2
----
-1
-3
0

skipif mysql # not compatible
query I rowsort label-5874
SELECT DISTINCT + col2 / - 26 AS col0 FROM tab0 GROUP BY col2
----
-1
-3
0

query I rowsort
SELECT ALL ( 86 ) FROM tab0 GROUP BY col2
----
86
86
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + 35 * col1 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT col0 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5878
SELECT col0 * CAST( NULL AS SIGNED ) * + - col0 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5878
SELECT col0 * CAST ( NULL AS INTEGER ) * + - col0 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + ( + col0 ) FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - 72 AS col1 FROM tab1 GROUP BY col1, col0
----
-72
-72
-72

query I rowsort
SELECT 21 + - col1 AS col0 FROM tab2 GROUP BY col1
----
-20
-38
-40

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE ( NOT ( NOT ( ( + 84 - + 42 ) IS NULL ) ) ) GROUP BY col0
----

query I rowsort
SELECT col1 * + - col2 FROM tab2 GROUP BY col1, col2
----
-2378
-4661
-5307

query I rowsort
SELECT + col0 + - col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-72
12
34

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5886
SELECT 76 + + CAST( NULL AS SIGNED ) + 83 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING - 28 IS NULL
----

skipif mysql # not compatible
query I rowsort label-5886
SELECT 76 + + CAST ( NULL AS INTEGER ) + 83 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING - 28 IS NULL
----

query II rowsort
SELECT ALL + + col2 AS col2, col2 * - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT + + col0 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL > 79
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 + - 84 * - col0 + col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING NULL IN ( col0 * + 11 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NULL ) NOT IN ( + 26 )
----

query I rowsort
SELECT - - 83 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT + 63 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL BETWEEN - + 49 AND - col1 * 36 + 83
----

query I rowsort
SELECT ALL col0 + 9 FROM tab1 AS cor0 GROUP BY col0
----
31
37
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 59 col0, - col2 AS col0 FROM tab1 GROUP BY col2
----
59
-45
59
-71
59
-8

query I rowsort
SELECT DISTINCT - ( - 74 ) / + 58 + - + col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) <> - AVG ( + 37 )
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - + 10 + - - col1 AS col2, col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-10
0
71
81

query I rowsort
SELECT DISTINCT - - ( col1 ) FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + col2 + - 22 + - ( - + 54 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
103
40
77

query I rowsort
SELECT + 42 FROM tab1 cor0 GROUP BY col0 HAVING NOT - 93 IS NULL
----
42
42
42

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5901
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT + 1 NOT IN ( + CAST( NULL AS SIGNED ) ) GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-5901
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT + 1 NOT IN ( + CAST ( NULL AS INTEGER ) ) GROUP BY col2, col0
----

query I rowsort
SELECT - 38 FROM tab2 GROUP BY col2
----
-38
-38
-38

query I rowsort
SELECT ALL col2 - - - col2 * - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
2070
5112
72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 * col2 col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
2025
5041
64

query I rowsort
SELECT + - 45 * 82 FROM tab0 AS cor0 GROUP BY col0
----
-3690
-3690
-3690

query I rowsort
SELECT 23 AS col1 FROM tab1 GROUP BY col0
----
23
23
23

query I rowsort
SELECT DISTINCT 41 + col0 FROM tab1 GROUP BY col1, col0
----
123
63
69

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5908
SELECT - NULLIF ( - CAST( ( + 72 ) AS SIGNED ), 76 ) FROM tab0 GROUP BY col0
----
72
72
72

skipif mysql # not compatible
query I rowsort label-5908
SELECT - NULLIF ( - CAST ( ( + 72 ) AS INTEGER ), 76 ) FROM tab0 GROUP BY col0
----
72
72
72

onlyif mysql # DIV for integer division: 
query I rowsort label-5909
SELECT DISTINCT + 37 + - 72 * + ( - 84 DIV + col0 ) FROM tab2 GROUP BY col0, col1, col0
----
37
397

skipif mysql # not compatible
query I rowsort label-5909
SELECT DISTINCT + 37 + - 72 * + ( - 84 / + col0 ) FROM tab2 GROUP BY col0, col1, col0
----
37
397

query I rowsort
SELECT DISTINCT - 91 FROM tab0 WHERE - col0 + 9 IS NOT NULL GROUP BY col2, col0
----
-91

query I rowsort
SELECT ( - col2 ) * + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT - col2 BETWEEN ( + col2 + col2 ) AND NULL
----
-3364
-6241
-7569

query I rowsort
SELECT 4 * ( col0 ) FROM tab2 GROUP BY col0 HAVING col0 <= ( NULL )
----

query I rowsort
SELECT col0 * col0 FROM tab0 WHERE NOT 57 - + 17 <> NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING + 54 IS NOT NULL
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 5 col1 FROM tab0 GROUP BY col0, col0
----
5
5
5

query I rowsort
SELECT DISTINCT 17 FROM tab1 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT ALL 50 FROM tab2 WHERE NOT ( - COALESCE ( + col1, col0 ) ) IN ( col2 ) GROUP BY col2, col2
----
50
50
50

query I rowsort
SELECT col2 * 54 AS col0 FROM tab1 WHERE col1 * CASE WHEN NOT col2 * + 25 < + col1 + + col2 THEN NULL ELSE 43 * + col2 + + 44 END IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - 23 FROM tab0 AS cor0 GROUP BY col2
----
23
23
23

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5921
SELECT ALL - ( 20 ) + - 96 * ( CAST( col2 AS SIGNED ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-4340
-6836
-788

skipif mysql # not compatible
query I rowsort label-5921
SELECT ALL - ( 20 ) + - 96 * ( CAST ( col2 AS INTEGER ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-4340
-6836
-788

query I rowsort
SELECT + col0 * 79 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1738
2212
6478

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL >= ( col2 + - 30 * col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5924
SELECT DISTINCT col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) / - col1 + + col1 <> NULL
----

skipif mysql # not compatible
query I rowsort label-5924
SELECT DISTINCT col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST ( NULL AS INTEGER ) / - col1 + + col1 <> NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NOT col2 NOT IN ( + ( + col1 ) ) GROUP BY col1 HAVING NULL > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5926
SELECT DISTINCT + - ( CAST( NULL AS SIGNED ) ) + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <> ( NULL )
----

skipif mysql # not compatible
query I rowsort label-5926
SELECT DISTINCT + - ( CAST ( NULL AS INTEGER ) ) + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <> ( NULL )
----

query I rowsort
SELECT ALL - ( - col1 ) FROM tab0 cor0 GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5928
SELECT 90 * - - col1 + - - 17 * + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5928
SELECT 90 * - - col1 + - - 17 * + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1
----
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab1 GROUP BY col0, col0, col0 HAVING ( ( NULL ) IS NOT NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5930
SELECT ALL + ( - col0 ) * - ( + + col0 ) + - 66 DIV col0 AS col0 FROM tab1 GROUP BY col0
----
481
6724
782

skipif mysql # not compatible
query I rowsort label-5930
SELECT ALL + ( - col0 ) * - ( + + col0 ) + - 66 / col0 AS col0 FROM tab1 GROUP BY col0
----
481
6724
782

query I rowsort
SELECT DISTINCT - - col2 * col2 + + col2 + col2 * 81 FROM tab1 AS cor0 GROUP BY col2 HAVING - 16 IS NOT NULL
----
10863
5715
720

query I rowsort
SELECT - ( - col1 ) * col1 FROM tab1 AS cor0 WHERE NOT - 95 IS NOT NULL GROUP BY col1 HAVING NOT 84 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5933
SELECT DISTINCT col1 * 69 FROM tab2 AS cor0 WHERE NOT col2 IS NULL GROUP BY col2, col2, col1 HAVING NULLIF ( col1, + 37 * col1 + + 30 * CAST( NULL AS SIGNED ) ) <> + 17
----
2829
4071
4209

skipif mysql # not compatible
query I rowsort label-5933
SELECT DISTINCT col1 * 69 FROM tab2 AS cor0 WHERE NOT col2 IS NULL GROUP BY col2, col2, col1 HAVING NULLIF ( col1, + 37 * col1 + + 30 * CAST ( NULL AS INTEGER ) ) <> + 17
----
2829
4071
4209

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT ( col0 ) BETWEEN col1 / + col2 AND col0 * - col2 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col0 - + col0 FROM tab0 cor0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT 28 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL <= col1
----

query I rowsort
SELECT ALL + col1 + - col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + NULLIF ( - 15, + + 76 * 64 ) + - - 10 AS col0, col0 col0 FROM tab2 GROUP BY col0, col2 HAVING NOT 85 * + col2 IS NOT NULL
----

query I rowsort
SELECT ALL ( + col0 ) * + col0 AS col2 FROM tab0 GROUP BY col1, col0
----
1849
676
6889

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 WHERE NOT col0 * + col0 IS NULL GROUP BY col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5941
SELECT CAST( 94 AS SIGNED ) AS col2, + 45 AS col2 FROM tab0 GROUP BY col1
----
94
45
94
45

skipif mysql # not compatible
query II rowsort label-5941
SELECT CAST ( 94 AS INTEGER ) AS col2, + 45 AS col2 FROM tab0 GROUP BY col1
----
94
45
94
45

query I rowsort
SELECT + - 92 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= - - 53
----

query I rowsort
SELECT DISTINCT 80 + 70 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
208
229
237

query I rowsort
SELECT 6 * 88 AS col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT + - ( + col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <> - 24
----

query II rowsort
SELECT + - 5, - col2 AS col2 FROM tab2 AS cor0 WHERE NOT + col2 * - + ( + col2 ) IS NULL GROUP BY col2, col2 HAVING 61 IS NOT NULL
----
-5
-58
-5
-79
-5
-87

query I rowsort
SELECT DISTINCT 57 FROM tab1 AS cor0 GROUP BY col2, col0
----
57

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 56 + + col0 + col2 + - + col0 col2 FROM tab2 GROUP BY col0, col2
----
114
135
143

query I rowsort
SELECT DISTINCT - col0 FROM tab2 WHERE ( - - col1 ) IS NULL GROUP BY col0 HAVING + 7 IS NULL
----

query I rowsort
SELECT ALL + 98 - - 31 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT + col0 = NULL
----

query I rowsort
SELECT ALL 63 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT + ( + col1 ) AS col2 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT 41 * - + 23 FROM tab0 GROUP BY col1, col2
----
-943
-943
-943

query I rowsort
SELECT 90 * col1 AS col1 FROM tab2 GROUP BY col1, col1
----
3690
5310
5490

query I rowsort
SELECT + + 82 FROM tab2 AS cor0 GROUP BY col0
----
82
82
82

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING - col2 IS NULL
----

query I rowsort
SELECT ALL - - col2 / 83 AS col2 FROM tab2 WHERE NOT - col2 * + - 59 + + - COALESCE ( col0, - 38 ) * - col1 * + col0 + + 56 * col2 * NULLIF ( col1, + 99 ) + - col1 + + 62 * - 16 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT 83 FROM tab1 AS cor0 GROUP BY col1, col0
----
83
83
83

onlyif mysql # DIV for integer division: 
query I rowsort label-5959
SELECT ALL + 78 DIV - 82 * - col0 FROM tab1 GROUP BY col1, col0 HAVING NOT 47 <= - 90
----
0
0
0

skipif mysql # not compatible
query I rowsort label-5959
SELECT ALL + 78 / - 82 * - col0 FROM tab1 GROUP BY col1, col0 HAVING NOT 47 <= - 90
----
0
0
0

query I rowsort
SELECT DISTINCT - ( + + col2 ) AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
-79
-87

query II rowsort
SELECT + 3 AS col2, col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
3
44
3
57
3
6

onlyif mysql # DIV for integer division: 
query I rowsort label-5962
SELECT + 8 DIV + - 13 FROM tab1 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-5962
SELECT + 8 / + - 13 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - + 78 FROM tab2 cor0 GROUP BY col0, col1
----
-78
-78
-78

query I rowsort
SELECT 24 + + + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
30
68
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5965
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5965
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT 54 + + + 85 FROM tab0 GROUP BY col1, col1
----
139
139

query II rowsort
SELECT DISTINCT + + 64 AS col1, 27 * + + col2 + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
64
1064
64
2212
64
672

query I rowsort
SELECT ALL col2 * + col2 * + 49 FROM tab0 AS cor0 GROUP BY col2
----
28224
305809
70756

query II rowsort
SELECT col2 AS col1, + 43 + - - col2 FROM tab2 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT col0 - 61 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - ( col0 ) - - - 22 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-105
-48
-65

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5972
SELECT DISTINCT col0 + + CAST( NULL AS DECIMAL ) / - 96 col0 FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5972
SELECT DISTINCT col0 + + CAST ( NULL AS REAL ) / - 96 col0 FROM tab0 GROUP BY col0
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5973
SELECT DISTINCT - - col0 - ( - 98 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING CAST( NULL AS SIGNED ) + 90 IS NULL
----
120
126
180

skipif mysql # not compatible
query I rowsort label-5973
SELECT DISTINCT - - col0 - ( - 98 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING CAST ( NULL AS INTEGER ) + 90 IS NULL
----
120
126
180

query II rowsort
SELECT DISTINCT col0, + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 GROUP BY col0 HAVING NULL > col1
----

query I rowsort
SELECT - col2 + col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) >= 32
----

query I rowsort
SELECT ALL 80 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL > NULL
----

query II rowsort
SELECT ALL - 58, col1 FROM tab2 GROUP BY col1
----
-58
41
-58
59
-58
61

query I rowsort
SELECT ALL ( col2 ) AS col2 FROM tab1 GROUP BY col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5980
SELECT - CAST( - - col0 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-5980
SELECT - CAST ( - - col0 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-5982
SELECT 9 DIV col0 + - - col0 FROM tab1 GROUP BY col0 HAVING NOT - 91 IS NULL
----
22
28
82

skipif mysql # not compatible
query I rowsort label-5982
SELECT 9 / col0 + - - col0 FROM tab1 GROUP BY col0 HAVING NOT - 91 IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col2 * + col0 + - col0 + - 60 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
1172
5680
94

onlyif mysql # DIV for integer division: 
query I rowsort label-5984
SELECT col2 * - 26 * - - col2 + + 67 * 97 DIV + 36 AS col1 FROM tab1 GROUP BY col2, col2
----
-130886
-1484
-52470

skipif mysql # not compatible
query I rowsort label-5984
SELECT col2 * - 26 * - - col2 + + 67 * 97 / + 36 AS col1 FROM tab1 GROUP BY col2, col2
----
-130886
-1484
-52470

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT + 65 + col1 FROM tab2 GROUP BY col0, col0, col1
----
106
124
126

query I rowsort
SELECT + col2 * + + col2 * + col2 FROM tab2 GROUP BY col0, col2, col0
----
195112
493039
658503

query II rowsort
SELECT DISTINCT - 32 AS col0, col0 FROM tab0 GROUP BY col0 HAVING NOT - 25 IS NOT NULL
----

query II rowsort
SELECT col0 + - + col0 * + - col0 AS col0, - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
240
0
8372
0
8556
0

query I rowsort
SELECT DISTINCT 39 AS col0 FROM tab0 GROUP BY col2, col1
----
39

query I rowsort
SELECT - col0 + - ( col0 ) + col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5992
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab1 GROUP BY col0, col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5992
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 GROUP BY col0, col1, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - + col0 * + 78 FROM tab1 AS cor0 GROUP BY col0
----
-1716
-2184
-6396

query I rowsort
SELECT col2 * col1 * - col2 * - + 63 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
2939328

query I rowsort
SELECT DISTINCT - 4 FROM tab0 AS cor0 GROUP BY col1
----
-4

query I rowsort
SELECT + - 72 FROM tab0 AS cor0 GROUP BY col2, col1
----
-72
-72
-72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 58 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
58

query I rowsort
SELECT - col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING - AVG ( 1 ) BETWEEN 91 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5999
SELECT ALL 75 * 95 + + col2 * 17 * + CAST( NULL AS SIGNED ) / 73 AS col0 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-5999
SELECT ALL 75 * 95 + + col2 * 17 * + CAST ( NULL AS INTEGER ) / 73 AS col0 FROM tab0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 62 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-29
-30
47

query II rowsort
SELECT ALL 59 AS col1, col2 AS col1 FROM tab2 AS cor0 WHERE ( NULL ) = - col2 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6002
SELECT - AVG ( DISTINCT + - 5 ) AS col0 FROM tab0 GROUP BY col2 HAVING - col2 <= CAST( + - CAST( CAST( NULL AS SIGNED ) AS SIGNED ) AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-6002
SELECT - AVG ( DISTINCT + - 5 ) AS col0 FROM tab0 GROUP BY col2 HAVING - col2 <= CAST ( + - CAST ( CAST ( NULL AS INTEGER ) AS INTEGER ) AS INTEGER )
----

query II rowsort
SELECT ALL col2 AS col0, - col2 AS col0 FROM tab2 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT - col2 IS NULL GROUP BY col0, col2
----
24
38
79

query II rowsort
SELECT + col0 AS col2, - col0 FROM tab2 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT - 36 * + - col0 + - - 12 FROM tab1 GROUP BY col0 HAVING NOT + - 30 IS NOT NULL
----

query I rowsort
SELECT + ( 49 ) * 66 AS col0 FROM tab1 cor0 GROUP BY col2
----
3234
3234
3234

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6008
SELECT COALESCE ( 9, CAST( NULL AS SIGNED ) ) * + + col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
405
639
72

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6008
SELECT COALESCE ( 9, CAST ( NULL AS INTEGER ) ) * + + col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
405
639
72

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING 68 IS NULL
----

query I rowsort
SELECT ALL + ( col0 ) FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING - col0 < NULL
----

query I rowsort
SELECT - - 12 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING 66 IS NULL
----

query I rowsort
SELECT ALL + col0 + - 93 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1
-2
-78

query I rowsort
SELECT col2 * - 38 FROM tab1 AS cor0 GROUP BY col2
----
-1710
-2698
-304

query I rowsort
SELECT DISTINCT 14 FROM tab0 GROUP BY col0, col0 HAVING col0 >= - col0 * 71
----
14

query I rowsort
SELECT DISTINCT - col0 * 81 * + 43 AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( + col0 ) IS NULL
----
-316953
-320436
-52245

query I rowsort
SELECT - 53 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-53
-53
-53

query I rowsort
SELECT DISTINCT col0 - + col0 AS col2 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT ALL + 87 FROM tab2 AS cor0 GROUP BY col0
----
87
87
87

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2
----
-58
-79
-87

onlyif mysql # DIV for integer division: 
query I rowsort label-6021
SELECT DISTINCT + col2 DIV col2 FROM tab1 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-6021
SELECT DISTINCT + col2 / col2 FROM tab1 AS cor0 GROUP BY col2
----
1

query I rowsort
SELECT DISTINCT col2 / + 41 FROM tab0 AS cor0 GROUP BY col2 HAVING + col2 BETWEEN col2 AND ( NULL )
----

query I rowsort
SELECT col1 + col1 FROM tab0 WHERE + col1 IS NOT NULL GROUP BY col1
----
0
162

query II rowsort
SELECT DISTINCT - col1, + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT DISTINCT - + 19 FROM tab1 AS cor0 GROUP BY col1, col1
----
-19

query I rowsort
SELECT DISTINCT col0 + - - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT - 77 + 43 = col0
----
164
44
56

query I rowsort
SELECT - 99 FROM tab2 cor0 GROUP BY col2
----
-99
-99
-99

query I rowsort
SELECT ALL - + col0 * - + col0 * + 89 + - 43 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
164561
60147
613161

query I rowsort
SELECT ALL 39 FROM tab1 GROUP BY col2
----
39
39
39

query I rowsort
SELECT DISTINCT ( + col1 ) * + 25 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NULL BETWEEN - col2 AND ( NULL )
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + 41 FROM tab0 AS cor0 GROUP BY col2
----
41

query I rowsort
SELECT ( - col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT 13 + + 86 + 80 FROM tab1 cor0 GROUP BY col2
----
179
179
179

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 23 * + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
1334
1817
2001

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 AS col1, + col1 col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT 37 AS col2 FROM tab0 GROUP BY col0 HAVING - - 17 + - 26 IS NOT NULL
----
37

query I rowsort
SELECT 19 AS col2 FROM tab0 GROUP BY col2, col1, col0
----
19
19
19

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6040
SELECT - 95 FROM tab2 GROUP BY col0, col1, col0 HAVING NOT + CAST( NULL AS DECIMAL ) IN ( 39 )
----

skipif mysql # not compatible
query I rowsort label-6040
SELECT - 95 FROM tab2 GROUP BY col0, col1, col0 HAVING NOT + CAST ( NULL AS REAL ) IN ( 39 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6041
SELECT + CAST( NULL AS SIGNED ) AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( + CAST( NULL AS SIGNED ) ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6041
SELECT + CAST ( NULL AS INTEGER ) AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( + CAST ( NULL AS INTEGER ) ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6042
SELECT 89 DIV col2 + 89 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
100
90
90

skipif mysql # not compatible
query I rowsort label-6042
SELECT 89 / col2 + 89 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
100
90
90

query I rowsort
SELECT + 52 * CASE - col0 WHEN col0 - + 82 THEN - 30 / - col0 ELSE NULL END FROM tab0 GROUP BY col0, col1, col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 52 * + col2 + col2 col1 FROM tab2 GROUP BY col2
----
-2958
-4029
-4437

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL NULLIF ( col2, col2 ) col0 FROM tab2 GROUP BY col1, col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 7 - col0 AS col0 FROM tab2 GROUP BY col0, col2
----
-8
-84
-85

query I rowsort
SELECT 97 * + 79 AS col1 FROM tab2 WHERE NOT ( - 29 ) / - col1 - - col1 * col1 NOT BETWEEN 31 * col1 AND NULL GROUP BY col0 HAVING ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + ( - col0 ) / col0 FROM tab2 WHERE NOT NULL IN ( col1 ) GROUP BY col2, col0
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT ( col1 ) + col1 FROM tab1 GROUP BY col0, col1
----
114
12
88

query I rowsort
SELECT - col0 + - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-12
-34
72

query I rowsort
SELECT ALL NULLIF ( - - 2, - - col2 ) AS col0 FROM tab0 GROUP BY col0, col2
----
2
2
2

query I rowsort
SELECT 85 FROM tab0 AS cor0 GROUP BY col0, col1
----
85
85
85

query I rowsort
SELECT ALL col1 * + col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT + NULLIF ( + + 24, AVG ( DISTINCT + + 70 ) ) FROM tab0 GROUP BY col1
----
24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6057
SELECT DISTINCT + 67 * - col2 FROM tab0 AS cor0 WHERE NOT col0 <= + + CAST( NULL AS SIGNED ) GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-6057
SELECT DISTINCT + 67 * - col2 FROM tab0 AS cor0 WHERE NOT col0 <= + + CAST ( NULL AS INTEGER ) GROUP BY col0, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6058
SELECT - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6058
SELECT - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 48 FROM tab1 GROUP BY col2
----
48
48
48

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ( col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL <> + 14 / - col2 * 34 + 1 + - col1 / col1 * col2
----

query I rowsort
SELECT ALL 86 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
86
86
86

query I rowsort
SELECT 70 * + - 57 * col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-111720
-327180
-87780

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6063
SELECT ALL + + CAST( + - col2 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - - CAST( - - col1 AS SIGNED ) IS NULL
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-6063
SELECT ALL + + CAST ( + - col2 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - - CAST ( - - col1 AS INTEGER ) IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + 35 * - - 50 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
1750
1750
1750

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT + col0 <> - 69
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 57 col1 FROM tab2 cor0 GROUP BY col2, col0
----
-57

query I rowsort
SELECT col1 + + + 7 FROM tab2 GROUP BY col1, col0, col0
----
48
66
68

query I rowsort
SELECT ALL + col1 * - ( + col1 ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - - ( - - ( - - col1 ) ) IS NOT NULL
----
-6561
0
0

query I rowsort
SELECT ALL + 66 FROM tab0 GROUP BY col2
----
66
66
66

query I rowsort
SELECT ALL + 18 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
18
18
18

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6071
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 WHERE NULL = - col1 * + col1 GROUP BY col2, col0 HAVING NULL = - - col2
----

skipif mysql # not compatible
query I rowsort label-6071
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 WHERE NULL = - col1 * + col1 GROUP BY col2, col0 HAVING NULL = - - col2
----

query I rowsort
SELECT + 7 * col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
406
553
609

query I rowsort
SELECT - ( - col2 ) * col2 - + col2 + col2 AS col0 FROM tab0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1, - col1 col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 + - + 14 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-55
-73
-75

query I rowsort
SELECT + 47 FROM tab1 GROUP BY col2, col2
----
47
47
47

query II rowsort
SELECT - - 74 AS col1, + col2 * + + 82 FROM tab1 AS cor0 GROUP BY col0, col2
----
74
3690
74
5822
74
656

query I rowsort
SELECT ALL + 24 + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
106
46
52

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( - 89 ) col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-89

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 81 col0, 5 col0 FROM tab2 AS cor0 GROUP BY col2
----
81
5
81
5
81
5

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6083
SELECT DISTINCT + 27 * + CAST( NULL AS SIGNED ) col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6083
SELECT DISTINCT + 27 * + CAST ( NULL AS INTEGER ) col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
-24
-38
-79

query I rowsort
SELECT + 86 FROM tab1 GROUP BY col1, col2
----
86
86
86

query I rowsort
SELECT 72 AS col2 FROM tab1 GROUP BY col0, col2
----
72
72
72

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 71 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND - col1 / + col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6089
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6089
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( 47, col2 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
47
47
47

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING + + 61 > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6092
SELECT ALL - col2 + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6092
SELECT ALL - col2 + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 74 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
74

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2 HAVING NULL = + 14 + + col0
----

query II rowsort
SELECT 49 AS col0, col2 * + col2 AS col0 FROM tab0 GROUP BY col2
----
49
1444
49
576
49
6241

query I rowsort
SELECT col2 + - + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 + col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT 24 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + 0 + - 57 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6101
SELECT DISTINCT 74 + - - 84 DIV col1 FROM tab2 AS cor0 GROUP BY col1
----
75
76

skipif mysql # not compatible
query I rowsort label-6101
SELECT DISTINCT 74 + - - 84 / col1 FROM tab2 AS cor0 GROUP BY col1
----
75
76

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 WHERE NOT - 0 * - col2 NOT BETWEEN NULL AND col2 GROUP BY col0
----

query I rowsort
SELECT + - col0 FROM tab1 cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + + 10 * + - col1 - + ( - ( + col1 ) ) FROM tab2 AS cor0 GROUP BY col0, col1
----
-369
-531
-549

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6105
SELECT ALL + - CAST( NULL AS SIGNED ) AS col0 FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6105
SELECT ALL + - CAST ( NULL AS INTEGER ) AS col0 FROM tab0 cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + col1 + + + 79 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 68 + 12 col1 FROM tab0 GROUP BY col1, col0
----
80

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT - + 74 FROM tab2 AS cor0 GROUP BY col2, col2
----
-74
-74
-74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 83 col1 FROM tab2 cor0 GROUP BY col2
----
83
83
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6111
SELECT DISTINCT - CAST( NULL AS SIGNED ) + - col0 FROM tab2 AS cor0 WHERE NOT NULL <> col0 + 5 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-6111
SELECT DISTINCT - CAST ( NULL AS INTEGER ) + - col0 FROM tab2 AS cor0 WHERE NOT NULL <> col0 + 5 GROUP BY col0
----

query I rowsort
SELECT ALL 49 FROM tab1 GROUP BY col2
----
49
49
49

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + col0 <> + - col0 - + + col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - ( - 68 ) col2, col2 * - 47 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 WHERE NULL BETWEEN + + col2 AND NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6116
SELECT - + 76 DIV col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-9

skipif mysql # not compatible
query I rowsort label-6116
SELECT - + 76 / col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col1 col0, + col1 * col1 FROM tab0 WHERE - + 42 NOT BETWEEN + ( + + col0 ) AND + col0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
6561
0
0

query I rowsort
SELECT DISTINCT 57 FROM tab1 WHERE col2 * - + 18 IS NOT NULL GROUP BY col0
----
57

query I rowsort
SELECT col0 * - + ( ( - + 10 ) ) * + col0 * col0 * + 92 FROM tab1 GROUP BY col0, col2
----
20195840
507258560
9796160

query I rowsort
SELECT ALL 71 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT NULL >= + col0
----

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 AS cor0 WHERE + col1 IS NULL GROUP BY col1, col0, col0
----

query I rowsort
SELECT + 93 * - + 83 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-7638
-7719

query I rowsort
SELECT + ( + 18 ) AS col2 FROM tab0 GROUP BY col1, col1
----
18
18

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + + 53 col2 FROM tab2 GROUP BY col0, col1 HAVING NULL IN ( ( + 32 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6125
SELECT DISTINCT + 70 AS col0, CAST( NULL AS SIGNED ) + - col1 - ( col1 ) FROM tab0 GROUP BY col1, col1 HAVING ( NULL ) <= 82
----

skipif mysql # not compatible
query II rowsort label-6125
SELECT DISTINCT + 70 AS col0, CAST ( NULL AS INTEGER ) + - col1 - ( col1 ) FROM tab0 GROUP BY col1, col1 HAVING ( NULL ) <= 82
----

query I rowsort
SELECT ALL - 73 * + col1 / - + 10 FROM tab2 GROUP BY col1 HAVING ( + 93 ) < NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 * + 61 * ( + 10 ) FROM tab0 AS cor0 GROUP BY col1
----
0
49410

query I rowsort
SELECT 69 + 98 / - - col0 FROM tab1 cor0 GROUP BY col0, col1, col1 HAVING NOT NULL <= ( ( - 58 ) * ( - col1 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6130
SELECT ( + col0 ) / col0 * - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN CAST( NULL AS SIGNED ) AND col0
----

skipif mysql # not compatible
query I rowsort label-6130
SELECT ( + col0 ) / col0 * - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN CAST ( NULL AS INTEGER ) AND col0
----

query I rowsort
SELECT + 10 - - col0 AS col0 FROM tab2 AS cor0 WHERE - CASE + col0 WHEN + col1 THEN - col2 ELSE 36 END IN ( NULLIF ( col1, col1 * - col1 + 42 ) ) GROUP BY col0, col1 HAVING NOT - col1 * 3 IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - 8 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT 56 * - col2 FROM tab1 GROUP BY col2
----
-2520
-3976
-448

query I rowsort
SELECT DISTINCT 33 - - - 57 FROM tab2 GROUP BY col1, col1
----
-24

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 / - col1 * + col1 col0 FROM tab0 WHERE - ( - col1 ) >= NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 + ( - col2 ) FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL 51 FROM tab2 GROUP BY col0, col2
----
51
51
51

query I rowsort
SELECT col0 + - ( + - col0 ) - - - ( + 4 ) * + ( 83 ) + + 25 * + col0 FROM tab1 GROUP BY col1, col0 HAVING ( NULL ) <> + 38 + + 32 * + 69
----

query I rowsort
SELECT 46 + + - col1 AS col1 FROM tab2 AS cor0 WHERE NOT + 85 - col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT 94 * 93 FROM tab1 GROUP BY col0 HAVING NULL <> NULL
----

query II rowsort
SELECT col0 + - col0 AS col2, - col0 FROM tab1 GROUP BY col0
----
0
-22
0
-28
0
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6143
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6143
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT + 20 FROM tab1 AS cor0 WHERE NOT - col0 * + col0 * - - col0 IS NULL GROUP BY col1 HAVING NULL IS NULL
----
20
20
20

query I rowsort
SELECT ( ( - col1 ) ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - 3 * + col1 + - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT - 86 AS col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN - 11 + 20 AND - + col2 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query II rowsort
SELECT ALL 57 AS col1, 77 + - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
57
-5
57
49
57
55

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6150
SELECT CAST( NULL AS DECIMAL ) FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6150
SELECT CAST ( NULL AS REAL ) FROM tab1 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + 60 + + col0 FROM tab0 cor0 GROUP BY col0
----
103
143
86

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE 87 IS NOT NULL GROUP BY col1 HAVING + - col1 NOT BETWEEN - - col1 AND - 36
----
-81
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT NULLIF ( - + col2, - col2 - - 64 ) FROM tab1 GROUP BY col0, col2 HAVING + col2 = ( + - col2 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6155
SELECT DISTINCT col0 DIV + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-1

skipif mysql # not compatible
query I rowsort label-6155
SELECT DISTINCT col0 / + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-1

query I rowsort
SELECT col1 + + + 2 AS col0 FROM tab0 AS cor0 WHERE + col1 IS NOT NULL GROUP BY col1
----
2
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 16 + - - 23 + + ( + ( + 60 ) ) * + + col0 * - col0 col2 FROM tab2 GROUP BY col0
----
-13461
-496821
-507801

query I rowsort
SELECT + 73 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1606
-2044
-5986

query I rowsort
SELECT DISTINCT + col2 + - 53 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
26
34
5

query II rowsort
SELECT - 91, col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT ( - col0 ) FROM tab1 AS cor0 WHERE NULL < col0 GROUP BY col2, col0
----

query I rowsort
SELECT ALL ( col1 ) * - 10 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
-440
-570
-60

query I rowsort
SELECT DISTINCT - 54 AS col1 FROM tab2 GROUP BY col1, col1, col1, col1
----
-54

query I rowsort
SELECT DISTINCT + col1 + col1 AS col2 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT ALL col0 * + - 57 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN col2 AND NULL GROUP BY col0
----

query II rowsort
SELECT col2, col2 * col2 * + + col2 AS col2 FROM tab1 GROUP BY col2
----
45
91125
71
357911
8
512

query I rowsort
SELECT + 2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 < 4
----
2
2
2

query I rowsort
SELECT ALL - - col1 * - + 86 FROM tab2 AS cor0 GROUP BY col1
----
-3526
-5074
-5246

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT 2 FROM tab2 AS cor0 GROUP BY col2, col1
----
2
2
2

query I rowsort
SELECT ALL col0 + - col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + 3 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT ( + col1 ) FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT 65 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
65
65
65

query I rowsort
SELECT DISTINCT 41 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + 15 AS col1 FROM tab2 GROUP BY col1, col2, col0
----
15

query I rowsort
SELECT 39 * - col2 - 16 FROM tab0 GROUP BY col1, col2
----
-1498
-3097
-952

query I rowsort
SELECT - 28 * - col1 * - 42 AS col0 FROM tab2 GROUP BY col1, col0
----
-48216
-69384
-71736

query I rowsort
SELECT ALL + col1 * + col1 * + col1 + - - col1 + - 44 * + col1 + - - col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-6
185991
85228

query I rowsort
SELECT - ( + 98 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < col1
----

query I rowsort
SELECT DISTINCT - 14 + + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
1
77
78

query II rowsort
SELECT - - 9 * + - 82, 98 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 + 45 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL > + col1
----

query II rowsort
SELECT ALL + col0, col0 FROM tab2 GROUP BY col0 HAVING 46 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6187
SELECT DISTINCT + col0 * col0 + + + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-6187
SELECT DISTINCT + col0 * col0 + + + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT ( + 16 ) FROM tab0 GROUP BY col1
----
16

query I rowsort
SELECT - 54 FROM tab1 AS cor0 GROUP BY col0
----
-54
-54
-54

query I rowsort
SELECT ALL 30 * + - col0 + + - col0 AS col2 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT COALESCE ( + + ( - col0 ), + 5 * - 98 * - ( + col1 ) ) IS NULL
----
-1333
-2573
-806

query I rowsort
SELECT DISTINCT - col1 + - + col1 AS col1 FROM tab1 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT col1 * + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + 3 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6193
SELECT - 75 + col2 + 6 DIV - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-37
-51
4

skipif mysql # not compatible
query I rowsort label-6193
SELECT - 75 + col2 + 6 / - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-37
-51
4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6194
SELECT + - CAST( NULL AS SIGNED ) + - + col0 FROM tab1 AS cor0 WHERE + col1 + + + 58 * - - ( + col1 ) <> + - COALESCE ( - col2, - col0 * - col0 * + col2 ) GROUP BY col0 HAVING NULL >= - + col0
----

skipif mysql # not compatible
query I rowsort label-6194
SELECT + - CAST ( NULL AS INTEGER ) + - + col0 FROM tab1 AS cor0 WHERE + col1 + + + 58 * - - ( + col1 ) <> + - COALESCE ( - col2, - col0 * - col0 * + col2 ) GROUP BY col0 HAVING NULL >= - + col0
----

query I rowsort
SELECT ALL - ( col0 ) FROM tab1 GROUP BY col0 HAVING + ( col0 ) BETWEEN + - col0 + - - ( - 28 ) AND NULL
----

query I rowsort
SELECT + + col2 - + - col2 FROM tab2 cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT - + col0 * + 13 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 + - 62 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-4
17
25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6199
SELECT 57 + CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6199
SELECT 57 + CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT col0 - - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query II rowsort
SELECT ALL - col0 AS col0, col0 AS col2 FROM tab1 GROUP BY col0
----
-22
22
-28
28
-82
82

onlyif mysql # DIV for integer division: 
query I rowsort label-6202
SELECT DISTINCT - + ( - col2 ) DIV - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-6202
SELECT DISTINCT - + ( - col2 ) / - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL <> + NULLIF ( - col0, 49 ) + - 92
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query II rowsort
SELECT DISTINCT - ( 35 ) - - col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-29
6
22
57
9
44

query I rowsort
SELECT - col0 * + - col0 + - - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
506
6806
812

query I rowsort
SELECT ALL 47 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN - col0 AND ( + 19 )
----

query I rowsort
SELECT ALL - 92 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 82 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query II rowsort
SELECT + col0, 49 + + col0 AS col0 FROM tab1 WHERE NULL NOT BETWEEN NULL AND + col1 * + 30 GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6212
SELECT col0 * col0 DIV + col0 FROM tab2 GROUP BY col0 HAVING ( ( + 13 ) - - col0 ) <> + 39 - - col0 + - 79 * - 78
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6212
SELECT col0 * col0 / + col0 FROM tab2 GROUP BY col0 HAVING ( ( + 13 ) - - col0 ) <> + 39 - - col0 + - 79 * - 78
----
15
91
92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - + col1 * 63 + + 89 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NULL >= - + col0 / + col1
----

query I rowsort
SELECT col1 - + col1 * - - ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
-1892
-30
-3192

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT + + col0 IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 94 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
94
94
94

query I rowsort
SELECT DISTINCT - 82 FROM tab1 AS cor0 GROUP BY col0, col2
----
-82

query I rowsort
SELECT + ( + - 8 ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-8
-8
-8

query I rowsort
SELECT DISTINCT + col1 * - col0 AS col0 FROM tab1 WHERE NOT NULL < + - ( - col0 ) + col1 GROUP BY col0, col1
----

query I rowsort
SELECT + col2 / + + ( - col2 ) - + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6222
SELECT ALL 83 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0, col2, col0 HAVING NOT - col0 BETWEEN + + 36 / + + 98 + + CAST( col0 AS SIGNED ) AND + + 58
----
83
83
83

skipif mysql # not compatible
query I rowsort label-6222
SELECT ALL 83 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0, col2, col0 HAVING NOT - col0 BETWEEN + + 36 / + + 98 + + CAST ( col0 AS INTEGER ) AND + + 58
----
83
83
83

query I rowsort
SELECT + + 43 - + - col1 FROM tab0 AS cor0 WHERE NOT 21 IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6224
SELECT ALL col2 / - + 9 + - CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 WHERE NOT col2 NOT BETWEEN NULLIF ( col2, - - col0 ) AND NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6224
SELECT ALL col2 / - + 9 + - CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 WHERE NOT col2 NOT BETWEEN NULLIF ( col2, - - col0 ) AND NULL GROUP BY col2
----

query I rowsort
SELECT ALL - 33 * col1 AS col1 FROM tab2 cor0 GROUP BY col1, col0
----
-1353
-1947
-2013

query I rowsort
SELECT ALL col1 + - - col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col1 * + + 10 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NULL NOT IN ( COALESCE ( col1, + col1 ) * - - 89, - 55 )
----

query I rowsort
SELECT ALL - 32 FROM tab1 AS cor0 GROUP BY col2
----
-32
-32
-32

query I rowsort
SELECT ALL - 32 - col1 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1904
3217
4

query I rowsort
SELECT + + 77 FROM tab1 AS cor0 GROUP BY col2, col0
----
77
77
77

query I rowsort
SELECT + col0 FROM tab1 WHERE ( - NULLIF ( col1, col0 ) ) IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - 24 AS col0 FROM tab0 GROUP BY col0, col2, col0
----
-24
-24
-24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6233
SELECT - - CAST( NULL AS SIGNED ) col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6233
SELECT - - CAST ( NULL AS INTEGER ) col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6234
SELECT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) NOT IN ( ( - CAST( NULL AS SIGNED ) ) )
----

skipif mysql # not compatible
query I rowsort label-6234
SELECT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) NOT IN ( ( - CAST ( NULL AS INTEGER ) ) )
----

query I rowsort
SELECT + 10 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - ( - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT + ( + + col0 ) / - 7 NOT IN ( col0 * col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 AS col1, 48 col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - col2 NOT IN ( - + ( - + 15 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST( NULL AS SIGNED ) THEN col1 END )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST ( NULL AS INTEGER ) THEN col1 END )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6240
SELECT + col1 - + 72 DIV + 35 + + col1 AS col1 FROM tab0 GROUP BY col1, col0, col2
----
-2
-2
160

skipif mysql # not compatible
query I rowsort label-6240
SELECT + col1 - + 72 / + 35 + + col1 AS col1 FROM tab0 GROUP BY col1, col0, col2
----
-2
-2
160

query I rowsort
SELECT col0 * + + col0 + - col0 AS col0 FROM tab2 GROUP BY col0
----
210
8190
8372

query I rowsort
SELECT ALL - - 87 + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
4
44
61

query I rowsort
SELECT DISTINCT - col1 + - col1 + - - 58 + ( - col1 ) * - 85 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN + 39 / 37 AND + col0
----

query I rowsort
SELECT + col0 * 92 * - col1 * - + 38 AS col1 FROM tab1 GROUP BY col1, col2, col0 HAVING NULL = NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT ( - 99 ) NOT BETWEEN col2 AND ( NULL )
----

query I rowsort
SELECT DISTINCT - col1 * + col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 + - 11 + + col0 * 13 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 6 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) = col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 88 + + ( + + 59 ) col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-29
-29
-29

query I rowsort
SELECT - col1 - 89 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-130
-148
-150

query I rowsort
SELECT + 91 FROM tab1 AS cor0 GROUP BY col0
----
91
91
91

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6255
SELECT + - 5 * + + NULLIF ( + CAST( NULL AS SIGNED ), - NULLIF ( col0, col0 * CAST( + 64 AS SIGNED ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6255
SELECT + - 5 * + + NULLIF ( + CAST ( NULL AS INTEGER ), - NULLIF ( col0, col0 * CAST ( + 64 AS INTEGER ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 1 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col2 - - 80 FROM tab0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
104
118
159

query I rowsort
SELECT ALL + 8 * + - col2 + 35 / + col2 / - 2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NOT ( NOT NULL NOT BETWEEN + 85 * col1 AND ( col0 ) ) GROUP BY col0, col1 HAVING - ( - AVG ( DISTINCT + 27 ) ) + AVG ( 98 ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6260
SELECT col0 DIV col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6260
SELECT col0 / col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING + - ( col2 ) / col2 IS NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 WHERE NULL < ( NULL ) GROUP BY col1 HAVING NOT ( + 73 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - col0 col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT 91 + - 11 * - 8 * - + col1 AS col0 FROM tab1 GROUP BY col1, col0
----
-3781
-437
-4925

query I rowsort
SELECT DISTINCT - col2 + 88 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
1
30
9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * + col0 col1 FROM tab0 GROUP BY col0, col1 HAVING - ( col1 ) > NULL
----

query I rowsort
SELECT 53 AS col2 FROM tab1 GROUP BY col0, col0
----
53
53
53

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 - + col0 + - 38 col0 FROM tab2 AS cor0 GROUP BY col0
----
-129
-130
-53

query I rowsort
SELECT ALL + 9 FROM tab0 GROUP BY col0, col2
----
9
9
9

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6272
SELECT ALL + ( col2 ) / - col2 - - - 80 - + CAST( NULL AS DECIMAL ) + + 81 + - col2 - + 55 + col2 / col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6272
SELECT ALL + ( col2 ) / - col2 - - - 80 - + CAST ( NULL AS REAL ) + + 81 + - col2 - + 55 + col2 / col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col0 HAVING + 4 IS NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 WHERE - 75 NOT IN ( col2 * - col1 ) GROUP BY col2 HAVING NOT col2 IS NULL
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( + 61 ) col1 FROM tab2 WHERE NOT col1 IS NULL GROUP BY col1, col1
----
61

query I rowsort
SELECT 8 * ( - col0 ) AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( 44 ) <> 13
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6277
SELECT CAST( NULL AS SIGNED ) / - col0 + 13 FROM tab2 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6277
SELECT CAST ( NULL AS INTEGER ) / - col0 + 13 FROM tab2 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 65 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING col1 + - 17 IS NOT NULL
----
65

query I rowsort
SELECT ALL col2 FROM tab0 WHERE NOT - col0 * ( 57 ) IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + 61 FROM tab2 AS cor0 GROUP BY col0
----
61

query I rowsort
SELECT DISTINCT - - 4 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
4

onlyif mysql # DIV for integer division: 
query I rowsort label-6282
SELECT ALL col0 DIV + col0 FROM tab2 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6282
SELECT ALL col0 / + col0 FROM tab2 AS cor0 GROUP BY col0
----
1
1
1

onlyif mysql # DIV for integer division: 
query II rowsort label-6283
SELECT DISTINCT 97 * + 63 col1, - col0 DIV - - 3 AS col1 FROM tab2 GROUP BY col0, col0
----
6111
-30
6111
-5

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6283
SELECT DISTINCT 97 * + 63 col1, - col0 / - - 3 AS col1 FROM tab2 GROUP BY col0, col0
----
6111
-30
6111
-5

query I rowsort
SELECT - 38 AS col0 FROM tab1 GROUP BY col1, col2 HAVING 71 IS NOT NULL
----
-38
-38
-38

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6285
SELECT CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6285
SELECT CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - col2 / + ( + - col2 ) * + col2 + - - col2 AS col1 FROM tab0 WHERE - + ( 51 ) * + + 52 + - + col2 - + - col2 IS NULL GROUP BY col2 HAVING - col2 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6287
SELECT 34 - col2 * - 83 + - - col2 AS col0, + ( + 79 ) - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0, col2 HAVING NULL BETWEEN ( NULL ) AND - - 20
----

skipif mysql # not compatible
query II rowsort label-6287
SELECT 34 - col2 * - 83 + - - col2 AS col0, + ( + 79 ) - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0, col2 HAVING NULL BETWEEN ( NULL ) AND - - 20
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 1 + col0 col1 FROM tab1 AS cor0 WHERE NOT - col2 <> NULL GROUP BY col0, col2
----

query I rowsort
SELECT + + 20 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING 25 - + col1 IS NOT NULL
----
20
20
20

query I rowsort
SELECT DISTINCT + 97 * col1 FROM tab0 AS cor0 WHERE NOT - 17 * + col0 IS NOT NULL GROUP BY col0, col1 HAVING NOT - col1 + - 48 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6291
SELECT DISTINCT + + 47 DIV 91 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

skipif mysql # not compatible
query I rowsort label-6291
SELECT DISTINCT + + 47 / 91 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

query I rowsort
SELECT - 82 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-82
-82

query I rowsort
SELECT 30 + - col1 AS col0 FROM tab0 cor0 WHERE ( NULL IS NOT NULL ) GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col2, col1
----

query I rowsort
SELECT - ( + 62 ) FROM tab2 cor0 GROUP BY col2
----
-62
-62
-62

query I rowsort
SELECT DISTINCT - + ( - col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col1 + + col1 FROM tab1 WHERE NOT - col2 IS NULL GROUP BY col1 HAVING col1 IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 + col0 AS col2 FROM tab2 GROUP BY col0
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6299
SELECT DISTINCT - CAST( NULL AS SIGNED ) col0 FROM tab2 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6299
SELECT DISTINCT - CAST ( NULL AS INTEGER ) col0 FROM tab2 GROUP BY col0
----
NULL

query I rowsort
SELECT 63 * + 14 - + 28 AS col1 FROM tab2 GROUP BY col2
----
854
854
854

query I rowsort
SELECT col0 * + 81 + + col0 FROM tab2 GROUP BY col0, col2
----
1230
7462
7544

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6302
SELECT + - CAST( + 41 AS SIGNED ) / - + col1 * - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6302
SELECT + - CAST ( + 41 AS INTEGER ) / - + col1 * - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query II rowsort
SELECT - col2 * - ( 56 ), col0 FROM tab1 GROUP BY col0, col2, col1 HAVING + col2 / - col1 IS NOT NULL
----
2520
28
3976
82
448
22

query I rowsort
SELECT DISTINCT 16 / - col0 AS col1 FROM tab2 GROUP BY col0, col2, col0 HAVING NOT col0 IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6305
SELECT DISTINCT + + col1 + col1, col1 - 4 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT CAST( NULL AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-6305
SELECT DISTINCT + + col1 + col1, col1 - 4 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT CAST ( NULL AS REAL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 49 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6307
SELECT - col0 + + + col1 col2, + CAST( NULL AS SIGNED ) col2 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND + col1 GROUP BY col1, col2, col0 HAVING NOT - 31 * + - 98 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6307
SELECT - col0 + + + col1 col2, + CAST ( NULL AS INTEGER ) col2 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND + col1 GROUP BY col1, col2, col0 HAVING NOT - 31 * + - 98 IS NULL
----

query I rowsort
SELECT ALL 86 AS col2 FROM tab0 GROUP BY col0
----
86
86
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6309
SELECT - + 11 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT ( + CAST( 90 AS SIGNED ) > NULL )
----

skipif mysql # not compatible
query I rowsort label-6309
SELECT - + 11 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT ( + CAST ( 90 AS INTEGER ) > NULL )
----

query II rowsort
SELECT col1, 65 AS col2 FROM tab2 GROUP BY col1, col0
----
41
65
59
65
61
65

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE ( NULL ) BETWEEN - col2 AND - col2 GROUP BY col1, col1, col1
----

query I rowsort
SELECT + col2 FROM tab0 WHERE NULL = col1 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * + 37 col0 FROM tab0 WHERE + 31 * + col0 IS NOT NULL GROUP BY col2
----
-1406
-2923
-888

query I rowsort
SELECT DISTINCT + 7 - + ( + 53 ) - + col2 FROM tab1 AS cor0 GROUP BY col2
----
-117
-54
-91

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT ( - col2 ) IS NOT NULL
----

query I rowsort
SELECT + 62 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0 HAVING NULL NOT BETWEEN col1 AND + + 0
----

query I rowsort
SELECT col1 + + + col1 * col1 * + - 18 AS col2 FROM tab1 cor0 GROUP BY col1, col1, col1
----
-34804
-58425
-642

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2 HAVING + - 96 - - - 18 IS NULL
----

query I rowsort
SELECT + col2 + + col2 + - 14 * - 38 * col0 * + col2 AS col2 FROM tab0 GROUP BY col0, col2
----
1092886
1678004
549072

query I rowsort
SELECT + - 59 FROM tab1 AS cor0 GROUP BY col0, col1
----
-59
-59
-59

query II rowsort
SELECT ALL + col1, + col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6322
SELECT CAST( NULL AS DECIMAL ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6322
SELECT CAST ( NULL AS REAL ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 92 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col0, col1
----

query I rowsort
SELECT + col2 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query II rowsort
SELECT ALL col0, + col0 * col0 FROM tab1 GROUP BY col0
----
22
484
28
784
82
6724

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 AS col1, col0 col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 + + - col2 - - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT 14 IS NULL
----
45
71
8

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - - 2 IS NULL
----
44
57
6

query I rowsort
SELECT + - 21 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6330
SELECT - 32 / ( - - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) BETWEEN NULL AND + col1
----

skipif mysql # not compatible
query I rowsort label-6330
SELECT - 32 / ( - - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST ( NULL AS INTEGER ) BETWEEN NULL AND + col1
----

query II rowsort
SELECT DISTINCT + - col0, + col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 WHERE - col0 + col2 <= NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + - 13 * col2 FROM tab1 AS cor0 GROUP BY col2
----
-104
-585
-923

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING + col1 >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6335
SELECT + CAST( NULL AS DECIMAL ) AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6335
SELECT + CAST ( NULL AS REAL ) AS col0 FROM tab0 GROUP BY col1
----
NULL
NULL

query I rowsort
SELECT DISTINCT 41 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT - 78 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6337
SELECT - ( - ( + col1 ) ) AS col2 FROM tab0 AS cor0 WHERE ( NOT - 82 - - col0 / + ( - 36 ) * - - ( 71 ) + - col2 / + + 4 = + CAST( NULL AS SIGNED ) * + 16 + col1 - - col2 - - CAST( NULL AS SIGNED ) ) GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-6337
SELECT - ( - ( + col1 ) ) AS col2 FROM tab0 AS cor0 WHERE ( NOT - 82 - - col0 / + ( - 36 ) * - - ( 71 ) + - col2 / + + 4 = + CAST ( NULL AS INTEGER ) * + 16 + col1 - - col2 - - CAST ( NULL AS INTEGER ) ) GROUP BY col1, col1
----

query I rowsort
SELECT - + 79 FROM tab1 AS cor0 GROUP BY col0, col1, col1, col0
----
-79
-79
-79

query I rowsort
SELECT + 67 + - col1 / - - 86 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 53 FROM tab0 GROUP BY col1, col2
----
53

query I rowsort
SELECT - 38 * + - col1 AS col1 FROM tab0 GROUP BY col1
----
0
3078

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6342
SELECT - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0 HAVING 87 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6342
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0 HAVING 87 IS NULL
----

query I rowsort
SELECT ALL - ( col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col1 + - + col1 * - col0 AS col0 FROM tab2 GROUP BY col1, col0
----
3813
5428
976

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 * - 86 + 91 col2 FROM tab2 cor0 GROUP BY col2, col2 HAVING ( NULL ) IN ( col2 / col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 - + col1 col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-57
38
79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - 21 + + col1 + - 41 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING + 44 + + col2 NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - + col2 * + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 45 col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1, col0
----
-45
-45
-45

query I rowsort
SELECT 47 AS col1 FROM tab2 AS cor0 WHERE NOT ( NULL IN ( - - col0 ) ) GROUP BY col2, col2 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - 9 FROM tab0 GROUP BY col1, col0, col1
----
-9
-9
-9

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6353
SELECT + 65 FROM tab0 AS cor0 WHERE CAST( NULL AS DECIMAL ) > NULL GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-6353
SELECT + 65 FROM tab0 AS cor0 WHERE CAST ( NULL AS REAL ) > NULL GROUP BY col1, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6354
SELECT CAST( + 74 AS SIGNED ) * col1 FROM tab2 GROUP BY col1, col2 HAVING NOT ( 94 - col1 ) <> ( - col1 )
----

skipif mysql # not compatible
query I rowsort label-6354
SELECT CAST ( + 74 AS INTEGER ) * col1 FROM tab2 GROUP BY col1, col2 HAVING NOT ( 94 - col1 ) <> ( - col1 )
----

query II rowsort
SELECT DISTINCT + col1 AS col2, - ( - col1 ) FROM tab2 GROUP BY col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL - ( - - col1 ) * col1 AS col0 FROM tab1 GROUP BY col1, col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6357
SELECT + col0 * + 8 * - 9 * + - col0 DIV + col0 + col0 * 40 + - col0 * 8 FROM tab1 AS cor0 GROUP BY col0, col0
----
2288
2912
8528

skipif mysql # not compatible
query I rowsort label-6357
SELECT + col0 * + 8 * - 9 * + - col0 / + col0 + col0 * 40 + - col0 * 8 FROM tab1 AS cor0 GROUP BY col0, col0
----
2288
2912
8528

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + - 64 * + col1 >= ( + col1 * - 80 + + ( 84 ) )
----
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6359
SELECT ( + col0 ) + - ( - CAST( - - ( - col0 ) AS SIGNED ) ) FROM tab1 GROUP BY col2, col0, col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6359
SELECT ( + col0 ) + - ( - CAST ( - - ( - col0 ) AS INTEGER ) ) FROM tab1 GROUP BY col2, col0, col0
----
0
0
0

query I rowsort
SELECT ALL - 72 AS col0 FROM tab1 cor0 WHERE NOT ( - CASE col0 WHEN 38 / + col0 THEN NULL WHEN - + 56 - - 76 THEN - ( + 98 ) ELSE - 34 END + + NULLIF ( + 39, - ( col2 ) * - 70 ) ) NOT IN ( - 22 / - col1 ) GROUP BY col0
----

query I rowsort
SELECT + 92 - - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 - - col1 FROM tab0 AS cor0 WHERE - 36 * - + col0 IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
124
26
83

query I rowsort
SELECT 36 + - col2 FROM tab2 GROUP BY col2
----
-22
-43
-51

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING - 81 IS NULL
----

query I rowsort
SELECT ALL col0 + + 32 + + - 33 FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6366
SELECT DISTINCT + - col1 AS col0 FROM tab2 AS cor0 WHERE + 86 IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL <= ( NULL ) OR - + ( - col1 ) >= + CAST( NULL AS SIGNED ) + + col0 * + + 84
----

skipif mysql # not compatible
query I rowsort label-6366
SELECT DISTINCT + - col1 AS col0 FROM tab2 AS cor0 WHERE + 86 IS NOT NULL GROUP BY col1, col0 HAVING NOT NULL <= ( NULL ) OR - + ( - col1 ) >= + CAST ( NULL AS INTEGER ) + + col0 * + + 84
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6368
SELECT + col1 * + CAST( NULL AS DECIMAL ) FROM tab1 GROUP BY col0, col1 HAVING NOT col0 - + ( - AVG ( DISTINCT + col2 ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6368
SELECT + col1 * + CAST ( NULL AS REAL ) FROM tab1 GROUP BY col0, col1 HAVING NOT col0 - + ( - AVG ( DISTINCT + col2 ) ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6369
SELECT ALL - ( - col1 ) + + col1 DIV 44 FROM tab2 GROUP BY col1
----
41
60
62

skipif mysql # not compatible
query I rowsort label-6369
SELECT ALL - ( - col1 ) + + col1 / 44 FROM tab2 GROUP BY col1
----
41
60
62

query I rowsort
SELECT ( - 66 ) AS col2 FROM tab2 GROUP BY col2, col1 HAVING NULL <= - col1 + 11 * - 2
----

query I rowsort
SELECT 90 AS col2 FROM tab0 GROUP BY col0, col2, col0
----
90
90
90

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col2, col1, col1
----
41
59
61

query III rowsort
SELECT col0 * + 19 + + col0 AS col2, 36 AS col1, + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT + col0 + - ( - 55 ) AS col0 FROM tab0 GROUP BY col0
----
138
81
98

query I rowsort
SELECT DISTINCT 25 FROM tab0 AS cor0 GROUP BY col2
----
25

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT 51 IS NOT NULL
----

query I rowsort
SELECT + 47 AS col1 FROM tab0 GROUP BY col0
----
47
47
47

query I rowsort
SELECT ALL + 46 + + col1 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 27 FROM tab1 GROUP BY col1, col2
----
27
27
27

query I rowsort
SELECT + 78 AS col0 FROM tab2 WHERE ( + 55 * col0 ) IS NULL GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 47 AS col1 FROM tab1 GROUP BY col2 HAVING NOT 59 + 36 > NULL
----

query I rowsort
SELECT 52 FROM tab2 GROUP BY col0 HAVING NOT 78 NOT BETWEEN col0 AND 31
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NULL NOT BETWEEN ( NULL ) AND + col0 / - 27
----

query I rowsort
SELECT + 9 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL < ( NULL )
----

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IN ( col1 * + col1 + 85 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 30 col0 FROM tab1 WHERE NOT ( NULL ) = ( + col1 ) GROUP BY col2, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT + 76 FROM tab1 GROUP BY col2
----
76
76
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 27 col0 FROM tab2 AS cor0 GROUP BY col1
----
27

query I rowsort
SELECT 78 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
78
78
78

query I rowsort
SELECT col2 + + 82 FROM tab1 GROUP BY col2
----
127
153
90

query I rowsort
SELECT - 54 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-10
-48
3

query I rowsort
SELECT + + 87 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
87
87

query II rowsort
SELECT ALL 38 + - + 44 + - 91 - + col2 AS col2, col2 + - col2 + - col2 / + - 90 AS col0 FROM tab1 GROUP BY col2 HAVING ( NULL ) < - col2
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6394
SELECT DISTINCT 72 - 44 AS col2 FROM tab1 GROUP BY col2 HAVING NOT CAST( 15 AS DECIMAL ) NOT BETWEEN ( col2 * - 8 * - + col2 ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-6394
SELECT DISTINCT 72 - 44 AS col2 FROM tab1 GROUP BY col2 HAVING NOT CAST ( 15 AS REAL ) NOT BETWEEN ( col2 * - 8 * - + col2 ) AND NULL
----

query I rowsort
SELECT ALL col2 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 14 col0 FROM tab0 cor0 WHERE col2 / + 3 IS NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6397
SELECT - 18 DIV col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-6397
SELECT - 18 / col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1
0
0

query I rowsort
SELECT - - col2 / - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN 86 - - col2 AND NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - 65 = NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6401
SELECT DISTINCT + col0 * + CAST( NULL AS SIGNED ) FROM tab0 cor0 GROUP BY col0, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-6401
SELECT DISTINCT + col0 * + CAST ( NULL AS INTEGER ) FROM tab0 cor0 GROUP BY col0, col0
----
NULL

query I rowsort
SELECT ALL + NULLIF ( + + col2, + col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
24
38
79

query II rowsort
SELECT 96 AS col0, - 80 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT ALL - + col0 AS col2, - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 * + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT 41 IS NOT NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE + col2 + + col2 / + - 74 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL 19 + - 90 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-71
-71
-71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 + ( - - col2 ) col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2, col2 HAVING NOT ( NOT + 17 IS NULL )
----

query I rowsort
SELECT + + col2 + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING + col1 IS NULL
----

query II rowsort
SELECT 60 AS col0, col1 FROM tab1 GROUP BY col1, col0
----
60
44
60
57
60
6

query I rowsort
SELECT col1 + - 94 FROM tab1 GROUP BY col1
----
-37
-50
-88

query I rowsort
SELECT + 70 + - ( + 17 ) AS col2 FROM tab2 GROUP BY col1
----
53
53
53

query I rowsort
SELECT DISTINCT + + 11 AS col1 FROM tab1 WHERE NOT 65 NOT BETWEEN - col1 * + col1 AND - col1 * + - 62 * - - col0 GROUP BY col1 HAVING + col1 IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST( NULL AS DECIMAL ) >= + col1 GROUP BY col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST ( NULL AS REAL ) >= + col1 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6418
SELECT DISTINCT + COALESCE ( - + 70, + 59, - - CAST( NULL AS SIGNED ) ) AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-70

skipif mysql # not compatible
query I rowsort label-6418
SELECT DISTINCT + COALESCE ( - + 70, + 59, - - CAST ( NULL AS INTEGER ) ) AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-70

query II rowsort
SELECT ALL + col0, 43 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
43
28
43
82
43

onlyif mysql # DIV for integer division: 
query I rowsort label-6420
SELECT DISTINCT ( + 4 ) + - col2 DIV + 17 FROM tab2 GROUP BY col2
----
-1
0
1

skipif mysql # not compatible
query I rowsort label-6420
SELECT DISTINCT ( + 4 ) + - col2 / + 17 FROM tab2 GROUP BY col2
----
-1
0
1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col2 + - 55 + 50 * - + ( + col2 ) AS col1 FROM tab2 GROUP BY col2 HAVING - + col1 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6422
SELECT DISTINCT - 45 DIV + col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-7
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6422
SELECT DISTINCT - 45 / + col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1
-7
0

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6423
SELECT CAST( NULL AS DECIMAL ) FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6423
SELECT CAST ( NULL AS REAL ) FROM tab1 AS cor0 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT 38 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
38
38
38

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + 31 + 81 FROM tab1 GROUP BY col0, col1
----
112

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6427
SELECT ALL - NULLIF ( - - col2, + - 12 ) * + NULLIF ( - 76, CAST( NULL AS SIGNED ) ) FROM tab2 GROUP BY col1, col2 HAVING NOT + col1 - + col2 / + ( col2 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6427
SELECT ALL - NULLIF ( - - col2, + - 12 ) * + NULLIF ( - 76, CAST ( NULL AS INTEGER ) ) FROM tab2 GROUP BY col1, col2 HAVING NOT + col1 - + col2 / + ( col2 ) IS NOT NULL
----

query I rowsort
SELECT - col0 * + col0 + col0 + + col0 + - col2 * - 20 * - col0 AS col1 FROM tab1 GROUP BY col0, col2, col0, col0
----
-123000
-25928
-3960

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6429
SELECT ALL col1 * - + CAST( NULL AS SIGNED ) FROM tab0 cor0 GROUP BY col1, col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6429
SELECT ALL col1 * - + CAST ( NULL AS INTEGER ) FROM tab0 cor0 GROUP BY col1, col1
----
NULL
NULL

query I rowsort
SELECT 97 FROM tab2 AS cor0 GROUP BY col2, col1
----
97
97
97

query I rowsort
SELECT DISTINCT col1 * + 59 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2, col2
----
-22
-28
-82

query I rowsort
SELECT - 46 * - 34 AS col1 FROM tab2 GROUP BY col0
----
1564
1564
1564

onlyif mysql # DIV for integer division: 
query I rowsort label-6434
SELECT ALL col2 + col2 DIV + col2 AS col2 FROM tab2 GROUP BY col2
----
59
80
88

skipif mysql # not compatible
query I rowsort label-6434
SELECT ALL col2 + col2 / + col2 AS col2 FROM tab2 GROUP BY col2
----
59
80
88

query I rowsort
SELECT DISTINCT - 85 FROM tab2 GROUP BY col1, col1
----
-85

query I rowsort
SELECT - - ( - col0 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query II rowsort
SELECT + col0 AS col0, - col0 * + - 47 - col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 71 FROM tab0 GROUP BY col2
----
-71

query I rowsort
SELECT + - 32 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-32
-32
-32

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6440
SELECT DISTINCT CAST( NULL AS SIGNED ) / col0 / + col0 FROM tab1 GROUP BY col0, col0, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6440
SELECT DISTINCT CAST ( NULL AS INTEGER ) / col0 / + col0 FROM tab1 GROUP BY col0, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL - 96 FROM tab2 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 * - + col1 AS col0 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT NULL > + col2
----

query II rowsort
SELECT + - 3 + 39 AS col1, - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 NOT BETWEEN - + 80 + + 49 AND 87 - + col0
----
36
-22
36
-28

query I rowsort
SELECT - - 0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT DISTINCT 30 * 90 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT + col2 / + - col1 IS NULL
----
2700

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - 96 - 0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 + + - 18 FROM tab0 AS cor0 GROUP BY col0
----
25
65
8

query I rowsort
SELECT + col0 * - - col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT 4 FROM tab2 GROUP BY col2 HAVING NOT NULL >= 20
----

query I rowsort
SELECT DISTINCT + 84 + + col2 + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
100
174
226

query I rowsort
SELECT - 26 FROM tab2 cor0 GROUP BY col1
----
-26
-26
-26

query I rowsort
SELECT ALL 99 * + + col1 + + + col1 FROM tab0 GROUP BY col1
----
0
8100

query I rowsort
SELECT + 59 * - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <= + 93
----

query I rowsort
SELECT DISTINCT col2 + - 87 AS col0 FROM tab1 WHERE NULL IN ( + + 28 + - - 12, col0 ) GROUP BY col2, col2, col0 HAVING NOT - col2 - + col2 IS NOT NULL
----

query I rowsort
SELECT col2 * - col2 * - 21 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 94 * - col2 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT ALL 23 * + 36 FROM tab2 cor0 GROUP BY col0
----
828
828
828

onlyif mysql # DIV for integer division: 
query I rowsort label-6459
SELECT ALL + 83 DIV + col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
2

skipif mysql # not compatible
query I rowsort label-6459
SELECT ALL + 83 / + col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
2

query I rowsort
SELECT 66 FROM tab2 cor0 GROUP BY col1
----
66
66
66

query I rowsort
SELECT 27 + - 91 AS col0 FROM tab0 AS cor0 WHERE NOT NULL = + col2 + + ( + col0 ) GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6462
SELECT ALL + CAST( NULL AS SIGNED ) AS col2 FROM tab0 WHERE NOT NULL < - - col0 GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-6462
SELECT ALL + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 WHERE NOT NULL < - - col0 GROUP BY col1, col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6463
SELECT DISTINCT ( - col2 ) FROM tab1 WHERE NOT + col0 <= ( - CAST( - - col0 AS DECIMAL ) + 58 * - 84 * 91 ) GROUP BY col2, col0
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-6463
SELECT DISTINCT ( - col2 ) FROM tab1 WHERE NOT + col0 <= ( - CAST ( - - col0 AS REAL ) + 58 * - 84 * 91 ) GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6465
SELECT DISTINCT - 34 FROM tab0 cor0 WHERE ( NULL ) >= + ( - 63 ) GROUP BY col1, col0 HAVING ( NULLIF ( - col1, + CAST( NULL AS SIGNED ) ) + 7 ) > NULL
----

skipif mysql # not compatible
query I rowsort label-6465
SELECT DISTINCT - 34 FROM tab0 cor0 WHERE ( NULL ) >= + ( - 63 ) GROUP BY col1, col0 HAVING ( NULLIF ( - col1, + CAST ( NULL AS INTEGER ) ) + 7 ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6466
SELECT DISTINCT + col0 / + col2, CAST( - + 87 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING NULL IN ( col1 )
----

skipif mysql # not compatible
query II rowsort label-6466
SELECT DISTINCT + col0 / + col2, CAST ( - + 87 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING NULL IN ( col1 )
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6468
SELECT ALL + 70 FROM tab1 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col0, col1 HAVING + 9 * + CAST( NULL AS SIGNED ) * + 90 + - - col0 * - col1 = col0 + + 75 * - col1
----

skipif mysql # not compatible
query I rowsort label-6468
SELECT ALL + 70 FROM tab1 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col0, col1 HAVING + 9 * + CAST ( NULL AS INTEGER ) * + 90 + - - col0 * - col1 = col0 + + 75 * - col1
----

query I rowsort
SELECT DISTINCT - + 44 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-44

query I rowsort
SELECT DISTINCT ( - ( col0 ) ) + ( + col0 ) FROM tab2 AS cor0 GROUP BY col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-6471
SELECT 2 DIV - col0 AS col2 FROM tab1 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6471
SELECT 2 / - col0 AS col2 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + ( + - col1 ) - + col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT 86 IS NOT NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 - - col1 + + col1 * 81 FROM tab1 GROUP BY col1, col1
----
3652
4731
498

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT 14, + col0 col1 FROM tab1 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col2 HAVING NOT ( ( NOT + ( - col2 ) * 96 IS NOT NULL ) )
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - 45 FROM tab2 GROUP BY col2, col1
----
-45

query I rowsort
SELECT - 21 AS col2 FROM tab2 GROUP BY col0, col0
----
-21
-21
-21

query I rowsort
SELECT DISTINCT col2 + + + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL - 21 + col0 + - col0 * + + 47 + - ( - - col0 ) * col0 FROM tab2 GROUP BY col0
----
-12488
-12717
-936

query I rowsort
SELECT 18 * col1 AS col2 FROM tab1 GROUP BY col1
----
1026
108
792

query II rowsort
SELECT DISTINCT + col0 AS col1, - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING 53 * + col0 + ( 99 ) IS NOT NULL
----
22
-22
28
-28
82
-82

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6484
SELECT CAST( NULL AS DECIMAL ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6484
SELECT CAST ( NULL AS REAL ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT + 86 FROM tab1 GROUP BY col2, col0, col0
----
86
86
86

query I rowsort
SELECT ( + - col2 ) AS col1 FROM tab2 GROUP BY col0, col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT + - col1 - + ( + col1 ) + - 48 * + 58 FROM tab1 AS cor0 WHERE NOT - col1 >= + 31 GROUP BY col1
----
-2796
-2872
-2898

query II rowsort
SELECT - col0 * + + col0 AS col2, 15 FROM tab0 cor0 GROUP BY col0, col0, col1
----
-1849
15
-676
15
-6889
15

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + ( - col2 ) col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 col2, - col1 * col1 FROM tab0 GROUP BY col1
----
0
0
81
-6561

query II rowsort
SELECT - 43, - col0 FROM tab2 GROUP BY col0 HAVING NOT 98 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6494
SELECT ALL - col0 + + - col0 DIV col0 FROM tab2 GROUP BY col0
----
-16
-92
-93

skipif mysql # not compatible
query I rowsort label-6494
SELECT ALL - col0 + + - col0 / col0 FROM tab2 GROUP BY col0
----
-16
-92
-93

query II rowsort
SELECT 3, col1 FROM tab1 GROUP BY col0, col2, col1
----
3
44
3
57
3
6

query I rowsort
SELECT col0 + 70 FROM tab0 GROUP BY col0, col2
----
113
153
96

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT CASE - - 38 WHEN + col1 THEN - col2 END col0 FROM tab1 GROUP BY col1, col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + 11 FROM tab2 GROUP BY col0, col2
----
11
11
11

query I rowsort
SELECT DISTINCT + 62 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
62

query I rowsort
SELECT DISTINCT - - col2 + + col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT 66 * + col1 AS col0 FROM tab2 GROUP BY col0, col1
----
2706
3894
4026

query I rowsort
SELECT NULLIF ( + + col2, + col2 ) AS col0 FROM tab2 cor0 GROUP BY col1, col2 HAVING - col2 * - + 19 + - ( + + COALESCE ( - 73, - 74 * + - 88 ) ) > 76 OR NOT NULL < + - 95
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 49 + + col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
106
55
93

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col2 HAVING + NULLIF ( - col2, + ( col2 ) ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col0, col1, col2 HAVING NOT + + ( - col0 ) <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 - - 50 col0 FROM tab0 AS cor0 GROUP BY col1
----
131
50

query I rowsort
SELECT - 20 FROM tab2 AS cor0 GROUP BY col1
----
-20
-20
-20

query I rowsort
SELECT DISTINCT 24 FROM tab2 cor0 GROUP BY col0
----
24

query I rowsort
SELECT DISTINCT + col1 * + col1 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
6642

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6510
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - CAST( col0 AS SIGNED ) * - col0 IS NOT NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-6510
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - CAST ( col0 AS INTEGER ) * - col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT + ( + - 99 ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-99
-99
-99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 16 col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
16

query II rowsort
SELECT col2, col2 FROM tab0 GROUP BY col2, col2
----
24
24
38
38
79
79

query I rowsort
SELECT col1 - col0 * + col0 AS col2 FROM tab0 GROUP BY col1, col0
----
-1768
-676
-6889

query I rowsort
SELECT 97 - col1 AS col0 FROM tab0 GROUP BY col1
----
16
97

query I rowsort
SELECT 71 FROM tab0 AS cor0 GROUP BY col0
----
71
71
71

query I rowsort
SELECT ALL - + 57 FROM tab2 cor0 GROUP BY col0
----
-57
-57
-57

query I rowsort
SELECT DISTINCT col2 + - - col2 * - 84 FROM tab2 GROUP BY col2
----
-4814
-6557
-7221

query I rowsort
SELECT ALL col2 + col2 + col2 FROM tab0 GROUP BY col2
----
114
237
72

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + 16 FROM tab2 AS cor0 GROUP BY col2
----
16
16
16

query I rowsort
SELECT ALL - col0 * 3 - + 63 FROM tab0 AS cor0 WHERE NOT - 91 - + col1 <> + col0 - - col1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 79 FROM tab2 GROUP BY col2
----
-79
-79
-79

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query II rowsort
SELECT ALL - col2 * - ( col2 ), - col2 AS col0 FROM tab0 GROUP BY col2
----
1444
-38
576
-24
6241
-79

query I rowsort
SELECT DISTINCT ( + 19 ) AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
19

query I rowsort
SELECT DISTINCT + 81 FROM tab0 AS cor0 GROUP BY col2, col1
----
81

onlyif mysql # DIV for integer division: 
query I rowsort label-6528
SELECT ALL - col2 DIV col2 + 80 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + - ( 81 ) = col1 * + - col1 * + - col2
----
79
79
79

skipif mysql # not compatible
query I rowsort label-6528
SELECT ALL - col2 / col2 + 80 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + - ( 81 ) = col1 * + - col1 * + - col2
----
79
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN NULL AND col0 * + col1 GROUP BY col1, col2
----

query I rowsort
SELECT ALL - - col0 + 75 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 + col2 * col2 FROM tab0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT DISTINCT 77 FROM tab1 cor0 WHERE NOT 25 = + col1 GROUP BY col2
----
77

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6534
SELECT - 51 * + CAST( + 93 AS SIGNED ) * + col1 + - COALESCE ( + ( + col2 ), - col2 * col2 * col1 + - 83 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-194521
-279916
-289410

skipif mysql # not compatible
query I rowsort label-6534
SELECT - 51 * + CAST ( + 93 AS INTEGER ) * + col1 + - COALESCE ( + ( + col2 ), - col2 * col2 * col1 + - 83 ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-194521
-279916
-289410

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING col0 <= - 19
----

query I rowsort
SELECT ALL - 13 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL = NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6537
SELECT DISTINCT + - 10 AS col0, + col0 * - col0 + + + CAST( NULL AS DECIMAL ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-10
NULL

skipif mysql # not compatible
query II rowsort label-6537
SELECT DISTINCT + - 10 AS col0, + col0 * - col0 + + + CAST ( NULL AS REAL ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-10
NULL

query I rowsort
SELECT ALL - 45 FROM tab0 AS cor0 GROUP BY col2
----
-45
-45
-45

query I rowsort
SELECT + 4 AS col0 FROM tab2 GROUP BY col1, col1
----
4
4
4

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6542
SELECT - CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6542
SELECT - CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + - col0 + - col0 col2 FROM tab1 GROUP BY col0, col2, col0
----
-22
-28
-82

query I rowsort
SELECT 34 * - ( - 48 ) + - - 39 FROM tab0 GROUP BY col0
----
1671
1671
1671

query I rowsort
SELECT ALL col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
-484
-6724
-784

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6546
SELECT ALL + - 38 FROM tab2 AS cor0 WHERE NOT + CAST( 23 AS SIGNED ) IS NOT NULL GROUP BY col0, col0, col2
----

skipif mysql # not compatible
query I rowsort label-6546
SELECT ALL + - 38 FROM tab2 AS cor0 WHERE NOT + CAST ( 23 AS INTEGER ) IS NOT NULL GROUP BY col0, col0, col2
----

query I rowsort
SELECT - - 85 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
85
85

query II rowsort
SELECT DISTINCT + col0 - + col0 AS col1, + 91 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - 97 IS NOT NULL
----

query I rowsort
SELECT 22 FROM tab1 AS cor0 GROUP BY col0 HAVING + 55 * + - AVG ( ALL 83 ) + + NULLIF ( + + 66, + - 58 ) > ( NULL )
----

query I rowsort
SELECT DISTINCT + 66 + ( NULLIF ( 43, + 92 ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT ( - - col1 ) IS NULL
----
109

query I rowsort
SELECT DISTINCT ( - col0 ) AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

query II rowsort
SELECT ALL col0 * - col2 * + col0 * - + 98, - col2 + - 70 AS col1 FROM tab2 GROUP BY col0, col2 HAVING ( NOT - - col0 IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 + - col0 - + - 24 col2, col0 + - 19 FROM tab1 cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 31 * - col2 + + - 17 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1195
-2466
-761

query I rowsort
SELECT ALL col0 + - - col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - + col1 IS NULL
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 AS cor0 WHERE + 38 / CASE - - ( + 12 ) WHEN - col2 + col0 + - + col0 + - col0 + - col2 + + col0 / + 48 * + col1 / col2 THEN - ( 71 ) ELSE NULL END NOT BETWEEN NULL AND + + col0 GROUP BY col0, col2 HAVING + ( 27 ) / 23 BETWEEN ( col0 ) - - col2 AND NULL
----

query I rowsort
SELECT 51 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - 42 IS NOT NULL
----
51
51
51

query I rowsort
SELECT ALL 8 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) <> - 78
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 10, - - col2 + - 67, - + 99 ) * + 93 FROM tab1 GROUP BY col0, col0
----
-930
-930
-930

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6560
SELECT ALL CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6560
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6561
SELECT - 51 AS col0 FROM tab1 WHERE NOT - col0 <= - CAST( NULL AS SIGNED ) GROUP BY col0, col0
----

skipif mysql # not compatible
query I rowsort label-6561
SELECT - 51 AS col0 FROM tab1 WHERE NOT - col0 <= - CAST ( NULL AS INTEGER ) GROUP BY col0, col0
----

query I rowsort
SELECT col2 - - col2 FROM tab2 GROUP BY col2 HAVING NOT + col2 IS NULL
----
116
158
174

query I rowsort
SELECT ALL + ( - 64 ) FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL col2 * 96 FROM tab1 GROUP BY col2
----
4320
6816
768

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col2 / col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6568
SELECT - col1 + - 2 + col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1
----
-42
-60
-62

skipif mysql # not compatible
query I rowsort label-6568
SELECT - col1 + - 2 + col1 / + col1 FROM tab2 AS cor0 GROUP BY col1
----
-42
-60
-62

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query II rowsort
SELECT + col1, col1 + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0
81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6571
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( + 60 ) IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6571
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( + 60 ) IS NULL
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col2 HAVING - 23 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL 47 + - - col2 + + col2 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
123
205
95

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6574
SELECT + + 17 + - - CAST( NULL AS SIGNED ) / - - col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT NULL BETWEEN - col2 AND ( - 27 )
----

skipif mysql # not compatible
query I rowsort label-6574
SELECT + + 17 + - - CAST ( NULL AS INTEGER ) / - - col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT NULL BETWEEN - col2 AND ( - 27 )
----

query I rowsort
SELECT - + col1 * - 10 * - 13 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING + col0 + + col1 >= + 32
----
-10530
0

query I rowsort
SELECT DISTINCT + col1 + col1 * + 86 * 85 FROM tab0 GROUP BY col1, col0
----
0
592191

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6577
SELECT DISTINCT + AVG ( - CAST( NULL AS SIGNED ) ) + - - 2 FROM tab2 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-6577
SELECT DISTINCT + AVG ( - CAST ( NULL AS INTEGER ) ) + - - 2 FROM tab2 GROUP BY col1, col1
----
NULL

query I rowsort
SELECT ALL - + col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT + - col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( - NULLIF ( 92, 14 ) ) * col2 - + 59 col0 FROM tab1 cor0 WHERE NOT NULL IN ( + col2 - + - col0 * + + col2 * + - col2 + + - 20 + + - col2, col0 ) GROUP BY col2 HAVING + col2 + + col2 <> ( NULL )
----

query I rowsort
SELECT ALL NULLIF ( + col0, - 52 ) FROM tab0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 9 + + 34 col2 FROM tab0 cor0 WHERE NOT ( - col0 ) IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL 91 + - col0 FROM tab0 GROUP BY col0, col1 HAVING - col1 <= ( col1 )
----
48
65
8

query I rowsort
SELECT 14 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col0 * 56 AS col2, col0 AS col1 FROM tab2 GROUP BY col0
----
5096
91
5152
92
840
15

query I rowsort
SELECT - 83 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-83
-83
-83

query I rowsort
SELECT DISTINCT - col0 * + - col0 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-17576
-571787
-79507

query I rowsort
SELECT + - col1 * 9 - + col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-410
-590
-610

query I rowsort
SELECT ALL - 65 FROM tab0 cor0 GROUP BY col0
----
-65
-65
-65

query I rowsort
SELECT ( + col2 ) AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING col2 >= ( col2 )
----
24
38
79

query II rowsort
SELECT ALL + col0, + col0 * - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( - 3 ) BETWEEN NULL AND ( - ( + col0 ) + + 57 )
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 WHERE NOT ( + col0 ) IS NULL GROUP BY col1, col2, col0 HAVING NOT - col1 * 61 > col2
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6593
SELECT + col2 FROM tab0 cor0 WHERE NOT - CAST( NULL AS SIGNED ) IS NOT NULL GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-6593
SELECT + col2 FROM tab0 cor0 WHERE NOT - CAST ( NULL AS INTEGER ) IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT - 97 FROM tab2 AS cor0 GROUP BY col1
----
-97
-97
-97

query I rowsort
SELECT + col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * 27 col0 FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
0
0
2187

query I rowsort
SELECT + 0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
0
0
0

query I rowsort
SELECT - + col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1, col2
----
-44
-57
-6

query I rowsort
SELECT - + 22 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-22
-22
-22

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6600
SELECT ALL CAST( NULL AS SIGNED ) / + - col1 FROM tab2 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6600
SELECT ALL CAST ( NULL AS INTEGER ) / + - col1 FROM tab2 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6601
SELECT ALL - col2 - + col2 DIV - - 1 - + + 15 AS col2 FROM tab2 GROUP BY col2
----
-131
-173
-189

skipif mysql # not compatible
query I rowsort label-6601
SELECT ALL - col2 - + col2 / - - 1 - + + 15 AS col2 FROM tab2 GROUP BY col2
----
-131
-173
-189

onlyif mysql # DIV for integer division: 
query II rowsort label-6602
SELECT ( + + ( 81 ) ) DIV col0, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0
-91
0
-92
5
-15

skipif mysql # not compatible
query II rowsort label-6602
SELECT ( + + ( 81 ) ) / col0, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0
-91
0
-92
5
-15

query I rowsort
SELECT DISTINCT col2 * col2 * + + 15 + - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT - 2 IS NULL
----
30330
75544
952

query I rowsort
SELECT - col2 + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6605
SELECT + CAST( col2 AS SIGNED ) FROM tab0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-6605
SELECT + CAST ( col2 AS INTEGER ) FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - ( col1 ) + - + 26 - - col1 AS col0 FROM tab0 GROUP BY col1
----
-26
-26

query I rowsort
SELECT ALL + ( - 93 ) FROM tab2 GROUP BY col0, col0
----
-93
-93
-93

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6608
SELECT DISTINCT - col0 col2 FROM tab2 WHERE + + col1 > ( col2 / + + NULLIF ( - + CAST( NULL AS SIGNED ), col1 * col2 ) + ( + col0 ) ) GROUP BY col0, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6608
SELECT DISTINCT - col0 col2 FROM tab2 WHERE + + col1 > ( col2 / + + NULLIF ( - + CAST ( NULL AS INTEGER ), col1 * col2 ) + ( + col0 ) ) GROUP BY col0, col2
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab0 WHERE ( + - COALESCE ( + col1, col2 ) ) + - - col0 >= NULL GROUP BY col1, col0, col1
----

query I rowsort
SELECT ALL + col0 + + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( - - 44 ) > NULL
----

query I rowsort
SELECT ALL - 68 FROM tab1 AS cor0 GROUP BY col2, col2
----
-68
-68
-68

query I rowsort
SELECT + + 30 FROM tab1 cor0 GROUP BY col0, col2
----
30
30
30

query I rowsort
SELECT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL > + col1
----

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col2, col2, col1, col0 HAVING + + col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - col1 + - col1 FROM tab0 WHERE NOT NULL BETWEEN - 43 - + col1 AND - col1 * col1 + - + col0 + - 62 GROUP BY col1 HAVING - col1 * 56 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab2 GROUP BY col0 HAVING NOT - 69 <= NULL
----

query I rowsort
SELECT + col1 * - 34 + col1 FROM tab0 GROUP BY col1
----
-2673
0

query I rowsort
SELECT ALL + 37 * col0 AS col2 FROM tab1 GROUP BY col0, col0
----
1036
3034
814

query I rowsort
SELECT ALL 78 + + 36 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 + + 33 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6622
SELECT + col1 AS col0, CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query II rowsort label-6622
SELECT + col1 AS col0, CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + 47 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col1 FROM tab1 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col0 AS col0, - col0 * + - 82 col1 FROM tab2 WHERE + 28 - + - col0 NOT BETWEEN - + col0 AND col0 * - 82 GROUP BY col0 HAVING NOT ( NULL ) NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6626
SELECT - - col2 DIV + + 27 FROM tab1 AS cor0 GROUP BY col2
----
0
1
2

skipif mysql # not compatible
query I rowsort label-6626
SELECT - - col2 / + + 27 FROM tab1 AS cor0 GROUP BY col2
----
0
1
2

query I rowsort
SELECT col2 / col2 - col2 AS col1 FROM tab2 AS cor0 WHERE NOT ( + col0 ) NOT IN ( + 32 ) GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 GROUP BY col2, col1 HAVING - col0 > NULL
----

query I rowsort
SELECT col2 + 52 FROM tab1 WHERE - 30 IS NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 76 + 21 col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 + col0 AS col1 FROM tab0 GROUP BY col0
----
166
52
86

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6632
SELECT ALL CAST( NULL AS DECIMAL ) * + col2 FROM tab1 WHERE ( col1 ) IS NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6632
SELECT ALL CAST ( NULL AS REAL ) * + col2 FROM tab1 WHERE ( col1 ) IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab0 GROUP BY col1
----
0
162

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6634
SELECT DISTINCT - CAST( NULL AS SIGNED ) / col2 FROM tab0 WHERE NULL IN ( + col2 + - 23 ) GROUP BY col2 HAVING NOT ( 22 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6634
SELECT DISTINCT - CAST ( NULL AS INTEGER ) / col2 FROM tab0 WHERE NULL IN ( + col2 + - 23 ) GROUP BY col2 HAVING NOT ( 22 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6635
SELECT DISTINCT + 89 DIV col1 FROM tab2 GROUP BY col1
----
1
2

skipif mysql # not compatible
query I rowsort label-6635
SELECT DISTINCT + 89 / col1 FROM tab2 GROUP BY col1
----
1
2

query I rowsort
SELECT DISTINCT - ( 59 ) FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 34 FROM tab1 GROUP BY col0
----
34
34
34

query I rowsort
SELECT - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( 94 ) = NULL
----

query I rowsort
SELECT ALL - 76 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING ( - 92 * col1 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 37 col2 FROM tab2 WHERE NOT 25 <> ( + 3 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + 51 * + - col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - 51 AS col2 FROM tab0 GROUP BY col0, col0, col2
----
-51
-51
-51

query I rowsort
SELECT ALL - 90 FROM tab0 GROUP BY col0, col2, col0
----
-90
-90
-90

query I rowsort
SELECT + 96 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( col1 IS NULL )
----
96
96
96

query I rowsort
SELECT + 14 FROM tab2 AS cor0 GROUP BY col1, col1
----
14
14
14

onlyif mysql # DIV for integer division: 
query I rowsort label-6646
SELECT DISTINCT + col0 DIV + - COALESCE ( + 33, + 72 ) col1 FROM tab2 GROUP BY col0
----
-2
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6646
SELECT DISTINCT + col0 / + - COALESCE ( + 33, + 72 ) col1 FROM tab2 GROUP BY col0
----
-2
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6647
SELECT 47, col0 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-6647
SELECT 47, col0 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col1 HAVING NOT 17 IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 * 97 + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
-7776
0

query I rowsort
SELECT DISTINCT + ( ( - + col1 ) ) AS col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col1 HAVING NULL > NULL
----

query II rowsort
SELECT DISTINCT + 65 * - 7 * col0 * col0 * + col0 AS col0, col0 / + + col0 - + 27 + - col0 + col0 * - col0 * 79 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) > 27
----

query I rowsort
SELECT + + col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING + 12 IS NOT NULL
----
26
43
83

query I rowsort
SELECT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2, col1 HAVING NOT 15 * 46 * - col1 >= NULL
----

query I rowsort
SELECT 97 AS col1 FROM tab2 GROUP BY col0, col0
----
97
97
97

query II rowsort
SELECT + col1, + 45 FROM tab2 GROUP BY col1 HAVING - 10 IS NULL
----

query I rowsort
SELECT DISTINCT col2 * - 82 + col2 AS col0 FROM tab2 GROUP BY col2
----
-4698
-6399
-7047

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6659
SELECT + ( - CAST( NULL AS SIGNED ) ) + 36 * - - 0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6659
SELECT + ( - CAST ( NULL AS INTEGER ) ) + 36 * - - 0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 * - col2 col2, col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING 93 / col2 + - col2 IS NOT NULL
----
-1305
15
-5336
92
-7189
91

query I rowsort
SELECT ALL - ( + col1 ) + - 66 + col1 FROM tab0 GROUP BY col1
----
-66
-66

query I rowsort
SELECT - 3 + - col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN + - ( + + 71 ) AND + col2 / - + col2 / - ( + col2 )
----

query II rowsort
SELECT - - 88, + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
88
44
88
57
88
6

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL >= + col0
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT + col0 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT col2 * + ( - col0 ) * - + col0 AS col0 FROM tab1 GROUP BY col2, col0
----
35280
3872
477404

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL 25 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1075
2075
650

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6670
SELECT CAST( NULL AS SIGNED ) * CAST( 0 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6670
SELECT CAST ( NULL AS INTEGER ) * CAST ( 0 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - - 85 - - col1 FROM tab0 AS cor0 GROUP BY col1
----
166
85

query I rowsort
SELECT ( + 41 ) FROM tab2 GROUP BY col2
----
41
41
41

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6673
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN NULL AND - - 54 * CAST( - col1 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-6673
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN NULL AND - - 54 * CAST ( - col1 AS INTEGER )
----

query I rowsort
SELECT - col0 * - 43 AS col0 FROM tab1 GROUP BY col0 HAVING NULL > + 64
----

query I rowsort
SELECT ALL + 80 FROM tab2 AS cor0 GROUP BY col0
----
80
80
80

onlyif mysql # DIV for integer division: 
query I rowsort label-6676
SELECT - col1 - + + col1 DIV - + 87 AS col1 FROM tab1 AS cor0 WHERE 9 NOT IN ( - + col0 - + - col1 * 79, + col0, col0, - COALESCE ( - + col1, + + col1 + - col1 + - col0 ), + - 5, + 15 * + 25 + col1 - - col0 DIV - 92 ) GROUP BY col1, col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-6676
SELECT - col1 - + + col1 / - + 87 AS col1 FROM tab1 AS cor0 WHERE 9 NOT IN ( - + col0 - + - col1 * 79, + col0, col0, - COALESCE ( - + col1, + + col1 + - col1 + - col0 ), + - 5, + 15 * + 25 + col1 - - col0 / - 92 ) GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT - col0 * 78 AS col1 FROM tab1 GROUP BY col0
----
-1716
-2184
-6396

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 36 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-36

query I rowsort
SELECT ALL + + 60 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
60
60
60

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6680
SELECT - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6680
SELECT - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-6681
SELECT DISTINCT + 2 DIV - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
0

skipif mysql # not compatible
query I rowsort label-6681
SELECT DISTINCT + 2 / - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 65 col1 FROM tab0 AS cor0 GROUP BY col1
----
65

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( - + AVG ( + - ( - col0 ) ) ) IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT 57 FROM tab1 GROUP BY col0, col2
----
57

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE NOT - col0 * - col0 + - + col0 <> col0 * + 50 / - col1 GROUP BY col1, col0 HAVING NOT NULL = NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6688
SELECT ALL col1 DIV - col1, + CASE + - 33 WHEN + 66 THEN col0 + + col2 + - - col1 + - - col0 * + col0 ELSE NULL END AS col0 FROM tab2 GROUP BY col1
----
-1
NULL
-1
NULL
-1
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6688
SELECT ALL col1 / - col1, + CASE + - 33 WHEN + 66 THEN col0 + + col2 + - - col1 + - - col0 * + col0 ELSE NULL END AS col0 FROM tab2 GROUP BY col1
----
-1
NULL
-1
NULL
-1
NULL

query I rowsort
SELECT DISTINCT + col2 FROM tab2 WHERE NULL NOT BETWEEN - - col0 + col1 AND NULL GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 26 FROM tab1 cor0 GROUP BY col2
----
-26
-26
-26

query I rowsort
SELECT DISTINCT - - 44 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44

query I rowsort
SELECT + col2 * - 82 FROM tab2 AS cor0 GROUP BY col2
----
-4756
-6478
-7134

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6693
SELECT ALL + col1 / - col1 * + + 46 + - CAST( NULL AS SIGNED ), - col1 AS col1 FROM tab1 GROUP BY col1
----
NULL
-44
NULL
-57
NULL
-6

skipif mysql # not compatible
query II rowsort label-6693
SELECT ALL + col1 / - col1 * + + 46 + - CAST ( NULL AS INTEGER ), - col1 AS col1 FROM tab1 GROUP BY col1
----
NULL
-44
NULL
-57
NULL
-6

query I rowsort
SELECT DISTINCT + + ( + ( col1 ) ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE + ( 32 ) IS NULL GROUP BY col1
----

query I rowsort
SELECT ( + 72 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 + 95 FROM tab2 AS cor0 GROUP BY col0
----
110
186
187

query I rowsort
SELECT + 79 FROM tab1 GROUP BY col2
----
79
79
79

query I rowsort
SELECT + col1 + - + 1 FROM tab1 AS cor0 GROUP BY col1
----
43
5
56

query I rowsort
SELECT ALL + 34 FROM tab2 AS cor0 GROUP BY col2, col2
----
34
34
34

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6701
SELECT CAST( NULL AS DECIMAL ), 65 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NULL <> NULL
----

skipif mysql # not compatible
query II rowsort label-6701
SELECT CAST ( NULL AS REAL ), 65 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( col1 ) * + + 10 * + - col1 col2 FROM tab0 GROUP BY col1, col1
----
-65610
0

query I rowsort
SELECT - 14 + - + 10 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col1 FROM tab0 AS cor0 WHERE NOT + 92 NOT IN ( - CASE - col2 WHEN - + col2 THEN col0 ELSE NULL END ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL - 40 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-40
-40
-40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * + col0 - + col0 col1 FROM tab1 GROUP BY col0
----
462
6642
756

query I rowsort
SELECT DISTINCT + 64 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6708
SELECT DISTINCT - - CAST( NULL AS SIGNED ) + CAST( - col1 AS SIGNED ) + + + 25 + - col0 * + 11 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + col1 * - CAST( + col1 AS SIGNED ) <= 49 / + col1
----

skipif mysql # not compatible
query I rowsort label-6708
SELECT DISTINCT - - CAST ( NULL AS INTEGER ) + CAST ( - col1 AS INTEGER ) + + + 25 + - col0 * + 11 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + col1 * - CAST ( + col1 AS INTEGER ) <= 49 / + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6709
SELECT DISTINCT + col1 * - + 31 / ( col1 ) - CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-6709
SELECT DISTINCT + col1 * - + 31 / ( col1 ) - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT ALL - + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL NOT IN ( - 45 + + + col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6711
SELECT DISTINCT 40 * - col2 * - col2 + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL

skipif mysql # not compatible
query I rowsort label-6711
SELECT DISTINCT 40 * - col2 * - col2 + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col0
----
NULL

query I rowsort
SELECT + 11 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
11
11
11

query I rowsort
SELECT ALL + col2 - 62 * - - col2 AS col0 FROM tab1 GROUP BY col2 HAVING - 52 NOT IN ( - 26 )
----
-2745
-4331
-488

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6715
SELECT ALL - 76 FROM tab0 WHERE NOT col2 * - 77 + CAST( NULL AS SIGNED ) IS NOT NULL GROUP BY col1 HAVING NOT + 48 + + 83 IS NULL
----
-76
-76

skipif mysql # not compatible
query I rowsort label-6715
SELECT ALL - 76 FROM tab0 WHERE NOT col2 * - 77 + CAST ( NULL AS INTEGER ) IS NOT NULL GROUP BY col1 HAVING NOT + 48 + + 83 IS NULL
----
-76
-76

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 WHERE NOT ( col1 ) IS NULL GROUP BY col0 HAVING NOT + col0 * - 13 <= + ( + 62 )
----

query I rowsort
SELECT col0 + 26 AS col1 FROM tab2 GROUP BY col0
----
117
118
41

query I rowsort
SELECT ALL - 70 * 27 FROM tab0 GROUP BY col2
----
-1890
-1890
-1890

onlyif mysql # DIV for integer division: 
query I rowsort label-6719
SELECT DISTINCT col1 DIV col1 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-6719
SELECT DISTINCT col1 / col1 FROM tab1 GROUP BY col1
----
1

query I rowsort
SELECT ALL col0 + - col0 AS col1 FROM tab0 WHERE col1 + col0 < ( NULL ) GROUP BY col0 HAVING - 63 BETWEEN + col0 AND + col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL NOT BETWEEN ( - 66 * + col0 ) AND NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT 71 >= NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col2, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-6724
SELECT DISTINCT ( col0 ) DIV - col0 FROM tab2 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-6724
SELECT DISTINCT ( col0 ) / - col0 FROM tab2 AS cor0 GROUP BY col0
----
-1

query I rowsort
SELECT - + 66 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL BETWEEN 79 AND - 9
----

query I rowsort
SELECT col1 + - col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL 80 FROM tab2 AS cor0 GROUP BY col0, col2
----
80
80
80

query I rowsort
SELECT ALL col0 + + - col0 + + 31 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
31
31
31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6729
SELECT ALL col0 / + ( CAST( - 44 AS SIGNED ) ) FROM tab2 WHERE - ( col0 ) + CAST( col2 AS SIGNED ) = ( NULL ) GROUP BY col0 HAVING NOT NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-6729
SELECT ALL col0 / + ( CAST ( - 44 AS INTEGER ) ) FROM tab2 WHERE - ( col0 ) + CAST ( col2 AS INTEGER ) = ( NULL ) GROUP BY col0 HAVING NOT NULL = NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6730
SELECT ALL CAST( NULL AS DECIMAL ) + + - 82 * + - 74 + - CAST( + 67 AS SIGNED ) FROM tab1 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6730
SELECT ALL CAST ( NULL AS REAL ) + + - 82 * + - 74 + - CAST ( + 67 AS INTEGER ) FROM tab1 GROUP BY col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 81 AS col2 FROM tab1 GROUP BY col1, col1
----
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6732
SELECT - col1 AS col1 FROM tab2 WHERE NULL > ( - col2 * CAST( + ( + col0 ) AS SIGNED ) / + col0 + ( + 84 + col0 ) * + col0 ) GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-6732
SELECT - col1 AS col1 FROM tab2 WHERE NULL > ( - col2 * CAST ( + ( + col0 ) AS INTEGER ) / + col0 + ( + 84 + col0 ) * + col0 ) GROUP BY col1, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6733
SELECT DISTINCT - col1 + CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( - col1 * col1 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6733
SELECT DISTINCT - col1 + CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( - col1 * col1 ) IS NOT NULL
----

query I rowsort
SELECT 30 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
30
30
30

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 cor0 WHERE ( - 88 ) NOT BETWEEN NULL AND NULL GROUP BY col0 HAVING NULL = ( - 15 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + col1 col1, 66 FROM tab1 cor0 GROUP BY col1 HAVING NOT ( col1 ) NOT BETWEEN NULL AND - 0
----

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL >= 17
----

query I rowsort
SELECT DISTINCT + + col2 + - - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
153
30
73

query I rowsort
SELECT DISTINCT ( - - col1 ) AS col0 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT ALL 27 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
27
27
27

query II rowsort
SELECT DISTINCT + + col1, - col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT - 85 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 >= NULL
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6744
SELECT ALL CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6744
SELECT ALL CAST ( NULL AS REAL ) FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 63 * col2 FROM tab2 WHERE NOT + col2 IS NULL GROUP BY col2
----
3654
4977
5481

query I rowsort
SELECT ALL 11 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
11
11
11

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL < + AVG ( + col0 )
----

query I rowsort
SELECT + 45 - - col0 AS col1 FROM tab2 GROUP BY col0
----
136
137
60

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 19 AS col2 FROM tab2 GROUP BY col0, col1, col1 HAVING NULL NOT BETWEEN + - NULLIF ( + - col2, - + ( + 2 ) ) AND + col2
----

query I rowsort
SELECT 21 AS col0 FROM tab2 GROUP BY col2
----
21
21
21

query I rowsort
SELECT - 36 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-36
-36
-36

query I rowsort
SELECT DISTINCT - 30 + - ( + col0 ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-112
-52
-58

query I rowsort
SELECT DISTINCT + col2 * + + col2 FROM tab0 GROUP BY col2, col1
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL >= col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6755
SELECT ALL ( NULLIF ( + + CAST( NULL AS SIGNED ), - 54 ) ) FROM tab2 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6755
SELECT ALL ( NULLIF ( + + CAST ( NULL AS INTEGER ), - 54 ) ) FROM tab2 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 17 FROM tab1 GROUP BY col2 HAVING - 56 IS NULL
----

query I rowsort
SELECT ALL - ( + - col0 ) FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT + 30 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT col2 * + - 63 AS col0 FROM tab0 GROUP BY col2, col0
----
-1512
-2394
-4977

query I rowsort
SELECT DISTINCT + 19 AS col2 FROM tab1 GROUP BY col0
----
19

query I rowsort
SELECT ALL + + col0 - - - col0 FROM tab0 cor0 GROUP BY col0, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - 91 AS col1 FROM tab2 GROUP BY col0
----
-91
-91
-91

query II rowsort
SELECT + col1 AS col1, + 12 + - + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
-59
57
-33
6
4

onlyif mysql # DIV for integer division: 
query I rowsort label-6764
SELECT ALL + col2 DIV + + col2 + + col2 * - ( + col2 ) FROM tab1 GROUP BY col2
----
-2024
-5040
-63

skipif mysql # not compatible
query I rowsort label-6764
SELECT ALL + col2 / + + col2 + + col2 * - ( + col2 ) FROM tab1 GROUP BY col2
----
-2024
-5040
-63

query I rowsort
SELECT + col1 * + - col1 AS col0 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6766
SELECT ALL col2 col2 FROM tab1 GROUP BY col2 HAVING - 75 - - + CAST( NULL AS SIGNED ) IN ( col2, + col2, - + col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6766
SELECT ALL col2 col2 FROM tab1 GROUP BY col2 HAVING - 75 - - + CAST ( NULL AS INTEGER ) IN ( col2, + col2, - + col2 )
----

query I rowsort
SELECT ALL + col1 + col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT - 62 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - + col0 IS NULL
----
-62
-62
-62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6769
SELECT ALL - CAST( - + 40 AS SIGNED ) + 4 FROM tab1 GROUP BY col0
----
44
44
44

skipif mysql # not compatible
query I rowsort label-6769
SELECT ALL - CAST ( - + 40 AS INTEGER ) + 4 FROM tab1 GROUP BY col0
----
44
44
44

query II rowsort
SELECT col0 * + col0, + 37 AS col2 FROM tab1 GROUP BY col2, col0 HAVING - col2 / + col2 = - 71 + col0 * 69
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL BETWEEN ( + 35 - - 27 ) AND ( NULL )
----

query I rowsort
SELECT 97 + 35 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT 53 IS NULL
----
132
132
132

query I rowsort
SELECT + ( + col0 ) + 90 FROM tab1 GROUP BY col0 HAVING + col0 NOT BETWEEN 61 AND + 78
----
112
118
172

query II rowsort
SELECT + col2 + + col2, col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT 28 + - - 22 IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE ( NULL ) <> 21 GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 3 col2 FROM tab0 GROUP BY col1, col1, col1 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT ALL col2 + - - 70 - - + col2 - - col2 * - col2 FROM tab0 WHERE NOT NULL NOT BETWEEN ( NULL ) AND col2 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6778
SELECT - col1 / - + AVG ( col1 ) * - CAST( NULL AS SIGNED ) * + 97 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6778
SELECT - col1 / - + AVG ( col1 ) * - CAST ( NULL AS INTEGER ) * + 97 FROM tab0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 / + 75 < NULL
----

query I rowsort
SELECT col2 * - + 34 FROM tab0 AS cor0 GROUP BY col2
----
-1292
-2686
-816

query I rowsort
SELECT ALL - col2 * - + 9 FROM tab2 WHERE NOT NULL = NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 12 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-12
-12
-12

onlyif mysql # DIV for integer division: 
query I rowsort label-6783
SELECT col2 + - 39 DIV col2 col0 FROM tab0 WHERE + col0 DIV + - col2 + col1 - - + col2 * 59 IS NOT NULL GROUP BY col2
----
23
37
79

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6783
SELECT col2 + - 39 / col2 col0 FROM tab0 WHERE + col0 / + - col2 + col1 - - + col2 * 59 IS NOT NULL GROUP BY col2
----
23
37
79

query I rowsort
SELECT - 57 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
-136
-81
-95

query I rowsort
SELECT + col2 * 18 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
1044
1422
1566

query I rowsort
SELECT + col1 + + col1 + - col1 * + 37 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6787
SELECT ALL col0 DIV 94 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6787
SELECT ALL col0 / 94 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 + + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
129
249
78

onlyif mysql # DIV for integer division: 
query I rowsort label-6789
SELECT 57 DIV - col0 + + 0 + + col0 FROM tab2 GROUP BY col0, col0
----
12
91
92

skipif mysql # not compatible
query I rowsort label-6789
SELECT 57 / - col0 + + 0 + + col0 FROM tab2 GROUP BY col0, col0
----
12
91
92

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
26
43
83

query II rowsort
SELECT + col1, - 82 + - + col1 + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1 HAVING NOT NULL > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6792
SELECT - ( col2 ) FROM tab2 AS cor0 WHERE NOT - col2 * CAST( NULL AS SIGNED ) IS NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-6792
SELECT - ( col2 ) FROM tab2 AS cor0 WHERE NOT - col2 * CAST ( NULL AS INTEGER ) IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + 4 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT ( NULL IS NULL ) )
----

query I rowsort
SELECT + 84 * + col1 AS col2 FROM tab1 GROUP BY col1
----
3696
4788
504

query I rowsort
SELECT ALL - ( - col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-6796
SELECT DISTINCT - col2 + - 75 + + ( + col2 ) DIV - 99 * - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
-113
-154
-99

skipif mysql # not compatible
query I rowsort label-6796
SELECT DISTINCT - col2 + - 75 + + ( + col2 ) / - 99 * - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
-113
-154
-99

query I rowsort
SELECT ( - ( + + 27 ) ) FROM tab2 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT + col2 * - col2 * + 9 * + 50 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT + 18 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
1494
468
774

query I rowsort
SELECT 13 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
13
13
13

query I rowsort
SELECT 49 FROM tab0 AS cor0 GROUP BY col2
----
49
49
49

query I rowsort
SELECT ALL - 27 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
-27
-27
-27

query I rowsort
SELECT DISTINCT 99 FROM tab1 GROUP BY col1
----
99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2, + col2 * + col2 + 66 + - - col2 col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) = - - 60
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6805
SELECT ALL 30 DIV - + 88 + - 30 FROM tab2 GROUP BY col1
----
-30
-30
-30

skipif mysql # not compatible
query I rowsort label-6805
SELECT ALL 30 / - + 88 + - 30 FROM tab2 GROUP BY col1
----
-30
-30
-30

query I rowsort
SELECT ( + + col0 ) + col0 FROM tab2 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT + col0 + - 2 + - - col2 FROM tab0 AS cor0 WHERE ( NULL ) NOT IN ( - + col1 * - col1, - col1 + - - col1 / - + col0 + + col1, - - col0, - 61 + + col1 ) GROUP BY col1, col0, col2 HAVING ( - ( - col0 ) ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6808
SELECT DISTINCT + - 14 * 7 DIV + - ( - col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-1
-6

skipif mysql # not compatible
query I rowsort label-6808
SELECT DISTINCT + - 14 * 7 / + - ( - col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-1
-6

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT col2 * + col1 + - col2 - + col2 IN ( - 55 * + NULLIF ( - col2, - col0 ) + - + ( 26 ), 79 ) GROUP BY col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6810
SELECT ALL CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6810
SELECT ALL CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6811
SELECT ALL - + CAST( - 39 AS SIGNED ) * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
1599
2301
2379

skipif mysql # not compatible
query I rowsort label-6811
SELECT ALL - + CAST ( - 39 AS INTEGER ) * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
1599
2301
2379

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( - col1 ) + col1 + + - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6813
SELECT + col1 + - CAST( NULL AS SIGNED ) / + - 90 AS col2 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6813
SELECT + col1 + - CAST ( NULL AS INTEGER ) / + - 90 AS col2 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - AVG ( DISTINCT col0 ) * - ( - + 59 ) + - + 12 FROM tab0 GROUP BY col0 HAVING NULL IN ( + col0 / - + 37 )
----

query I rowsort
SELECT col1 FROM tab0 cor0 WHERE NOT - 3 NOT BETWEEN col2 AND - col1 GROUP BY col1
----

query I rowsort
SELECT 41 AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
41
41
41

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + col0 AS col2, - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL > - col0 / + col0
----

query II rowsort
SELECT + col0 AS col1, 25 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - col1, col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULLIF ( + 29, col1 ) + NULLIF ( + 93, + ( 47 ) ) < + 59
----

query I rowsort
SELECT ALL 82 FROM tab1 GROUP BY col2 HAVING + 18 > 63
----

query I rowsort
SELECT - col0 + - col0 AS col0 FROM tab2 GROUP BY col0
----
-182
-184
-30

onlyif mysql # DIV for integer division: 
query I rowsort label-6822
SELECT col1 DIV - - 42 AS col1 FROM tab2 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
0
1
1

skipif mysql # not compatible
query I rowsort label-6822
SELECT col1 / - - 42 AS col1 FROM tab2 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
0
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-6823
SELECT DISTINCT + col2 DIV + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
1

skipif mysql # not compatible
query I rowsort label-6823
SELECT DISTINCT + col2 / + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
1

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 cor0 WHERE NOT NULL NOT BETWEEN NULL AND col2 GROUP BY col0, col1
----

query I rowsort
SELECT + - 82 - 68 FROM tab1 AS cor0 GROUP BY col2, col0
----
-150
-150
-150

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6826
SELECT DISTINCT - col0 / - CAST( NULL AS SIGNED ) + - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-6826
SELECT DISTINCT - col0 / - CAST ( NULL AS INTEGER ) + - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
NULL

query II rowsort
SELECT + col2 AS col0, 42 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6828
SELECT col0 * col0 * - - 26 * - CAST( NULL AS SIGNED ) * col0 FROM tab0 WHERE NOT - + col0 IS NULL GROUP BY col0, col2 HAVING NOT NULL > + 11
----

skipif mysql # not compatible
query I rowsort label-6828
SELECT col0 * col0 * - - 26 * - CAST ( NULL AS INTEGER ) * col0 FROM tab0 WHERE NOT - + col0 IS NULL GROUP BY col0, col2 HAVING NOT NULL > + 11
----

query II rowsort
SELECT ALL - col2 * 24, col2 AS col2 FROM tab2 AS cor0 WHERE col1 > + - 48 + col2 + + ( + col1 ) GROUP BY col2
----

query I rowsort
SELECT + ( + col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - 84 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-84
-84
-84

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - + ( + 56 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-56

query I rowsort
SELECT ALL - ( col0 ) AS col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6835
SELECT - - CAST( NULL AS SIGNED ) + - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6835
SELECT - - CAST ( NULL AS INTEGER ) + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col0 + - + col0 FROM tab1 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT - 5 FROM tab0 GROUP BY col1, col2
----
-5
-5
-5

query I rowsort
SELECT - 74 * + col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * 93 AS col0 FROM tab0 WHERE col0 NOT BETWEEN + 85 AND ( col1 ) * - ( col1 / - 30 + col2 * col2 ) GROUP BY col2, col0, col1
----
0
0
7533

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6840
SELECT 72 + 33 * CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6840
SELECT 72 + 33 * CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( col0 ) + + col0 * col0 col1 FROM tab0 GROUP BY col0 HAVING ( - col0 ) NOT IN ( + 51 )
----
1892
6972
702

query I rowsort
SELECT - col2 * - 72 AS col2 FROM tab0 WHERE NULL >= NULL GROUP BY col2
----

query I rowsort
SELECT - ( col0 ) FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING 71 * 87 >= NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col2, col0, col1
----
0
81

query I rowsort
SELECT ALL + col1 + - 3 AS col2 FROM tab2 GROUP BY col1, col0
----
38
56
58

query I rowsort
SELECT col0 * - 22 + - + col0 + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-1826
-572
-946

query I rowsort
SELECT DISTINCT - col0 * - 39 AS col2 FROM tab0 GROUP BY col1, col0
----
1014
1677
3237

query I rowsort
SELECT + ( col2 ) AS col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT DISTINCT - 59 AS col2 FROM tab2 GROUP BY col0 HAVING + + col0 IS NOT NULL
----
-59

query II rowsort
SELECT ALL + col0, 51 FROM tab1 AS cor0 WHERE - col2 <= col2 GROUP BY col0 HAVING NOT 47 * 39 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6853
SELECT + CAST( - col2 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-6853
SELECT + CAST ( - col2 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + 39 FROM tab2 WHERE + + col1 - + col2 IS NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6855
SELECT ALL + + AVG ( DISTINCT - 48 ) FROM tab0 AS cor0 WHERE NOT + - ( + ( col1 ) ) NOT BETWEEN NULL AND - - CAST( col0 AS SIGNED ) AND ( NULL ) BETWEEN NULL AND + - col1 * col2 GROUP BY col1 HAVING NOT + - col1 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6855
SELECT ALL + + AVG ( DISTINCT - 48 ) FROM tab0 AS cor0 WHERE NOT + - ( + ( col1 ) ) NOT BETWEEN NULL AND - - CAST ( col0 AS INTEGER ) AND ( NULL ) BETWEEN NULL AND + - col1 * col2 GROUP BY col1 HAVING NOT + - col1 IS NULL
----

query I rowsort
SELECT DISTINCT 45 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-3195
-360

query I rowsort
SELECT 66 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
66
66
66

onlyif mysql # DIV for integer division: 
query I rowsort label-6858
SELECT col0 DIV 11 AS col1 FROM tab1 GROUP BY col0
----
2
2
7

skipif mysql # not compatible
query I rowsort label-6858
SELECT col0 / 11 AS col1 FROM tab1 GROUP BY col0
----
2
2
7

query I rowsort
SELECT DISTINCT + 34 AS col1 FROM tab2 GROUP BY col2, col1 HAVING + NULLIF ( + + ( - 21 ), + col1 ) + 90 < 56 * col2 * + col2
----
34

query I rowsort
SELECT + 54 / + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 51 FROM tab1 AS cor0 GROUP BY col1
----
51
51
51

query I rowsort
SELECT ALL + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1, col0
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6863
SELECT DISTINCT CAST( NULL AS SIGNED ) AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6863
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-6865
SELECT DISTINCT + col0 DIV - + col0 AS col0 FROM tab2 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-6865
SELECT DISTINCT + col0 / - + col0 AS col0 FROM tab2 GROUP BY col0
----
-1

query I rowsort
SELECT DISTINCT col0 + - col0 AS col0 FROM tab1 GROUP BY col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-6867
SELECT ALL - col2 + + col2 DIV + 6 + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-145
-44
-70

skipif mysql # not compatible
query I rowsort label-6867
SELECT ALL - col2 + + col2 / + 6 + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-145
-44
-70

onlyif mysql # DIV for integer division: 
query I rowsort label-6868
SELECT ALL - col2 DIV - 8 + - 84 FROM tab1 AS cor0 GROUP BY col2, col2
----
-76
-79
-83

skipif mysql # not compatible
query I rowsort label-6868
SELECT ALL - col2 / - 8 + - 84 FROM tab1 AS cor0 GROUP BY col2, col2
----
-76
-79
-83

query I rowsort
SELECT col1 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
2378
4661
5307

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 WHERE 77 IS NOT NULL GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT - 74 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-74
-74
-74

query I rowsort
SELECT DISTINCT - 54 FROM tab1 cor0 GROUP BY col0
----
-54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col1, col1 + - col1 FROM tab1 GROUP BY col1
----
44
0
57
0
6
0

query I rowsort
SELECT 80 FROM tab0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT + 58 FROM tab2 GROUP BY col1, col1
----
58

query I rowsort
SELECT 73 + 85 FROM tab2 GROUP BY col1
----
158
158
158

query I rowsort
SELECT col2 - - + 80 FROM tab2 GROUP BY col2
----
138
159
167

query I rowsort
SELECT ALL 64 + - col1 - 40 AS col1 FROM tab1 GROUP BY col1
----
-20
-33
18

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 85 + - col0 / col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT - 92 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-92
-92
-92

query I rowsort
SELECT + 90 FROM tab0 AS cor0 GROUP BY col2
----
90
90
90

query I rowsort
SELECT ALL - 95 AS col1 FROM tab0 cor0 GROUP BY col2
----
-95
-95
-95

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * col2 * col2 + col2 * + 82 col0 FROM tab0 GROUP BY col2, col2
----
-11856
-486561
-51756

query I rowsort
SELECT ALL + 97 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
97
97
97

query I rowsort
SELECT 72 * + col0 - - col0 AS col0 FROM tab0 GROUP BY col1, col0, col1
----
1898
3139
6059

query I rowsort
SELECT DISTINCT - 19 FROM tab0 AS cor0 GROUP BY col0
----
-19

query I rowsort
SELECT ALL - 85 FROM tab1 GROUP BY col2
----
-85
-85
-85

query I rowsort
SELECT + 47 * + 26 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN col1 AND - col2 * col1 * 88 * col0 GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + - ( - 32 ) col0 FROM tab1 cor0 WHERE + 90 NOT BETWEEN + ( + - col2 ) AND + ( + 7 ) * - col1 * + 77 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 23 FROM tab0 GROUP BY col0, col0 HAVING - + 94 IS NOT NULL
----
23

query I rowsort
SELECT ALL - col0 * + col0 AS col0 FROM tab2 GROUP BY col0 HAVING + - col0 <= NULL
----

query I rowsort
SELECT col2 * + - col2 AS col2 FROM tab0 GROUP BY col2 HAVING + 44 * - + 31 > NULL
----

query I rowsort
SELECT col1 + - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT 60 * col0 FROM tab0 GROUP BY col0
----
1560
2580
4980

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 WHERE NOT col0 BETWEEN NULL AND - - col2 GROUP BY col0
----
-22
-82

query I rowsort
SELECT ALL - ( - col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * col1 AS col2 FROM tab0 GROUP BY col2, col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT 1 - + ( + - 97 ) col0, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT + col0 * + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
1849
676
6889

query I rowsort
SELECT DISTINCT - ( - - ( - 91 ) ) FROM tab2 GROUP BY col0, col0
----
91

query I rowsort
SELECT ALL col0 * col2 AS col2 FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT - ( + 1 ) FROM tab0 GROUP BY col1, col2
----
-1
-1
-1

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + col0 - - + 16 + + + ( 7 ) IS NOT NULL )
----
26
43
83

query I rowsort
SELECT DISTINCT + 76 FROM tab1 AS cor0 GROUP BY col0
----
76

query I rowsort
SELECT DISTINCT + col0 + + 27 * + - 85 FROM tab2 AS cor0 GROUP BY col0
----
-2203
-2204
-2280

query I rowsort
SELECT DISTINCT + col0 + + + col0 FROM tab0 GROUP BY col0
----
166
52
86

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6908
SELECT - + ( CAST( + + CAST( - col0 AS DECIMAL ) AS SIGNED ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6908
SELECT - + ( CAST ( + + CAST ( - col0 AS REAL ) AS INTEGER ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 16 AS col0 FROM tab0 GROUP BY col2
----
16
16
16

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6911
SELECT CAST( - col0 AS SIGNED ) FROM tab1 GROUP BY col0 HAVING + + col0 IS NULL
----

skipif mysql # not compatible
query I rowsort label-6911
SELECT CAST ( - col0 AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 WHERE NOT ( NOT + 74 < col0 * + col1 + + 95 ) GROUP BY col0, col0 HAVING NOT NULL > - 40
----

query I rowsort
SELECT DISTINCT ( - 95 ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - col1 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + 20 AS col2, - COALESCE ( + 41, - + col0 + + + 75 ) / + - 8 * - ( - col2 ) AS col2 FROM tab2 WHERE + 73 IS NOT NULL GROUP BY col2, col2 HAVING + 58 * 6 BETWEEN NULL AND + col2
----

query II rowsort
SELECT ALL 46, + col0 FROM tab1 GROUP BY col2, col0
----
46
22
46
28
46
82

query I rowsort
SELECT 28 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING 60 IS NULL
----

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - 30 col1 FROM tab1 AS cor0 GROUP BY col0
----
30
30
30

onlyif mysql # DIV for integer division: 
query I rowsort label-6919
SELECT DISTINCT col2 DIV + col2 AS col1 FROM tab0 GROUP BY col2, col2, col0
----
1

skipif mysql # not compatible
query I rowsort label-6919
SELECT DISTINCT col2 / + col2 AS col1 FROM tab0 GROUP BY col2, col2, col0
----
1

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT 98 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
98

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6922
SELECT NULLIF ( + - ( + + CAST( NULL AS SIGNED ) ), + - 97 + + 19 * - 29 ) * col0 + AVG ( DISTINCT col0 ) * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-6922
SELECT NULLIF ( + - ( + + CAST ( NULL AS INTEGER ) ), + - 97 + + 19 * - 29 ) * col0 + AVG ( DISTINCT col0 ) * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6923
SELECT + CAST( col2 AS DECIMAL ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL = 38
----

skipif mysql # not compatible
query I rowsort label-6923
SELECT + CAST ( col2 AS REAL ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL = 38
----

query I rowsort
SELECT ALL col2 * col2 * + 51 AS col2 FROM tab0 GROUP BY col2 HAVING NOT col2 <> ( + - 77 )
----

query I rowsort
SELECT ALL col1 * - + col1 * + col1 + + 24 + - 47 FROM tab2 GROUP BY col1
----
-205402
-227004
-68944

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
22
28
82

query II rowsort
SELECT DISTINCT col0, 30 * - + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
26
-2370
43
-720
83
-1140

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6928
SELECT ALL - col2 FROM tab1 WHERE NOT - + ( - - 85 ) * CAST( - - ( - col0 ) AS SIGNED ) IS NULL GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6928
SELECT ALL - col2 FROM tab1 WHERE NOT - + ( - - 85 ) * CAST ( - - ( - col0 ) AS INTEGER ) IS NULL GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 87 FROM tab1 GROUP BY col2
----
87
87
87

query I rowsort
SELECT + ( - - col0 ) * + col0 FROM tab0 GROUP BY col0 HAVING ( - 66 ) IS NOT NULL
----
1849
676
6889

query I rowsort
SELECT DISTINCT 75 FROM tab2 GROUP BY col1
----
75

onlyif mysql # DIV for integer division: 
query I rowsort label-6932
SELECT DISTINCT - col2 DIV 56 col1 FROM tab1 GROUP BY col2, col1
----
-1
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6932
SELECT DISTINCT - col2 / 56 col1 FROM tab1 GROUP BY col2, col1
----
-1
0

query I rowsort
SELECT + 22 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 0 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6935
SELECT + - 91 * - ( CAST( + col1 AS SIGNED ) ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6935
SELECT + - 91 * - ( CAST ( + col1 AS INTEGER ) ) AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 17 FROM tab0 GROUP BY col0, col1 HAVING col0 * + col0 + + col1 BETWEEN col0 AND NULL
----

query I rowsort
SELECT + 25 AS col1 FROM tab1 WHERE + col0 IS NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT DISTINCT 35 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT 79 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6939
SELECT ALL + 39 DIV - 80 - + 3 FROM tab0 GROUP BY col0 HAVING ( col0 ) IS NOT NULL
----
-3
-3
-3

skipif mysql # not compatible
query I rowsort label-6939
SELECT ALL + 39 / - 80 - + 3 FROM tab0 GROUP BY col0 HAVING ( col0 ) IS NOT NULL
----
-3
-3
-3

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6940
SELECT DISTINCT CAST( col1 AS SIGNED ) + 5 FROM tab2 WHERE NULL >= NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-6940
SELECT DISTINCT CAST ( col1 AS INTEGER ) + 5 FROM tab2 WHERE NULL >= NULL GROUP BY col1
----

query I rowsort
SELECT + col0 + 70 AS col2 FROM tab2 GROUP BY col0 HAVING ( col0 / col0 ) IS NULL
----

query I rowsort
SELECT + 79 * col1 FROM tab2 GROUP BY col1
----
3239
4661
4819

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 17 col0 FROM tab1 AS cor0 GROUP BY col1
----
-17
-17
-17

query I rowsort
SELECT + + 11 * + col2 + - + col2 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
216
342
711

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + + + col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT 3 AS col2 FROM tab0 GROUP BY col0
----
3
3
3

query I rowsort
SELECT ( col2 ) * - col2 + - col2 + + + col2 * - col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-1176
-12561
-2926

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 - 93 FROM tab0 GROUP BY col2, col2
----
-14
-55
-69

query I rowsort
SELECT DISTINCT - col1 + + 17 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-27
-40
11

query I rowsort
SELECT 44 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6952
SELECT + + NULLIF ( + + col1, - CAST( NULL AS DECIMAL ) ) - + + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL <> + col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6952
SELECT + + NULLIF ( + + col1, - CAST ( NULL AS REAL ) ) - + + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL <> + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6953
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - + 57 * + ( - + col2 ) + + - 39 = NULL
----

skipif mysql # not compatible
query I rowsort label-6953
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - + 57 * + ( - + col2 ) + + - 39 = NULL
----

query I rowsort
SELECT DISTINCT - + 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-96

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * + col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT - 6 IS NULL
----
2025
5041
64

query I rowsort
SELECT ALL + - ( + 59 ) * - + col2 FROM tab1 cor0 GROUP BY col2, col2, col0
----
2655
4189
472

query I rowsort
SELECT DISTINCT + col1 + 86 + + 42 FROM tab1 GROUP BY col1, col0 HAVING NOT - ( - + 33 ) IS NULL
----
134
172
185

query I rowsort
SELECT ALL - 84 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-84
-84

query I rowsort
SELECT + + 29 FROM tab0 AS cor0 GROUP BY col2, col1
----
29
29
29

query I rowsort
SELECT ALL 43 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
43
43
43

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL > - 67
----

query II rowsort
SELECT DISTINCT col2 AS col2, col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
58
79
79
87
87

query I rowsort
SELECT 56 * - col0 FROM tab2 GROUP BY col0
----
-5096
-5152
-840

query I rowsort
SELECT - ( + col0 ) * + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND - - 67
----

query I rowsort
SELECT + 74 AS col0 FROM tab2 GROUP BY col2
----
74
74
74

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + col1 ) col1 FROM tab2 cor0 GROUP BY col1, col0 HAVING - col0 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6967
SELECT ALL + CAST( NULL AS SIGNED ) col1 FROM tab1 GROUP BY col2, col0 HAVING - col2 NOT BETWEEN NULL AND - + ( - col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6967
SELECT ALL + CAST ( NULL AS INTEGER ) col1 FROM tab1 GROUP BY col2, col0 HAVING - col2 NOT BETWEEN NULL AND - + ( - col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6968
SELECT + - CAST( + + AVG ( - col1 ) AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING - CAST( NULL AS SIGNED ) IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6968
SELECT + - CAST ( + + AVG ( - col1 ) AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING - CAST ( NULL AS INTEGER ) IS NULL
----
41
59
61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6969
SELECT DISTINCT 82 + - 43 FROM tab0 GROUP BY col2, col0 HAVING + CAST( NULL AS DECIMAL ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-6969
SELECT DISTINCT 82 + - 43 FROM tab0 GROUP BY col2, col0 HAVING + CAST ( NULL AS REAL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT 37 FROM tab2 GROUP BY col1
----
37

query I rowsort
SELECT ALL - 92 FROM tab1 AS cor0 GROUP BY col2
----
-92
-92
-92

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL 75 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT ( + col0 + col2 + AVG ( col1 ) * + AVG ( ALL col2 ) * + col0 IS NOT NULL )
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 WHERE NULL NOT IN ( col2 ) GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6975
SELECT DISTINCT + 5 + CAST( col2 AS SIGNED ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

skipif mysql # not compatible
query I rowsort label-6975
SELECT DISTINCT + 5 + CAST ( col2 AS INTEGER ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT DISTINCT - 42 AS col1, 77 FROM tab2 AS cor0 WHERE + 90 / - col1 <> 62 + - - col2 GROUP BY col0, col1
----
-42
77

query I rowsort
SELECT DISTINCT + 2 FROM tab0 AS cor0 GROUP BY col0
----
2

query I rowsort
SELECT 99 FROM tab2 GROUP BY col2, col1
----
99
99
99

query II rowsort
SELECT - col0 * + + col0 * - 5, col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
2420
22
33620
82
3920
28

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6980
SELECT ALL col1 FROM tab1 AS cor0 WHERE + col1 NOT IN ( 80, + col0 / CAST( NULL AS SIGNED ), + col2 / + + col2 + + + 43 + + 70 - - + ( - 71 ) * + + 8 + - col2, col1 / - col2, col1, + ( col0 ) ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-6980
SELECT ALL col1 FROM tab1 AS cor0 WHERE + col1 NOT IN ( 80, + col0 / CAST ( NULL AS INTEGER ), + col2 / + + col2 + + + 43 + + 70 - - + ( - 71 ) * + + 8 + - col2, col1 / - col2, col1, + ( col0 ) ) GROUP BY col1
----

query II rowsort
SELECT DISTINCT col1, - NULLIF ( + 8, + + 16 ) FROM tab0 AS cor0 GROUP BY col0, col1
----
0
-8
81
-8

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col0, col2, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query II rowsort label-6983
SELECT ALL col0 DIV + + col0 AS col2, 16 FROM tab2 cor0 GROUP BY col0
----
1
16
1
16
1
16

skipif mysql # not compatible
query II rowsort label-6983
SELECT ALL col0 / + + col0 AS col2, 16 FROM tab2 cor0 GROUP BY col0
----
1
16
1
16
1
16

query I rowsort
SELECT DISTINCT + 75 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
75

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT 87 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6986
SELECT ALL CAST( NULL AS SIGNED ) - - col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6986
SELECT ALL CAST ( NULL AS INTEGER ) - - col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6988
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT + - col2 >= - 71 * CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
query I rowsort label-6988
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT + - col2 >= - 71 * CAST ( NULL AS REAL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6989
SELECT 41 - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6989
SELECT 41 - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 GROUP BY col1, col2, col2 HAVING - AVG ( ALL + col0 ) > NULL
----

query I rowsort
SELECT ALL + + 66 FROM tab1 cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 + - 62 FROM tab1 AS cor0 GROUP BY col1
----
-18
-5
-56

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST( + col0 AS DECIMAL ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST ( + col0 AS REAL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6994
SELECT - ( - + 16 ) / + CAST( NULL AS SIGNED ) * + 20 FROM tab2 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-6994
SELECT - ( - + 16 ) / + CAST ( NULL AS INTEGER ) * + 20 FROM tab2 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col0 HAVING NOT 38 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 62 col2 FROM tab1 AS cor0 GROUP BY col1
----
-62

query I rowsort
SELECT + 79 AS col0 FROM tab1 WHERE NOT NULL = NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT col0 - 59 FROM tab0 AS cor0 GROUP BY col0
----
-16
-33
24

query I rowsort
SELECT col0 * - + AVG ( ALL col0 ) FROM tab0 GROUP BY col0, col2 HAVING col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col1 * + + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - 80 * + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING + + 53 < - col1
----

query I rowsort
SELECT - col0 * + + 91 * + - 93 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col0 + + col0 * + col0 FROM tab2 cor0 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT col0 + + + 2 AS col0 FROM tab1 GROUP BY col0
----
24
30
84

query I rowsort
SELECT - + 95 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-95
-95
-95

query I rowsort
SELECT + - col1 + col0 + 77 + + + ( col1 ) FROM tab2 AS cor0 GROUP BY col0, col1
----
168
169
92

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
15
91
92

query I rowsort
SELECT - 59 * + 60 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-322140
-325680
-53100

query I rowsort
SELECT DISTINCT - + 60 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-60

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7011
SELECT ALL CAST( NULL AS SIGNED ) * + col0 AS col2 FROM tab1 WHERE - col0 NOT IN ( + + NULLIF ( 2, + 45 ) ) GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7011
SELECT ALL CAST ( NULL AS INTEGER ) * + col0 AS col2 FROM tab1 WHERE - col0 NOT IN ( + + NULLIF ( 2, + 45 ) ) GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-7012
SELECT ALL col2 DIV col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
59
80
88

skipif mysql # not compatible
query I rowsort label-7012
SELECT ALL col2 / col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
59
80
88

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7013
SELECT - CAST( NULL AS DECIMAL ) * 67 * + - col0 AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7013
SELECT - CAST ( NULL AS REAL ) * 67 * + - col0 AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - ( + 21 ) * + - 48 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1008

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 45 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + ( col1 ) < ( NULL )
----

query I rowsort
SELECT ALL + - 94 + col1 + col1 * - ( + 16 ) FROM tab1 cor0 GROUP BY col1
----
-184
-754
-949

query I rowsort
SELECT + ( ( + 1 ) ) FROM tab2 AS cor0 GROUP BY col0, col1
----
1
1
1

query I rowsort
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7019
SELECT - col1 * CAST( NULL AS SIGNED ) FROM tab2 AS cor0 WHERE NOT + col2 + + col1 < NULL AND NOT - 99 < + col0 * + + CAST( col0 AS DECIMAL ) GROUP BY col1, col0 HAVING + 37 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7019
SELECT - col1 * CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 WHERE NOT + col2 + + col1 < NULL AND NOT - 99 < + col0 * + + CAST ( col0 AS REAL ) GROUP BY col1, col0 HAVING + 37 IS NULL
----

query II rowsort
SELECT - col2, 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 + col0 / col0 col2 FROM tab1 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col0
----

query II rowsort
SELECT col1 AS col0, 29 AS col1 FROM tab0 GROUP BY col1, col2
----
0
29
0
29
81
29

query I rowsort
SELECT DISTINCT - col0 - 9 AS col2 FROM tab0 GROUP BY col0, col0
----
-35
-52
-92

query I rowsort
SELECT ALL col2 + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN 49 AND NULL
----

query I rowsort
SELECT col2 + + 68 + 17 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
143
164
172

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7027
SELECT - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING col2 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7027
SELECT - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING col2 IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + - col2 + + AVG ( DISTINCT col1 ) >= col2
----
58
79
87

query I rowsort
SELECT DISTINCT - 93 + - 22 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-115

query I rowsort
SELECT DISTINCT + + COALESCE ( 51, + col0, - col0 ) + + 52 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7031
SELECT ( col2 ) AS col2 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND - CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
query I rowsort label-7031
SELECT ( col2 ) AS col2 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND - CAST ( NULL AS REAL )
----

query I rowsort
SELECT DISTINCT 89 - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL col1 AS col1, - 64 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + col1 + + col1 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7034
SELECT 50 FROM tab1 cor0 WHERE ( + CAST( col2 AS SIGNED ) * - - col1 + col0 ) IS NULL GROUP BY col2, col1
----

skipif mysql # not compatible
query I rowsort label-7034
SELECT 50 FROM tab1 cor0 WHERE ( + CAST ( col2 AS INTEGER ) * - - col1 + col0 ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - + 85 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <> + 12 * 19
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING ( - - col1 * - col0 ) > + col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7038
SELECT 94 DIV - col1 FROM tab2 GROUP BY col0, col1
----
-1
-1
-2

skipif mysql # not compatible
query I rowsort label-7038
SELECT 94 / - col1 FROM tab2 GROUP BY col0, col1
----
-1
-1
-2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7039
SELECT DISTINCT col0 * CAST( NULL AS SIGNED ) * col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-7039
SELECT DISTINCT col0 * CAST ( NULL AS INTEGER ) * col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
NULL

query I rowsort
SELECT ALL col0 + col0 FROM tab1 WHERE NULL > ( - col1 ) GROUP BY col0 HAVING NOT 95 <= NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( + 37 ) IS NOT NULL
----

query I rowsort
SELECT - 78 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT + ( - ( col0 ) ) FROM tab1 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN col0 AND - col0
----

query I rowsort
SELECT + + col0 * - col0 + + 38 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-4823
-4968
345

query I rowsort
SELECT - 45 + 95 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IN ( 23 )
----

query I rowsort
SELECT col2 * - + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1944
0
0

query I rowsort
SELECT DISTINCT - - ( + col0 ) FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - 85 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * - col2 col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) > 93
----

query I rowsort
SELECT DISTINCT + 53 FROM tab2 cor0 GROUP BY col1, col2, col0
----
53

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING ( ( col1 ) IS NOT NULL )
----
0
81

query I rowsort
SELECT - col1 * - 71 AS col2 FROM tab1 GROUP BY col1, col2, col0 HAVING NOT ( - ( col1 ) ) = + col2 * + col1
----
3124
4047
426

query II rowsort
SELECT DISTINCT 17 * - - col1, + col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING + 48 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7054
SELECT col0 DIV 56 FROM tab1 GROUP BY col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-7054
SELECT col0 / 56 FROM tab1 GROUP BY col0
----
0
0
1

query I rowsort
SELECT DISTINCT 74 AS col2 FROM tab0 GROUP BY col0, col0
----
74

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query II rowsort
SELECT - 21, col1 * + col1 AS col1 FROM tab2 GROUP BY col1
----
-21
1681
-21
3481
-21
3721

query II rowsort
SELECT DISTINCT - 6 * - col1 * + + col1, - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
11616
-44
19494
-57
216
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7059
SELECT ALL + - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7059
SELECT ALL + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 WHERE NOT ( - col2 + - ( + + col1 ) + + col0 + 31 * - ( + col0 ) ) BETWEEN NULL AND 52 GROUP BY col2 HAVING NULL <= - 87 * - col0 + - 59
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7061
SELECT DISTINCT + - CAST( NULL AS SIGNED ) * - - col0 FROM tab0 cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-7061
SELECT DISTINCT + - CAST ( NULL AS INTEGER ) * - - col0 FROM tab0 cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT + 85 FROM tab1 GROUP BY col2, col1
----
85

query I rowsort
SELECT ALL + + col2 * 72 + + 30 FROM tab2 AS cor0 GROUP BY col0, col2
----
4206
5718
6294

query I rowsort
SELECT 72 + col0 - + 74 AS col1 FROM tab0 GROUP BY col0
----
24
41
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7065
SELECT + CAST( NULL AS SIGNED ) * + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7065
SELECT + CAST ( NULL AS INTEGER ) * + col1 FROM tab1 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 * + 17 - - col0 FROM tab1 GROUP BY col0
----
1476
396
504

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL col1 * - col1 + - col1 FROM tab1 GROUP BY col1
----
-1980
-3306
-42

query I rowsort
SELECT - col2 / col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 51 FROM tab2 GROUP BY col2
----
51
51
51

query I rowsort
SELECT ALL 91 * - col1 + col1 * col1 FROM tab2 GROUP BY col2, col1 HAVING NOT 98 IS NULL
----
-1830
-1888
-2050

query I rowsort
SELECT 20 AS col1 FROM tab0 GROUP BY col0
----
20
20
20

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 62 col2 FROM tab0 GROUP BY col0
----
62
62
62

query I rowsort
SELECT col1 * + col1 FROM tab2 WHERE NOT col0 + - 34 NOT BETWEEN col2 * 61 AND ( NULL ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 * + 2 AS col2 FROM tab2 WHERE NOT col1 * col1 >= ( NULL ) GROUP BY col2 HAVING - 67 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7076
SELECT 81 * + col2 AS col0 FROM tab0 AS cor0 WHERE col0 <> - CAST( NULL AS SIGNED ) + + 37 GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-7076
SELECT 81 * + col2 AS col0 FROM tab0 AS cor0 WHERE col0 <> - CAST ( NULL AS INTEGER ) + + 37 GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT 52 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
52

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7078
SELECT ALL + CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7078
SELECT ALL + CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT ( col0 ) IS NOT NULL
----

query I rowsort
SELECT 56 FROM tab1 GROUP BY col1
----
56
56
56

query I rowsort
SELECT - col2 * - ( + 64 ) FROM tab0 GROUP BY col2, col2
----
1536
2432
5056

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 + + col1 * - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1640
-3422
-3660

query I rowsort
SELECT DISTINCT - 78 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-78

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL ( - - col2 ), + 93 col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
93
71
93
8
93

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST( NULL AS SIGNED ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7087
SELECT + col0 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7087
SELECT + col0 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + ( - col1 ) FROM tab0 AS cor0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7089
SELECT DISTINCT CAST( NULL AS SIGNED ) * + col2 * - 21 AS col0 FROM tab2 GROUP BY col1, col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7089
SELECT DISTINCT CAST ( NULL AS INTEGER ) * + col2 * - 21 AS col0 FROM tab2 GROUP BY col1, col2
----
NULL

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 80 FROM tab0 AS cor0 GROUP BY col0, col2
----
80
80
80

query I rowsort
SELECT DISTINCT - 8 FROM tab0 AS cor0 GROUP BY col2
----
-8

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT - 28 AS col1 FROM tab1 AS cor0 WHERE col1 * - + ( CASE + + col1 WHEN + NULLIF ( - 83, - - col0 ) THEN - + col2 END ) NOT BETWEEN + + col0 AND NULL GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * - ( + - 33 ) col2 FROM tab0 GROUP BY col2, col0
----
1419
2739
858

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2 HAVING 58 <> NULL
----

query I rowsort
SELECT ALL 67 - 43 FROM tab2 GROUP BY col0, col1
----
24
24
24

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - - ( + + 4 ) + 66 FROM tab0 AS cor0 GROUP BY col0, col1
----
70

query I rowsort
SELECT NULLIF ( + 46, 88 ) * - - ( - - col1 ) + - 16 FROM tab1 GROUP BY col2, col1
----
2008
260
2606

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7103
SELECT + + col2 * - CAST( NULL AS SIGNED ) * + COALESCE ( - + 83, col2 ) * - ( + AVG ( - - ( - col1 ) ) ) * + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7103
SELECT + + col2 * - CAST ( NULL AS INTEGER ) * + COALESCE ( - + 83, col2 ) * - ( + AVG ( - - ( - col1 ) ) ) * + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT + col0 + + ( - 21 ) + - - col0 * - col0 * + - AVG ( + - col0 ) * 56 + col0 * + - col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING - col0 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7106
SELECT DISTINCT ( 22 ) DIV - col2 + + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-7106
SELECT DISTINCT ( 22 ) / - col2 + + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7107
SELECT ( + CASE CAST( NULL AS SIGNED ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7107
SELECT ( + CASE CAST ( NULL AS INTEGER ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 54 AS col2 FROM tab2 GROUP BY col0, col1
----
-54
-54
-54

query I rowsort
SELECT + col2 + - 78 * - - col2 * + 26 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-143917
-16216
-91215

query I rowsort
SELECT + col0 + + + col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - col1 + + col1 AS col1 FROM tab0 GROUP BY col1, col1, col2
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-7112
SELECT DISTINCT CAST( NULL AS SIGNED ), + ( - - col0 ) AS col0, + col0 FROM tab2 GROUP BY col0, col2
----
9 values hashing to 51028b699a140352807f85f8a6f4a571

skipif mysql # not compatible
query III rowsort label-7112
SELECT DISTINCT CAST ( NULL AS INTEGER ), + ( - - col0 ) AS col0, + col0 FROM tab2 GROUP BY col0, col2
----
9 values hashing to 51028b699a140352807f85f8a6f4a571

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7113
SELECT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7113
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7114
SELECT - col1 * CAST( + + 62 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1
----
-5022
0

skipif mysql # not compatible
query I rowsort label-7114
SELECT - col1 * CAST ( + + 62 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1
----
-5022
0

query I rowsort
SELECT + 95 FROM tab1 GROUP BY col0
----
95
95
95

query I rowsort
SELECT DISTINCT + ( + 35 ) FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7117
SELECT - ( CAST( - + 54 AS SIGNED ) ) FROM tab1 cor0 GROUP BY col0, col1, col2 HAVING - col2 IS NOT NULL
----
54
54
54

skipif mysql # not compatible
query I rowsort label-7117
SELECT - ( CAST ( - + 54 AS INTEGER ) ) FROM tab1 cor0 GROUP BY col0, col1, col2 HAVING - col2 IS NOT NULL
----
54
54
54

query I rowsort
SELECT col2 * 58 AS col1 FROM tab0 GROUP BY col2, col2 HAVING - col2 IS NOT NULL
----
1392
2204
4582

query II rowsort
SELECT ALL - - col0 AS col0, + ( col0 ) + - ( - 43 ) * + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
26
1144
43
1892
83
3652

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <= ( 18 )
----

query I rowsort
SELECT ( - + col2 ) * - 63 * - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-127575
-317583
-4032

query I rowsort
SELECT ALL 37 - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-21
-42
-50

query I rowsort
SELECT DISTINCT - ( - + col0 ) AS col0 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + 36 - - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
117
36

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 cor0 GROUP BY col1 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT col1 + - col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
-1640
-3422
-3660

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - + 87 FROM tab2 cor0 GROUP BY col0
----
-87
-87
-87

query I rowsort
SELECT ALL + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query II rowsort
SELECT col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL col2 * col2 * col2 AS col0 FROM tab0 cor0 WHERE 66 + col1 IS NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7133
SELECT col1 * + + ( + CAST( - - CAST( - + 73 AS SIGNED ) AS SIGNED ) ) col0 FROM tab0 GROUP BY col1, col1, col1
----
-5913
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7133
SELECT col1 * + + ( + CAST ( - - CAST ( - + 73 AS INTEGER ) AS INTEGER ) ) col0 FROM tab0 GROUP BY col1, col1, col1
----
-5913
0

query I rowsort
SELECT ALL + + col0 FROM tab0 AS cor0 WHERE NULL IN ( col1, col2 / 34 ) GROUP BY col0, col0
----

query I rowsort
SELECT ALL 65 FROM tab0 GROUP BY col2
----
65
65
65

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7136
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) > CAST( NULL AS SIGNED ) + 16
----

skipif mysql # not compatible
query I rowsort label-7136
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) > CAST ( NULL AS INTEGER ) + 16
----

query I rowsort
SELECT - 66 FROM tab1 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL 61 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 22 FROM tab1 GROUP BY col0
----
22

query I rowsort
SELECT ALL 30 FROM tab0 GROUP BY col2
----
30
30
30

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7141
SELECT CAST( 54 AS SIGNED ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT + 46 BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7141
SELECT CAST ( 54 AS INTEGER ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT + 46 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 AS cor0 WHERE + col2 <= + col2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + 97 * - + 53 + - 29 FROM tab2 AS cor0 GROUP BY col1, col1
----
-5170
-5170
-5170

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7144
SELECT ALL col2 * + CAST( NULL AS SIGNED ) / - col0 + + col0 + - col2 + - + col0 FROM tab0 WHERE + - CAST( col2 AS DECIMAL ) IS NULL GROUP BY col0, col2 HAVING NOT - col0 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7144
SELECT ALL col2 * + CAST ( NULL AS INTEGER ) / - col0 + + col0 + - col2 + - + col0 FROM tab0 WHERE + - CAST ( col2 AS REAL ) IS NULL GROUP BY col0, col2 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT ALL col0 + - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND + AVG ( 66 ) * + col0
----

query I rowsort
SELECT col2 - + col2 * - col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
1482
600
6320

query I rowsort
SELECT - col1 + - col1 * - col1 FROM tab1 WHERE NOT NULL IN ( - col1 ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7148
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7148
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + 12 - col1 * - col1 AS col1 FROM tab1 GROUP BY col1, col2
----
1948
3261
48

query I rowsort
SELECT col0 + + col0 FROM tab2 GROUP BY col1, col0 HAVING NOT ( AVG ( ALL - col0 ) ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab2 GROUP BY col1 HAVING ( - 49 ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col0 HAVING NOT AVG ( DISTINCT 33 ) >= ( NULL )
----

query I rowsort
SELECT + 42 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 WHERE - 82 + + col0 * ( - col2 ) IS NULL GROUP BY col1
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 WHERE NOT col2 BETWEEN + col0 AND + 41 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING + 98 IS NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + CASE - col1 WHEN - 75 THEN + 32 * 19 END IS NULL
----

query I rowsort
SELECT ALL - ( - col1 ) - + AVG ( ALL + 46 - - 84 ) AS col2 FROM tab0 WHERE NOT ( NULL ) <= ( - col0 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT col2 + - - col2 * + 99 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
5800
7900
8700

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2, col0 HAVING NOT - 37 / col2 <= - AVG ( ALL - ( col1 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7162
SELECT - CAST( NULL AS SIGNED ) * + col2 * - 95 AS col0 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7162
SELECT - CAST ( NULL AS INTEGER ) * + col2 * - 95 AS col0 FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT 82 * - col0 FROM tab1 GROUP BY col0, col0, col2
----
-1804
-2296
-6724

query I rowsort
SELECT 17 + - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING col1 / - col2 + - 43 IS NULL
----

query I rowsort
SELECT + + col0 + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
164
44
56

query I rowsort
SELECT ALL + 90 * - 93 * + + col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + col2 * - col2 + + col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
-1935
-48
-4899

query I rowsort
SELECT DISTINCT col0 * + 84 + - + 97 AS col2 FROM tab1 GROUP BY col0
----
1751
2255
6791

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7169
SELECT CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2, col1 HAVING + CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7169
SELECT CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2, col1 HAVING + CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 + + 83 * - col1 AS col1 FROM tab2 GROUP BY col1
----
-3362
-4838
-5002

query I rowsort
SELECT ALL + - ( + NULLIF ( col2, - col2 ) ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT ALL 92 AS col1 FROM tab1 GROUP BY col0
----
92
92
92

query I rowsort
SELECT ALL - ( - col1 ) * + col1 * col1 FROM tab1 GROUP BY col1
----
185193
216
85184

query I rowsort
SELECT DISTINCT - ( + col1 ) AS col2 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + - ( + col2 ) + 24 - + - ( ( - + col2 ) ) * + - 28 FROM tab2 AS cor0 GROUP BY col2
----
1590
2157
2373

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7178
SELECT DISTINCT col1 + - col1 * + - 98 + - CAST( + col1 AS SIGNED ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT col1 * 0 IS NULL
----
4018
5782
5978

skipif mysql # not compatible
query I rowsort label-7178
SELECT DISTINCT col1 + - col1 * + - 98 + - CAST ( + col1 AS INTEGER ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT col1 * 0 IS NULL
----
4018
5782
5978

query I rowsort
SELECT ALL col2 * col2 FROM tab0 WHERE + col0 + + col2 + col1 * - - col0 * + + 91 / - ( - col2 ) <= ( + - col1 ) GROUP BY col2
----

query I rowsort
SELECT 78 FROM tab1 GROUP BY col0, col0, col2
----
78
78
78

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * + col0 col0 FROM tab1 AS cor0 WHERE NOT - COALESCE ( + 96, - col2 ) IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT - col1 AS col0, col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT - col1 * - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING 99 IS NULL
----

query I rowsort
SELECT 90 FROM tab1 AS cor0 GROUP BY col2 HAVING + 54 = NULL
----

query I rowsort
SELECT DISTINCT + 46 AS col2 FROM tab2 GROUP BY col0, col1
----
46

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1 HAVING NOT - 25 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 90 FROM tab1 AS cor0 GROUP BY col1
----
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( + col0 ) col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT - 36 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING + ( 1 ) IS NOT NULL
----
-36
-36
-36

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7191
SELECT + - col2 + + CAST( NULL AS DECIMAL ) + + col2 col0 FROM tab1 AS cor0 WHERE - 61 + - - col0 IS NULL GROUP BY col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7191
SELECT + - col2 + + CAST ( NULL AS REAL ) + + col2 col0 FROM tab1 AS cor0 WHERE - 61 + - - col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT 44 AS col2 FROM tab0 AS cor0 WHERE NOT + ( + 63 ) >= NULL GROUP BY col0 HAVING NOT - col0 IS NULL AND NULL IS NOT NULL
----

query II rowsort
SELECT col2 AS col2, - 31 FROM tab1 cor0 GROUP BY col2 HAVING NULL BETWEEN col2 AND col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-7195
SELECT DISTINCT - col0 DIV - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-7195
SELECT DISTINCT - col0 / - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
1

query I rowsort
SELECT + col1 * - - 11 + + 73 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
139
557
700

query I rowsort
SELECT ( + + col0 ) + - - 60 FROM tab1 GROUP BY col2, col0, col2 HAVING ( 36 + + col0 IS NULL )
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col0, col1
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7199
SELECT ALL - col2 + - AVG ( 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-7199
SELECT ALL - col2 + - AVG ( CAST ( NULL AS INTEGER ) ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 72 * - + col2 * ( 84 ) * + col2 AS col1 FROM tab2 GROUP BY col2
----
20345472
37745568
45777312

query I rowsort
SELECT - col1 FROM tab0 WHERE NOT col0 IS NULL GROUP BY col1, col0 HAVING NOT - - 40 IS NULL
----
-81
0
0

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2 HAVING - 64 IS NULL
----

query I rowsort
SELECT - col1 + - - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - ( + + col2 ) AS col0 FROM tab1 GROUP BY col2, col2 HAVING + - 22 IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 + + col0 FROM tab2 GROUP BY col0, col1
----
133
150
76

onlyif mysql # DIV for integer division: 
query I rowsort label-7206
SELECT DISTINCT + col0 DIV - - ( + - col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-7206
SELECT DISTINCT + col0 / - - ( + - col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-7207
SELECT ALL + col2 * + col2 + + 64 + + col2 + + - col2 DIV + - 59 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3486
6385
7721

skipif mysql # not compatible
query I rowsort label-7207
SELECT ALL + col2 * + col2 + + 64 + + col2 + + - col2 / + - 59 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3486
6385
7721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2 * + + 95 AS col0, + col2 + ( + col2 ) col1 FROM tab2 GROUP BY col2, col2
----
-5510
116
-7505
158
-8265
174

query II rowsort
SELECT 91 + - col0, + col0 FROM tab0 GROUP BY col0
----
48
43
65
26
8
83

query I rowsort
SELECT DISTINCT - col0 + + col1 + ( col1 ) FROM tab1 GROUP BY col0, col1
----
-10
6
86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7211
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7211
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT 28 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
28
28
28

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7213
SELECT + CAST( NULL AS SIGNED ) * col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT - + 84 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7213
SELECT + CAST ( NULL AS INTEGER ) * col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT - + 84 IS NOT NULL
----

query II rowsort
SELECT col1 + 78, + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - 14 IS NOT NULL
----
122
71
135
45
84
8

query I rowsort
SELECT 43 FROM tab0 GROUP BY col0
----
43
43
43

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7216
SELECT ALL CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2 HAVING ( - 70 IS NOT NULL )
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7216
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2 HAVING ( - 70 IS NOT NULL )
----
NULL
NULL
NULL

query I rowsort
SELECT - 64 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-64
-64
-64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + col1 * - 46 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-7219
SELECT DISTINCT - col1 AS col2, col1 DIV - - col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
1
-57
1
-6
1

skipif mysql # not compatible
query II rowsort label-7219
SELECT DISTINCT - col1 AS col2, col1 / - - col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
1
-57
1
-6
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7221
SELECT + - col2 * col2 * + col2 * - CAST( col2 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
11316496
38950081
57289761

skipif mysql # not compatible
query I rowsort label-7221
SELECT + - col2 * col2 * + col2 * - CAST ( col2 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
11316496
38950081
57289761

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 27 col2 FROM tab0 GROUP BY col0, col0
----
27
27
27

query II rowsort
SELECT - 58, col2 FROM tab1 GROUP BY col2, col2
----
-58
45
-58
71
-58
8

onlyif mysql # DIV for integer division: 
query I rowsort label-7225
SELECT 49 - + col1 DIV 74 DIV + - col1 * - col1 FROM tab2 GROUP BY col1, col1
----
49
49
49

skipif mysql # not compatible
query I rowsort label-7225
SELECT 49 - + col1 / 74 / + - col1 * - col1 FROM tab2 GROUP BY col1, col1
----
49
49
49

query I rowsort
SELECT - 89 AS col2 FROM tab1 GROUP BY col0
----
-89
-89
-89

query I rowsort
SELECT ALL 97 FROM tab2 GROUP BY col0, col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
97
97
97

query I rowsort
SELECT - col1 + 11 FROM tab0 GROUP BY col1, col1
----
-70
11

query I rowsort
SELECT ALL 82 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NULL
----
82
82
82

query II rowsort
SELECT + col0 AS col1, - 18 * + - col0 AS col2 FROM tab0 GROUP BY col0
----
26
468
43
774
83
1494

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 11 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab1 GROUP BY col1, col2 HAVING NOT - CASE col1 WHEN + 43 THEN + AVG ( - col2 ) ELSE NULL END > NULL
----

query I rowsort
SELECT + + col2 + - 11 FROM tab0 cor0 GROUP BY col2, col1, col0
----
13
27
68

query I rowsort
SELECT DISTINCT 11 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7235
SELECT col1 + - 0 * - + col1 + col1 FROM tab1 AS cor0 WHERE col2 * - - col1 IN ( - CAST( NULL AS SIGNED ) ) GROUP BY col1 HAVING NULL <> NULL
----

skipif mysql # not compatible
query I rowsort label-7235
SELECT col1 + - 0 * - + col1 + col1 FROM tab1 AS cor0 WHERE col2 * - - col1 IN ( - CAST ( NULL AS INTEGER ) ) GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - 80 FROM tab2 GROUP BY col0, col2 HAVING NOT - 24 = NULL
----

query I rowsort
SELECT DISTINCT 36 FROM tab0 GROUP BY col0, col2
----
36

query I rowsort
SELECT + CASE col2 WHEN - ( 57 ) THEN - 4 ELSE NULL END FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT 32 AS col0, 7 AS col2 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col2 - - - 66 + - + col2 AS col0 FROM tab0 AS cor0 WHERE col2 IS NOT NULL GROUP BY col2, col2
----
-66

query I rowsort
SELECT NULLIF ( - - col0, - + col0 ) * - - col0 * + ( col0 ) + + 72 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
17648
571859
79579

query I rowsort
SELECT + + 5 FROM tab2 AS cor0 GROUP BY col2
----
5
5
5

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) >= 88
----

query I rowsort
SELECT 63 + - + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
2
22
4

query I rowsort
SELECT + + ( - col2 ) * col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT - 73 - - col0 * + AVG ( col0 ) * + 6 AS col2 FROM tab1 GROUP BY col0 HAVING ( NOT ( - - 72 ) + + col0 + + 40 <> NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7247
SELECT ALL + col0 + + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7247
SELECT ALL + col0 + + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 27 col1 FROM tab2 AS cor0 GROUP BY col2
----
27
27
27

query I rowsort
SELECT 86 AS col2 FROM tab0 GROUP BY col0
----
86
86
86

query I rowsort
SELECT ALL + ( - + 57 ) FROM tab1 WHERE NULL IN ( 31, - 94, + col2 + + col2 ) GROUP BY col1, col0
----

query II rowsort
SELECT DISTINCT 18 * + col0 AS col1, col0 * - col0 AS col0 FROM tab2 GROUP BY col0, col1
----
1638
-8281
1656
-8464
270
-225

query II rowsort
SELECT ALL + - col0, - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7254
SELECT DISTINCT + col0 * + - CAST( NULL AS SIGNED ) + + 24 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-7254
SELECT DISTINCT + col0 * + - CAST ( NULL AS INTEGER ) + + 24 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
NULL

query I rowsort
SELECT ALL - ( - col0 ) + - + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + 85 FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

query I rowsort
SELECT - + ( + col0 ) FROM tab2 cor0 GROUP BY col0, col0, col1, col0 HAVING AVG ( DISTINCT - 30 ) IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + + 1 FROM tab1 AS cor0 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE + 91 / col2 IS NULL GROUP BY col2 HAVING 68 >= ( + col2 )
----

query I rowsort
SELECT + - 58 * - + 77 FROM tab1 AS cor0 GROUP BY col2
----
4466
4466
4466

query I rowsort
SELECT + 17 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
17
17
17

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7263
SELECT - 11 - + col0 AS col2 FROM tab2 AS cor0 WHERE - col0 * + col2 * + 12 * col1 NOT IN ( 96 * + CAST( NULL AS DECIMAL ) ) GROUP BY col0, col0 HAVING NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-7263
SELECT - 11 - + col0 AS col2 FROM tab2 AS cor0 WHERE - col0 * + col2 * + 12 * col1 NOT IN ( 96 * + CAST ( NULL AS REAL ) ) GROUP BY col0, col0 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT - + 98 FROM tab2 AS cor0 GROUP BY col0
----
-98

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7266
SELECT + 76 + - ( + CAST( NULL AS SIGNED ) ) AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7266
SELECT + 76 + - ( + CAST ( NULL AS INTEGER ) ) AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7267
SELECT + AVG ( - - CAST( NULL AS SIGNED ) ) + 53 FROM tab1 GROUP BY col0, col1 HAVING NOT 15 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7267
SELECT + AVG ( - - CAST ( NULL AS INTEGER ) ) + 53 FROM tab1 GROUP BY col0, col1 HAVING NOT 15 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 65 col1 FROM tab2 GROUP BY col2, col2
----
65
65
65

query I rowsort
SELECT - col1 * + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
-1681
-3481
-3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING 94 + 80 IS NOT NULL
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7271
SELECT 18 AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT IN ( + col0 * CAST( NULL AS SIGNED ) + 7 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-7271
SELECT 18 AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT IN ( + col0 * CAST ( NULL AS INTEGER ) + 7 ) GROUP BY col2
----

query I rowsort
SELECT 12 * ( 66 ) FROM tab0 GROUP BY col0
----
792
792
792

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7273
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING + CAST( NULL AS SIGNED ) + + 31 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7273
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING + CAST ( NULL AS INTEGER ) + + 31 IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-7274
SELECT DISTINCT + col2 AS col0, - CAST( COALESCE ( - 7, 62 ) AS DECIMAL ) FROM tab1 GROUP BY col2 HAVING ( + 40 ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-7274
SELECT DISTINCT + col2 AS col0, - CAST ( COALESCE ( - 7, 62 ) AS REAL ) FROM tab1 GROUP BY col2 HAVING ( + 40 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7275
SELECT + col2 DIV 52 FROM tab0 GROUP BY col2
----
0
0
1

skipif mysql # not compatible
query I rowsort label-7275
SELECT + col2 / 52 FROM tab0 GROUP BY col2
----
0
0
1

query I rowsort
SELECT 21 AS col0 FROM tab1 WHERE ( NOT - col1 IS NOT NULL ) GROUP BY col0, col2 HAVING NOT - col2 - col0 IS NULL
----

query I rowsort
SELECT + COALESCE ( - 37, - col2, + + CASE + 36 WHEN - 61 THEN col2 ELSE NULL END ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING CASE WHEN NOT ( NULL ) IS NULL THEN - ( 10 ) END IS NULL
----
-37
-37
-37

query I rowsort
SELECT ALL + col2 + + 37 FROM tab0 AS cor0 GROUP BY col2, col2
----
116
61
75

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col2 AS col1, col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( col1 ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT 90 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
41
59
61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7282
SELECT 13 FROM tab1 WHERE NOT NULLIF ( + + 61, + + CAST( NULL AS DECIMAL ) ) IS NOT NULL GROUP BY col2, col2
----

skipif mysql # not compatible
query I rowsort label-7282
SELECT 13 FROM tab1 WHERE NOT NULLIF ( + + 61, + + CAST ( NULL AS REAL ) ) IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT - col2 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 62 IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col1 HAVING NOT col1 * 80 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 38 AS col1 FROM tab0 WHERE 50 IS NULL GROUP BY col1
----

query I rowsort
SELECT + NULLIF ( - + 76, - col0 * - 29 ) + 24 AS col1 FROM tab2 GROUP BY col0
----
-52
-52
-52

query I rowsort
SELECT ALL - 12 FROM tab2 GROUP BY col0
----
-12
-12
-12

query I rowsort
SELECT 14 FROM tab0 GROUP BY col2 HAVING NULL >= - - 42
----

query I rowsort
SELECT 92 - - - col2 AS col1 FROM tab0 GROUP BY col2
----
13
54
68

query I rowsort
SELECT ALL + col1 + + + 17 AS col0 FROM tab1 GROUP BY col1
----
23
61
74

query I rowsort
SELECT ALL col0 * - NULLIF ( 32, - col1 ) - - + ( col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-2821
-2852
-465

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7292
SELECT - CAST( NULL AS SIGNED ) / + col0 + + 97 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + + 3 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7292
SELECT - CAST ( NULL AS INTEGER ) / + col0 + + 97 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + + 3 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 74 * col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1924
3182
6142

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-7294
SELECT 27 * - 64 + CAST( NULL AS DECIMAL ) + - 98, col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
NULL
0
NULL
0
NULL
0

skipif mysql # not compatible
query II rowsort label-7294
SELECT 27 * - 64 + CAST ( NULL AS REAL ) + - 98, col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
NULL
0
NULL
0
NULL
0

query II rowsort
SELECT + 32 AS col2, col2 + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT 55 IS NOT NULL
----

query I rowsort
SELECT - + col1 * + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-6561
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-7297
SELECT ALL - - col0 DIV + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7297
SELECT ALL - - col0 / + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT + ( - - col0 ) FROM tab2 GROUP BY col0 HAVING NOT - + 8 * - + 41 / + + 11 IS NOT NULL
----

query I rowsort
SELECT + 60 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
2460
3540
3660

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7301
SELECT - + CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + 74 IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7301
SELECT - + CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + 74 IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING - - ( col1 ) / - ( 98 ) - + + col1 IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 WHERE NOT ( NOT col1 = + + col1 ) GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * - + col1 FROM tab0 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - 85 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 18 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - 53 col0 FROM tab0 AS cor0 GROUP BY col1
----
-53

query II rowsort
SELECT - ( + col2 ) AS col1, col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7313
SELECT ALL col0 AS col0, + CAST( - col0 AS SIGNED ) + - 72 FROM tab1 GROUP BY col0
----
22
-94
28
-100
82
-154

skipif mysql # not compatible
query II rowsort label-7313
SELECT ALL col0 AS col0, + CAST ( - col0 AS INTEGER ) + - 72 FROM tab1 GROUP BY col0
----
22
-94
28
-100
82
-154

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7314
SELECT ALL CAST( AVG ( ALL + + 10 ) AS SIGNED ) FROM tab0 GROUP BY col2 HAVING NOT ( + - 63 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7314
SELECT ALL CAST ( AVG ( ALL + + 10 ) AS INTEGER ) FROM tab0 GROUP BY col2 HAVING NOT ( + - 63 ) IS NOT NULL
----

query I rowsort
SELECT ( ( - col1 ) ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - ( + col0 ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL 7 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
7
7
7

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( col1, + + 68, ( + col2 ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7320
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7320
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2
----
NULL

query I rowsort
SELECT DISTINCT - ( 83 ) AS col2 FROM tab1 GROUP BY col0, col2
----
-83

query I rowsort
SELECT DISTINCT ( + col0 ) - + 74 FROM tab0 GROUP BY col0, col0
----
-31
-48
9

query I rowsort
SELECT ALL - col0 * col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + col0 <= + 51
----
-3608

query I rowsort
SELECT + - col0 AS col2 FROM tab1 WHERE NOT - col0 <> NULL GROUP BY col0 HAVING NOT + ( - - col0 ) NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7325
SELECT col0 - + - 5 + - - col0 DIV + - 65 AS col2 FROM tab1 GROUP BY col0
----
27
33
86

skipif mysql # not compatible
query I rowsort label-7325
SELECT col0 - + - 5 + - - col0 / + - 65 AS col2 FROM tab1 GROUP BY col0
----
27
33
86

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT 48 FROM tab1 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND col0
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
44
57
6

query II rowsort
SELECT col2, col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
43
38
83
79
26

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-7332
SELECT DISTINCT - 36 DIV - 19 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
27
44
84

skipif mysql # not compatible
query I rowsort label-7332
SELECT DISTINCT - 36 / - 19 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
27
44
84

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN - col2 AND ( - 5 )
----

query I rowsort
SELECT DISTINCT + col0 + - 10 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
16
33
73

query II rowsort
SELECT DISTINCT 87 * + 2, - ( + col2 ) FROM tab2 cor0 WHERE NOT ( - col2 ) NOT BETWEEN + 63 * + COALESCE ( 87, - col2 ) - col1 AND ( NULL ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 + + + col2 * + col2 AS col1 FROM tab1 WHERE ( NOT NULL < NULL ) GROUP BY col2, col2
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7338
SELECT ALL CAST( NULL AS DECIMAL ) + - + col2 * - - col2 FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7338
SELECT ALL CAST ( NULL AS REAL ) + - + col2 * - - col2 FROM tab2 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT + + col2 * 26 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
2054
624
988

query I rowsort
SELECT + 14 + - + col0 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT ( + col0 ) >= NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - + col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING col2 <> NULL
----

query I rowsort
SELECT + 7 AS col2 FROM tab0 GROUP BY col1, col0
----
7
7
7

query I rowsort
SELECT ALL - 22 FROM tab1 GROUP BY col1, col2
----
-22
-22
-22

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7345
SELECT + CAST( - col0 AS SIGNED ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-7345
SELECT + CAST ( - col0 AS INTEGER ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query II rowsort
SELECT col1, 13 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT 32 NOT BETWEEN - col1 AND NULL
----

query I rowsort
SELECT - col0 * - - 24 FROM tab0 GROUP BY col0, col1 HAVING NOT col1 * - col0 * - + col0 IS NULL
----
-1032
-1992
-624

query I rowsort
SELECT - + col1 / col1 * - 28 + - ( + ( - col1 ) ) + + 42 + - col1 AS col2 FROM tab0 AS cor0 WHERE NOT + 74 IS NOT NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + 87 col0 FROM tab2 AS cor0 GROUP BY col2
----
-87
-87
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7351
SELECT + CAST( + 70 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1
----
70
70

skipif mysql # not compatible
query I rowsort label-7351
SELECT + CAST ( + 70 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1
----
70
70

query I rowsort
SELECT - col2 FROM tab0 cor0 WHERE - col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + - 34 * - ( + - col0 ) + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-3185
-3220
-525

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-7355
SELECT DISTINCT + col1 DIV + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-7355
SELECT DISTINCT + col1 / + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1

query I rowsort
SELECT DISTINCT - col1 * 64 * + + col1 FROM tab0 GROUP BY col1
----
-419904
0

query II rowsort
SELECT DISTINCT col0 AS col0, + ( - 92 ) FROM tab1 cor0 GROUP BY col0 HAVING NOT 32 IS NULL
----
22
-92
28
-92
82
-92

query I rowsort
SELECT 15 - + col0 * col0 AS col0 FROM tab1 GROUP BY col0
----
-469
-6709
-769

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1 HAVING - - col1 BETWEEN - 17 AND NULL
----

query I rowsort
SELECT DISTINCT 89 FROM tab0 GROUP BY col1
----
89

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2 HAVING + - NULLIF ( + col1, NULLIF ( + + 95, col2 / + - 51 ) ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7362
SELECT ALL - 5 * - col1 DIV col1 + + col1 + 46 + + + ( - - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
139
165
63

skipif mysql # not compatible
query I rowsort label-7362
SELECT ALL - 5 * - col1 / col1 + + col1 + 46 + + + ( - - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
139
165
63

query II rowsort
SELECT 43, - col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + 0, - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL < + 50 + - col0 - + 20
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7366
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

skipif mysql # not compatible
query I rowsort label-7366
SELECT CAST ( NULL AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT + col1 * + - col1 + - col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 WHERE ( - col2 ) IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col1 FROM tab0 WHERE NOT + col0 * col1 * col1 + col2 >= - 72 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7371
SELECT + col0 * col0 FROM tab2 AS cor0 WHERE + col1 BETWEEN - col0 + - col1 AND ( CAST( NULL AS SIGNED ) + 48 * col2 ) GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7371
SELECT + col0 * col0 FROM tab2 AS cor0 WHERE + col1 BETWEEN - col0 + - col1 AND ( CAST ( NULL AS INTEGER ) + 48 * col2 ) GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7372
SELECT - ( - COALESCE ( + + COALESCE ( 36, col0 * - col1 ), + col2, - col1 ) ) AS col2 FROM tab2 cor0 GROUP BY col0, col1, col2 HAVING NOT + NULLIF ( + ( CASE + col0 WHEN - 67 THEN NULL WHEN 69 THEN - 18 - - 41 WHEN + col0 * + col2 THEN ( col2 ) ELSE 31 END ), - col2 ) * - col0 = CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-7372
SELECT - ( - COALESCE ( + + COALESCE ( 36, col0 * - col1 ), + col2, - col1 ) ) AS col2 FROM tab2 cor0 GROUP BY col0, col1, col2 HAVING NOT + NULLIF ( + ( CASE + col0 WHEN - 67 THEN NULL WHEN 69 THEN - 18 - - 41 WHEN + col0 * + col2 THEN ( col2 ) ELSE 31 END ), - col2 ) * - col0 = CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - NULLIF ( + + col2, col0 ) FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query II rowsort
SELECT ALL + col2 AS col2, ( + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
45
71
71
8
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7375
SELECT - ( 16 ) AS col2 FROM tab0 cor0 GROUP BY col0 HAVING CAST( NULL AS SIGNED ) > NULL
----

skipif mysql # not compatible
query I rowsort label-7375
SELECT - ( 16 ) AS col2 FROM tab0 cor0 GROUP BY col0 HAVING CAST ( NULL AS INTEGER ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7376
SELECT + + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7376
SELECT + + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT + 63 FROM tab2 AS cor0 GROUP BY col2
----
63

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7379
SELECT 84 * - 45 FROM tab2 AS cor0 WHERE NOT ( - COALESCE ( + - 28, - 71 ) ) BETWEEN CAST( ( col1 ) AS SIGNED ) + 32 AND col2 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7379
SELECT 84 * - 45 FROM tab2 AS cor0 WHERE NOT ( - COALESCE ( + - 28, - 71 ) ) BETWEEN CAST ( ( col1 ) AS INTEGER ) + 32 AND col2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7380
SELECT + col1 - - + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL > 7
----

skipif mysql # not compatible
query I rowsort label-7380
SELECT + col1 - - + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL > 7
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7381
SELECT DISTINCT ( - CAST( - - 52 AS SIGNED ) ) * - col1 + 7 * - 23 + col1 AS col1 FROM tab2 GROUP BY col1, col1, col0, col2 HAVING NOT + CAST( - col2 AS DECIMAL ) BETWEEN NULL AND ( - col0 + + col1 )
----

skipif mysql # not compatible
query I rowsort label-7381
SELECT DISTINCT ( - CAST ( - - 52 AS INTEGER ) ) * - col1 + 7 * - 23 + col1 AS col1 FROM tab2 GROUP BY col1, col1, col0, col2 HAVING NOT + CAST ( - col2 AS REAL ) BETWEEN NULL AND ( - col0 + + col1 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - 49 AS col1 FROM tab1 WHERE + + 47 + + - col1 > NULL GROUP BY col2 HAVING NULL NOT BETWEEN - col1 AND ( - 53 + 29 )
----

query I rowsort
SELECT DISTINCT col1 + + 9 FROM tab0 GROUP BY col1
----
9
90

query I rowsort
SELECT + 33 - col0 FROM tab2 GROUP BY col0, col0, col0
----
-58
-59
18

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 WHERE ( NOT ( - col1 IS NOT NULL ) ) GROUP BY col0
----

query I rowsort
SELECT ALL - 21 AS col0 FROM tab2 WHERE NULL <> NULL GROUP BY col2, col2 HAVING NOT NULL >= col2
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL BETWEEN + 46 + col2 AND + 38
----

query I rowsort
SELECT DISTINCT 9 AS col1 FROM tab2 GROUP BY col1, col1
----
9

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col0, col1, col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab2 WHERE NOT ( + 38 + col0 ) < col1 + ( - col2 + - col2 / 33 ) GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT + col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 + + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT + 24 * + 81 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
1944

query I rowsort
SELECT ALL - col1 + col1 * - col1 FROM tab1 AS cor0 WHERE 48 * - col1 IN ( 70 / 93 ) GROUP BY col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 69, + col2 - - col2, col2 ) * - COALESCE ( - col0, + col0 ) FROM tab1 GROUP BY col0 HAVING NOT + 0 <> ( + 57 )
----

query I rowsort
SELECT - 55 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + 91 IS NULL
----
-55
-55

onlyif mysql # DIV for integer division: 
query I rowsort label-7397
SELECT DISTINCT col0 + - col0 DIV col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
21
27
81

skipif mysql # not compatible
query I rowsort label-7397
SELECT DISTINCT col0 + - col0 / col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
21
27
81

query I rowsort
SELECT 45 + col1 FROM tab1 GROUP BY col1
----
102
51
89

query I rowsort
SELECT + 75 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col1 HAVING NULL < ( - 45 )
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND - col1
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NOT + col0 >= NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + + 22 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
22
22
22

query I rowsort
SELECT ALL - + 73 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( col0 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7404
SELECT DISTINCT - col2 DIV + col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-7404
SELECT DISTINCT - col2 / + col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
-1

query I rowsort
SELECT DISTINCT + col0 * col0 + - 81 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0 HAVING NOT AVG ( ALL 21 ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( + col1 ) <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7407
SELECT ALL - - col2 DIV + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7407
SELECT ALL - - col2 / + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7408
SELECT CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7408
SELECT CAST ( NULL AS REAL ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7409
SELECT DISTINCT + 32 / - 18 FROM tab0 GROUP BY col0, col1 HAVING + 33 + CAST( NULL AS SIGNED ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7409
SELECT DISTINCT + 32 / - 18 FROM tab0 GROUP BY col0, col1 HAVING + 33 + CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT ALL 76 * - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL < ( NULL )
----

query I rowsort
SELECT + 24 + - 87 * + 63 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-5457
-5457
-5457

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7412
SELECT - 61 * + COALESCE ( - col2, CAST( NULL AS SIGNED ), 64 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
2745
4331
488

skipif mysql # not compatible
query I rowsort label-7412
SELECT - 61 * + COALESCE ( - col2, CAST ( NULL AS INTEGER ), 64 ) AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
2745
4331
488

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( + 38 * ( ( 86 ) * - col0 ) ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7414
SELECT ALL ( - + 58 ) - - 83 DIV col2 col0 FROM tab2 GROUP BY col2
----
-57
-57
-58

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7414
SELECT ALL ( - + 58 ) - - 83 / col2 col0 FROM tab2 GROUP BY col2
----
-57
-57
-58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - + 27 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7417
SELECT ALL - CAST( NULL AS SIGNED ) * + + col0 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7417
SELECT ALL - CAST ( NULL AS INTEGER ) * + + col0 FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 24 AS col0 FROM tab2 GROUP BY col0
----
24

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - 53 + + + 43 col1 FROM tab1 cor0 GROUP BY col2 HAVING - AVG ( DISTINCT - 63 ) IS NOT NULL
----
96

query I rowsort
SELECT - 95 FROM tab1 AS cor0 GROUP BY col2
----
-95
-95
-95

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - ( col0 ) FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - - ( + - 22 ) FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col1 HAVING 69 IS NOT NULL
----
-22
-22

query I rowsort
SELECT DISTINCT + + col2 AS col0 FROM tab2 AS cor0 WHERE NOT - col2 * + + col1 <= - col1 + - col1 GROUP BY col2
----

query I rowsort
SELECT ( + ( + + col1 ) ) AS col2 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT COALESCE ( - 54, - 75 ) FROM tab0 AS cor0 GROUP BY col2
----
-54
-54
-54

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col0, 75 * col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT + col1 < NULL
----

query I rowsort
SELECT DISTINCT 89 AS col1 FROM tab0 GROUP BY col1, col1
----
89

query I rowsort
SELECT col1 * 30 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT - 54 < NULL
----

query I rowsort
SELECT - col2 + - - col2 AS col0 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 / col0 FROM tab1 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT - 75 FROM tab0 GROUP BY col2
----
-75

query I rowsort
SELECT - 31 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT ALL - + 13 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 = NULL
----

query II rowsort
SELECT col1, 5 * - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT + col1 * col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> 3 - + 89 * - ( - 57 )
----

query I rowsort
SELECT ALL ( - col2 ) - - col2 AS col2 FROM tab2 WHERE NOT NULL > col0 * - col2 - + col1 GROUP BY col2
----

query I rowsort
SELECT + 95 * + + 94 FROM tab0 GROUP BY col1, col2, col1
----
8930
8930
8930

query I rowsort
SELECT - 63 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IN ( + 61, col1 )
----

query I rowsort
SELECT ALL + - 88 FROM tab0 AS cor0 GROUP BY col2
----
-88
-88
-88

query I rowsort
SELECT DISTINCT + 58 AS col2 FROM tab2 GROUP BY col0, col2
----
58

query I rowsort
SELECT 87 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
87
87
87

query I rowsort
SELECT ALL - col2 + - col0 FROM tab0 AS cor0 WHERE ( col1 ) NOT BETWEEN NULL AND - col0 * - + col1 * col0 + - col0 * + 21 GROUP BY col2, col0
----
-105
-121

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7445
SELECT ALL 37 + - - CAST( NULL AS SIGNED ) * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7445
SELECT ALL 37 + - - CAST ( NULL AS INTEGER ) * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query II rowsort
SELECT + + col1, col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
92
59
91
61
15

query II rowsort
SELECT - col1, + 68 AS col2 FROM tab1 GROUP BY col1, col0
----
-44
68
-57
68
-6
68

query I rowsort
SELECT DISTINCT + col1 - + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
0

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT 4 * + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + NULLIF ( - + 31, - 71 ) FROM tab2 GROUP BY col1
----
-31
-31
-31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7452
SELECT DISTINCT - + col1 * + CAST( NULL AS SIGNED ) + + + col1 FROM tab2 cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-7452
SELECT DISTINCT - + col1 * + CAST ( NULL AS INTEGER ) + + + col1 FROM tab2 cor0 GROUP BY col1
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7453
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING - col2 * + + CAST( NULL AS SIGNED ) NOT BETWEEN col2 * 52 AND NULL
----

skipif mysql # not compatible
query I rowsort label-7453
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING - col2 * + + CAST ( NULL AS INTEGER ) NOT BETWEEN col2 * 52 AND NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT - 67 FROM tab2 GROUP BY col1, col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7456
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST( + CAST( col2 AS SIGNED ) AS SIGNED ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7456
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST ( + CAST ( col2 AS INTEGER ) AS INTEGER ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

query I rowsort
SELECT DISTINCT - ( + + 90 ) + - 19 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - 83 <= NULL
----

query I rowsort
SELECT DISTINCT - 74 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-74
7

query I rowsort
SELECT + - 92 FROM tab1 AS cor0 GROUP BY col0
----
-92
-92
-92

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL <> NULL
----

query II rowsort
SELECT + col1 + - + ( col1 ) AS col2, col1 * - + col1 * col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT col1 IS NULL
----
0
-205379
0
-226981
0
-68921

query I rowsort
SELECT 27 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
27
27
27

query I rowsort
SELECT ALL ( - - col0 ) FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 + - - col0 FROM tab0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT + col0 * - - col0 + - col0 * col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT ALL COALESCE ( col2, + - 67 ) FROM tab1 WHERE NOT + 93 - col1 * ( - + 53 ) * col2 BETWEEN NULL AND - - 41 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 GROUP BY col2 HAVING NOT + col2 * - col2 = + + 5
----
45
71
8

query I rowsort
SELECT ALL 47 FROM tab0 AS cor0 GROUP BY col1, col2
----
47
47
47

query I rowsort
SELECT 18 FROM tab2 AS cor0 GROUP BY col1, col0
----
18
18
18

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN - col1 AND col1
----

query I rowsort
SELECT DISTINCT - - ( + 36 ) FROM tab2 AS cor0 GROUP BY col1, col1
----
36

query I rowsort
SELECT ALL col0 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

onlyif mysql # DIV for integer division: 
query I rowsort label-7473
SELECT col0 DIV + + col0 AS col1 FROM tab2 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7473
SELECT col0 / + + col0 AS col1 FROM tab2 GROUP BY col0
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7474
SELECT DISTINCT + CAST( NULL AS SIGNED ), col2 col0 FROM tab2 GROUP BY col2 HAVING NOT 96 IS NULL AND NOT NULL BETWEEN NULL AND - 76
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7474
SELECT DISTINCT + CAST ( NULL AS INTEGER ), col2 col0 FROM tab2 GROUP BY col2 HAVING NOT 96 IS NULL AND NOT NULL BETWEEN NULL AND - 76
----

query I rowsort
SELECT ALL 5 FROM tab0 cor0 GROUP BY col1
----
5
5

query I rowsort
SELECT DISTINCT + 12 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - 74 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1776
-2812
-5846

query I rowsort
SELECT ALL ( - col1 ) FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ( - 0 ) AS col2 FROM tab2 GROUP BY col2 HAVING + 97 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7480
SELECT DISTINCT col1 / - 90 * + col1 + - - CAST( NULL AS SIGNED ) * + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7480
SELECT DISTINCT col1 / - 90 * + col1 + - - CAST ( NULL AS INTEGER ) * + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - 60 AS col2 FROM tab0 GROUP BY col0
----
-60
-60
-60

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL ( - - 16 ) AS col0 FROM tab1 GROUP BY col0, col1
----
16
16
16

query I rowsort
SELECT + 2 FROM tab0 GROUP BY col0
----
2
2
2

query I rowsort
SELECT ALL + 47 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - AVG ( + 24 ) AS col1, ( col2 ) col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT 11 * + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
0
0
891

query I rowsort
SELECT DISTINCT + 14 FROM tab2 AS cor0 GROUP BY col0
----
14

query I rowsort
SELECT DISTINCT - 83 FROM tab2 GROUP BY col2 HAVING + 73 = ( ( - - col2 ) )
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 WHERE NOT - + ( - - col2 ) + ( col1 ) > NULL GROUP BY col0, col1 HAVING + + col0 IS NOT NULL
----

query I rowsort
SELECT ALL - - 81 FROM tab0 AS cor0 GROUP BY col0
----
81
81
81

query I rowsort
SELECT ALL 43 * col1 * - + col2 FROM tab1 GROUP BY col2, col1
----
-110295
-134332
-2064

query I rowsort
SELECT ( 10 ) + + - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT - 83 IS NULL
----
-12
-18
-72

query I rowsort
SELECT - ( + 52 ) FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-52
-52
-52

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * + col0 col2 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT ( - col0 ) FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT - ( - 33 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
33
33
33

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
24
38
79

query I rowsort
SELECT - 16 / - col0 FROM tab1 WHERE ( NULL ) NOT IN ( col2 ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - 11 FROM tab1 AS cor0 GROUP BY col2
----
-11

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE NOT ( NOT NULL <= NULL ) GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 60 FROM tab2 WHERE NOT ( - 64 ) IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT + col0 + - 60, + ( + - col0 ) - - col0 FROM tab0 WHERE NOT + col1 BETWEEN NULL AND + col1 GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING + 25 IS NULL
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-24
-38
-79

query I rowsort
SELECT - - col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT 14 * - 44 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL > + COALESCE ( - col1, - col1 )
----

query I rowsort
SELECT ALL + 15 - 10 FROM tab0 GROUP BY col0
----
5
5
5

query I rowsort
SELECT col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT CASE 42 WHEN - 99 THEN AVG ( 13 ) * - col1 - + col2 * + col2 END + + col2 FROM tab0 WHERE ( NULL ) NOT BETWEEN ( col1 ) AND ( - CASE WHEN col2 NOT BETWEEN NULL AND ( col2 + 48 ) THEN col1 ELSE + col2 * + col0 END ) GROUP BY col2 HAVING NOT NULL BETWEEN ( - col2 ) AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST( NULL AS SIGNED ) * - CAST( - col1 AS SIGNED ) AND col0 GROUP BY col0, col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST ( NULL AS INTEGER ) * - CAST ( - col1 AS INTEGER ) AND col0 GROUP BY col0, col0
----

query I rowsort
SELECT ALL 41 AS col1 FROM tab1 GROUP BY col0
----
41
41
41

query I rowsort
SELECT DISTINCT + col2 * - 13 AS col1 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-1027
-1131
-754

onlyif mysql # DIV for integer division: 
query I rowsort label-7515
SELECT 62 DIV 90 FROM tab1 GROUP BY col2, col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7515
SELECT 62 / 90 FROM tab1 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT col2 FROM tab2 WHERE NOT ( NULL ) <= NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col0 * col0 - 70 AS col1 FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) < + 75
----

query I rowsort
SELECT ALL 2 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col1 HAVING - col1 / col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT 15 FROM tab0 cor0 GROUP BY col0, col1, col1
----
15
15
15

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + 17 + - 77 * 52 <> NULL
----

query I rowsort
SELECT DISTINCT - ( col0 ) FROM tab0 GROUP BY col0, col1, col2 HAVING NOT col2 * + 17 IS NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + 94 FROM tab2 WHERE - 48 IN ( - col1 / + NULLIF ( col1 * col2, col0 ) ) GROUP BY col1, col2 HAVING ( ( 51 ) ) BETWEEN + 72 AND col2 + - 87
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col0 HAVING NOT col0 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col2, col1 HAVING 10 <> + AVG ( DISTINCT - 29 ) + col1
----
58
79
87

query I rowsort
SELECT - 37 FROM tab1 GROUP BY col1, col2
----
-37
-37
-37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7529
SELECT CAST( NULL AS SIGNED ) * - col2 FROM tab1 WHERE + col1 + 62 IS NOT NULL GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7529
SELECT CAST ( NULL AS INTEGER ) * - col2 FROM tab1 WHERE + col1 + 62 IS NOT NULL GROUP BY col0, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7530
SELECT - col0 FROM tab2 WHERE + 82 - col0 < CAST( - NULLIF ( - 63, col1 - - 66 ) AS SIGNED ) GROUP BY col2, col0
----
-91
-92

skipif mysql # not compatible
query I rowsort label-7530
SELECT - col0 FROM tab2 WHERE + 82 - col0 < CAST ( - NULLIF ( - 63, col1 - - 66 ) AS INTEGER ) GROUP BY col2, col0
----
-91
-92

query I rowsort
SELECT ALL + col0 * col0 AS col0 FROM tab0 GROUP BY col1, col0, col0
----
1849
676
6889

query I rowsort
SELECT col0 * + + 80 FROM tab2 GROUP BY col2, col0
----
1200
7280
7360

query I rowsort
SELECT col2 * - 74 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT - col0 + + 82 IS NULL
----
-1776
-2812
-5846

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7534
SELECT ALL col0 FROM tab2 GROUP BY col0, col2, col1, col1 HAVING NOT NULL = ( - 61 * CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-7534
SELECT ALL col0 FROM tab2 GROUP BY col0, col2, col1, col1 HAVING NOT NULL = ( - 61 * CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT 15 AS col0 FROM tab1 GROUP BY col1 HAVING ( NOT NULL BETWEEN col1 AND ( col1 ) )
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING + col0 + + col0 IS NULL
----

query I rowsort
SELECT ALL ( 43 ) * - - col2 * - col2 + - col2 AS col2 FROM tab2 GROUP BY col2
----
-144710
-268442
-325554

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 + + 0 col0, col0 * + ( 52 ) FROM tab1 GROUP BY col0 HAVING - 58 < ( 2 + - 41 )
----
22
1144
28
1456
82
4264

query I rowsort
SELECT ALL + col2 + - 24 + - - col2 * + col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT 65 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - ( + col0 ) * col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + col2 + - + 17 - col1 + + + 77 * - + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-3494
-5457
-631

query I rowsort
SELECT DISTINCT + 78 * - col0 FROM tab1 cor0 GROUP BY col0
----
-1716
-2184
-6396

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7546
SELECT DISTINCT - CAST( NULL AS SIGNED ) * + CAST( + col2 AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-7546
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * + CAST ( + col2 AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL

query I rowsort
SELECT - 54 FROM tab1 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - + col2 / - + col2 FROM tab1 AS cor0 WHERE col2 * NULLIF ( col2, + - 69 ) IS NULL GROUP BY col2
----

query II rowsort
SELECT DISTINCT + col1 / + col1 + col1 AS col2, + 24 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col0, col2, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7551
SELECT - col1 + + col1 * - + col1 AS col1 FROM tab2 AS cor0 WHERE + col2 / - col2 BETWEEN + 9 * col2 * + CAST( NULL AS SIGNED ) + + col0 - + col1 AND + - col1 * - col1 * - - 47 * col0 + 68 * - col2 * col1 GROUP BY col1 HAVING NULL <> + 92
----

skipif mysql # not compatible
query I rowsort label-7551
SELECT - col1 + + col1 * - + col1 AS col1 FROM tab2 AS cor0 WHERE + col2 / - col2 BETWEEN + 9 * col2 * + CAST ( NULL AS INTEGER ) + + col0 - + col1 AND + - col1 * - col1 * - - 47 * col0 + 68 * - col2 * col1 GROUP BY col1 HAVING NULL <> + 92
----

query I rowsort
SELECT ALL + col0 - + 91 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-76
0
1

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7553
SELECT ALL col1 / - col1 FROM tab1 GROUP BY col1 HAVING 66 > + CAST( NULL AS DECIMAL ) + CAST( CAST( 38 AS SIGNED ) AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-7553
SELECT ALL col1 / - col1 FROM tab1 GROUP BY col1 HAVING 66 > + CAST ( NULL AS REAL ) + CAST ( CAST ( 38 AS INTEGER ) AS INTEGER )
----

query I rowsort
SELECT - 12 * - 30 AS col2 FROM tab2 GROUP BY col1, col2, col1
----
360
360
360

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7555
SELECT - 25 FROM tab0 GROUP BY col0, col2, col1 HAVING + 5 < CAST( + col1 AS SIGNED )
----
-25

skipif mysql # not compatible
query I rowsort label-7555
SELECT - 25 FROM tab0 GROUP BY col0, col2, col1 HAVING + 5 < CAST ( + col1 AS INTEGER )
----
-25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7556
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING 82 + 97 BETWEEN + CAST( NULL AS SIGNED ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-7556
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING 82 + 97 BETWEEN + CAST ( NULL AS INTEGER ) AND NULL
----

query I rowsort
SELECT ALL + ( 23 ) + + col2 * - col2 FROM tab1 GROUP BY col1, col2 HAVING - 16 * - col1 IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT - ( 38 ) FROM tab0 AS cor0 GROUP BY col2
----
-38
-38
-38

query I rowsort
SELECT ( col2 ) AS col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query II rowsort
SELECT - col1, ( - col1 ) FROM tab0 GROUP BY col1, col0 HAVING NOT + col1 >= NULL
----

query I rowsort
SELECT 99 + col1 FROM tab2 GROUP BY col1, col1
----
140
158
160

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT - col0 * - col0 * + col0 * + + col0 * col0 AS col0, col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL <= + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7564
SELECT ALL col0 * + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7564
SELECT ALL col0 * + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

query II rowsort
SELECT DISTINCT col0 * - 25 - - + ( col0 ) AS col0, - col0 + + 68 AS col2 FROM tab2 cor0 GROUP BY col0
----
-2184
-23
-2208
-24
-360
53

query I rowsort
SELECT + col1 * - col1 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-1980
-3306
-42

query I rowsort
SELECT 16 + + - ( - 3 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
19
19
19

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7568
SELECT - CAST( NULL AS SIGNED ) * + + col1 FROM tab1 AS cor0 WHERE col2 NOT BETWEEN - col1 * ( - col1 ) AND + 62 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7568
SELECT - CAST ( NULL AS INTEGER ) * + + col1 FROM tab1 AS cor0 WHERE col2 NOT BETWEEN - col1 * ( - col1 ) AND + 62 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 77 AS col1 FROM tab1 WHERE NOT NULL <> NULL GROUP BY col1, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7570
SELECT col0 DIV - - 97 FROM tab1 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7570
SELECT col0 / - - 97 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT - 92 FROM tab2 GROUP BY col0, col0
----
-92

query I rowsort
SELECT ALL + - col2 + - 12 FROM tab1 AS cor0 GROUP BY col2
----
-20
-57
-83

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT AVG ( ALL col0 ) IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT + ( COALESCE ( 62, + 29 ) ) IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT 0 FROM tab0 AS cor0 WHERE NOT + 96 = NULL GROUP BY col0, col2
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 GROUP BY col1, col2, col1 HAVING NULL NOT BETWEEN 2 AND ( + 15 )
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT col1 + + 37 FROM tab0 GROUP BY col1
----
118
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7579
SELECT - CAST( - + 71 AS SIGNED ) - 7 FROM tab2 GROUP BY col2, col2
----
64
64
64

skipif mysql # not compatible
query I rowsort label-7579
SELECT - CAST ( - + 71 AS INTEGER ) - 7 FROM tab2 GROUP BY col2, col2
----
64
64
64

query I rowsort
SELECT + 28 * + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
2296
616
784

onlyif mysql # DIV for integer division: 
query I rowsort label-7581
SELECT - col0 DIV 93 * - 67 - + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

skipif mysql # not compatible
query I rowsort label-7581
SELECT - col0 / 93 * - 67 - + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - 43 + + + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7584
SELECT ALL CAST( NULL AS SIGNED ) + - 31 AS col1, - 61 AS col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

skipif mysql # not compatible
query II rowsort label-7584
SELECT ALL CAST ( NULL AS INTEGER ) + - 31 AS col1, - 61 AS col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7585
SELECT - - col1 * - col1 * - col1 - + 95 * + CAST( NULL AS SIGNED ) FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7585
SELECT - - col1 * - col1 * - col1 - + 95 * + CAST ( NULL AS INTEGER ) FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - 44 AS col1, col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NOT - ( - col0 ) IS NOT NULL )
----

query II rowsort
SELECT ALL - col2, + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
24
-38
38
-79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + 16 FROM tab2 GROUP BY col0, col1
----
-15
16
-91
16
-92
16

query I rowsort
SELECT DISTINCT - - 4 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
4

query I rowsort
SELECT + - col1 - + col1 AS col0 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL = 60
----

query II rowsort
SELECT + 15 AS col0, col2 * - col2 FROM tab0 WHERE 34 + + col0 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 WHERE NULL = NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + 21 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
21

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7595
SELECT ALL + 6 FROM tab2 AS cor0 WHERE NOT ( - col2 ) < col0 * - - 23 * + - col2 + col2 + - CAST( NULL AS SIGNED ) * + col0 * col0 * - 56 GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-7595
SELECT ALL + 6 FROM tab2 AS cor0 WHERE NOT ( - col2 ) < col0 * - - 23 * + - col2 + col2 + - CAST ( NULL AS INTEGER ) * + col0 * col0 * - 56 GROUP BY col1
----

query I rowsort
SELECT ALL - 94 FROM tab1 AS cor0 GROUP BY col0
----
-94
-94
-94

onlyif mysql # DIV for integer division: 
query I rowsort label-7597
SELECT DISTINCT - col2 DIV col2 + + ( + + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

skipif mysql # not compatible
query I rowsort label-7597
SELECT DISTINCT - col2 / col2 + + ( + + col2 ) FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2 HAVING + + 12 IS NULL
----

query I rowsort
SELECT ( - 4 ) AS col1 FROM tab1 GROUP BY col0
----
-4
-4
-4

query II rowsort
SELECT 36, - col2 / - col2 * col2 * - col2 FROM tab0 GROUP BY col2 HAVING NOT 93 IS NOT NULL
----

query I rowsort
SELECT ALL col2 * + 21 * 49 * + - ( + col1 ) FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT + col2 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - + 79 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-79
-79
-79

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - 15 IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 8 col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
8

query I rowsort
SELECT - col2 + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 cor0 GROUP BY col1 HAVING NOT - AVG ( 3 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7609
SELECT ALL + CAST( - 27 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= - 26
----

skipif mysql # not compatible
query I rowsort label-7609
SELECT ALL + CAST ( - 27 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= - 26
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - - 86, - + COALESCE ( col0, col1 + - col1 ) * - - ( + col0 ) ) AS col2 FROM tab0 GROUP BY col2
----
-86

query I rowsort
SELECT + 29 - + - col1 + - - 54 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL NOT IN ( - col2 + + - col2 )
----

query I rowsort
SELECT ALL col0 - - + col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col1 * + col0 FROM tab0 GROUP BY col0, col1
----
0
0
3483

query I rowsort
SELECT col1 FROM tab0 WHERE + col0 IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 63 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
63

query I rowsort
SELECT ( - col1 ) AS col1 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN + col0 AND + ( + col0 ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 54 / + 63 + + col1 AS col1 FROM tab0 WHERE ( - col1 ) IS NULL GROUP BY col0, col1
----

query II rowsort
SELECT col1 + - col1 + - col1 * - col1 + - col1, col1 FROM tab2 GROUP BY col1
----
1640
41
3422
59
3660
61

query I rowsort
SELECT col1 FROM tab0 GROUP BY col2, col1 HAVING NOT + - col2 IS NULL
----
0
0
81

query I rowsort
SELECT DISTINCT + 56 * 8 + - col0 FROM tab2 WHERE col0 / col1 <> + col1 GROUP BY col0, col1
----
356
357
433

query I rowsort
SELECT ALL col1 + + + col0 - + col1 - + ( col1 ) - col1 AS col2 FROM tab2 GROUP BY col1, col0
----
-107
-27
10

query I rowsort
SELECT - 53 FROM tab1 GROUP BY col0
----
-53
-53
-53

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 26 col2 FROM tab2 GROUP BY col0
----
-26
-26
-26

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING ( col1 + - + col1 IN ( - 2 + + + 88 ) )
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) > NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-7627
SELECT COALESCE ( 63, - CAST( NULL AS DECIMAL ) ) AS col2, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL = 4
----

skipif mysql # not compatible
query II rowsort label-7627
SELECT COALESCE ( 63, - CAST ( NULL AS REAL ) ) AS col2, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL = 4
----

query I rowsort
SELECT + 34 * 50 + 43 FROM tab2 AS cor0 WHERE - col2 + col0 + - col1 + - 27 * - 15 * - 66 IS NULL GROUP BY col0 HAVING ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 * + 33 * + ( + col2 ) AS col2 FROM tab2 GROUP BY col2
----
-111012
-205953
-249777

query I rowsort
SELECT ALL 55 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
55
55
55

query I rowsort
SELECT DISTINCT 48 * + col2 AS col0 FROM tab1 GROUP BY col2
----
2160
3408
384

query I rowsort
SELECT ALL - ( - col1 ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 >= NULL
----

query I rowsort
SELECT + 41 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
41
41

query I rowsort
SELECT DISTINCT - col0 + - col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NULL
----
-164
-44
-56

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col0, col1, col2
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-7636
SELECT - - col2 DIV + - 52 + + + 49 - + NULLIF ( col2, - 77 ) + + + col2 * 7 * col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + 66 > col2
----
35264

skipif mysql # not compatible
query I rowsort label-7636
SELECT - - col2 / + - 52 + + + 49 - + NULLIF ( col2, - 77 ) + + + col2 * 7 * col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + 66 > col2
----
35264

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7637
SELECT DISTINCT + + col2 + col2 / + col2 + + CAST( NULL AS SIGNED ) col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7637
SELECT DISTINCT + + col2 + col2 / + col2 + + CAST ( NULL AS INTEGER ) col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT ( - ( - + 37 ) ) + + + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
124
95

query II rowsort
SELECT ALL - 93 AS col2, + 31 + + col2 AS col2 FROM tab1 AS cor0 WHERE NULL > NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 68 col2 FROM tab2 AS cor0 GROUP BY col0
----
68
68
68

query I rowsort
SELECT DISTINCT 28 + + + 38 FROM tab1 GROUP BY col2
----
66

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7643
SELECT ALL CAST( NULL AS DECIMAL ) * col1 AS col0 FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7643
SELECT ALL CAST ( NULL AS REAL ) * col1 AS col0 FROM tab2 GROUP BY col1, col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab0 cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 AS col2, - col2 + col2 col2 FROM tab1 GROUP BY col2, col2 HAVING NULL NOT BETWEEN + 92 AND + - col2
----

query I rowsort
SELECT DISTINCT - 38 AS col2 FROM tab0 GROUP BY col2, col2 HAVING - - AVG ( ALL 38 ) < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7648
SELECT CAST( + col2 AS SIGNED ) + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

skipif mysql # not compatible
query I rowsort label-7648
SELECT CAST ( + col2 AS INTEGER ) + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - 49 + - 74 FROM tab2 AS cor0 GROUP BY col1
----
-25
-25
-25

query I rowsort
SELECT + + col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1, col1
----
0
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7652
SELECT - CAST( NULL AS SIGNED ) col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7652
SELECT - CAST ( NULL AS INTEGER ) col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 - + col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT - - col2 >= NULL
----

query I rowsort
SELECT ALL 57 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
57
57

query I rowsort
SELECT - 59 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - 39 AS col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( ( NULL ) IS NOT NULL )
----
-39
-39
-39

query II rowsort
SELECT ALL + col1 AS col0, + 71 AS col1 FROM tab1 WHERE NOT NULL NOT BETWEEN NULL AND NULL AND NOT ( - col0 ) = - col2 GROUP BY col1
----

query I rowsort
SELECT 7 AS col0 FROM tab2 GROUP BY col1
----
7
7
7

query I rowsort
SELECT ALL + - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-18
-18
-18

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT 84 IS NULL
----
58
79
87

query I rowsort
SELECT - 10 + - col2 FROM tab0 GROUP BY col2
----
-34
-48
-89

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 + - col2 / + 16 IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * - ( - + col0 ) * - col0 col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
19575
490912
654199

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + 31 + + 13 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
44
44
44

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7666
SELECT + 19 * - 87 * ( CAST( + + 19 AS SIGNED ) ) * + - ( - col1 ) AS col2 FROM tab0 GROUP BY col1
----
-2543967
0

skipif mysql # not compatible
query I rowsort label-7666
SELECT + 19 * - 87 * ( CAST ( + + 19 AS INTEGER ) ) * + - ( - col1 ) AS col2 FROM tab0 GROUP BY col1
----
-2543967
0

query I rowsort
SELECT ALL + 64 FROM tab0 GROUP BY col0
----
64
64
64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7668
SELECT 4 FROM tab2 GROUP BY col1 HAVING 82 = - - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-7668
SELECT 4 FROM tab2 GROUP BY col1 HAVING 82 = - - CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7669
SELECT DISTINCT 20 + - 53 * - col0 AS col1 FROM tab2 WHERE NOT col1 / - ( + - col0 ) IN ( + col0, + CAST( + col2 AS SIGNED ), + col1, col1, - col1, col0 + + - col1, - col0 ) GROUP BY col0 HAVING NOT 10 IS NULL
----
4843
4896
815

skipif mysql # not compatible
query I rowsort label-7669
SELECT DISTINCT 20 + - 53 * - col0 AS col1 FROM tab2 WHERE NOT col1 / - ( + - col0 ) IN ( + col0, + CAST ( + col2 AS INTEGER ), + col1, col1, - col1, col0 + + - col1, - col0 ) GROUP BY col0 HAVING NOT 10 IS NULL
----
4843
4896
815

query I rowsort
SELECT col2 * - ( + 45 ) AS col2 FROM tab2 GROUP BY col2
----
-2610
-3555
-3915

query I rowsort
SELECT ALL - col1 * - col1 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-154652
-316771
-55815

query I rowsort
SELECT - + 65 + - - col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT + 99 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 4 * + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-176
-228
-24

query I rowsort
SELECT ALL + ( 63 ) AS col1 FROM tab0 WHERE NOT + col1 IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col2 + col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 2 + + 81 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT col2 / + 8 IS NOT NULL OR NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - - col2, col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab1 GROUP BY col0
----
-22
-28
-82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7680
SELECT + col2 - CAST( + - col2 AS SIGNED ) - col2 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL <= NULL
----

skipif mysql # not compatible
query I rowsort label-7680
SELECT + col2 - CAST ( + - col2 AS INTEGER ) - col2 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT + 12 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT ALL - col2 + - - col1 * - col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
-2610
-3195
-56

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7683
SELECT + + 72 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT - - CASE + 43 WHEN + col0 THEN NULL ELSE + 44 END <= + CASE + col1 WHEN + 67 * - 96 / + + col1 THEN NULL WHEN - + CAST( - - col0 AS SIGNED ) THEN - + col1 ELSE 20 END
----
72
72
72

skipif mysql # not compatible
query I rowsort label-7683
SELECT + + 72 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT - - CASE + 43 WHEN + col0 THEN NULL ELSE + 44 END <= + CASE + col1 WHEN + 67 * - 96 / + + col1 THEN NULL WHEN - + CAST ( - - col0 AS INTEGER ) THEN - + col1 ELSE 20 END
----
72
72
72

query I rowsort
SELECT col2 * - - ( 5 ) + - + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
152
316
96

query I rowsort
SELECT ALL + col0 + + col0 AS col2 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT 6 * + col1 FROM tab0 GROUP BY col1, col2, col2
----
0
0
486

query I rowsort
SELECT + 11 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT - 36 * + + col2 + + 44 IS NOT NULL
----

query I rowsort
SELECT - 63 FROM tab2 cor0 GROUP BY col0, col2
----
-63
-63
-63

query I rowsort
SELECT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - col1 = + col1
----
-44
-57
-6

query II rowsort
SELECT DISTINCT col0 + 22, + 46 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
113
46
114
46
37
46

query I rowsort
SELECT - ( 99 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - 7 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - 42 + + - 44 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING 0 IS NOT NULL
----
-86
-86
-86

query I rowsort
SELECT DISTINCT 36 * + col0 * - col1 FROM tab0 GROUP BY col0, col1
----
-125388
0

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT + col0 IS NULL
----
-81
0

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1 HAVING - col1 NOT BETWEEN 16 AND col1
----
0
81

query I rowsort
SELECT 38 AS col0 FROM tab1 GROUP BY col0, col1
----
38
38
38

query I rowsort
SELECT + col2 * - col0 + + col2 * + col2 * col0 * + + col2 - col0 + + - col2 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NOT col0 >= - - col0
----

query II rowsort
SELECT + - col0 AS col2, - 14 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - 50 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 2 + + - col0 FROM tab1 GROUP BY col0, col2
----
-20
-26
-80

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT ( NOT + 55 * 56 <= NULL )
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NULL IN ( - col1 ) GROUP BY col0, col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL + COALESCE ( 34, - col1 * - col0 + + + 60 ), 32 AS col1 FROM tab0 cor0 GROUP BY col2, col0 HAVING + 30 > - col0 * 14
----
34
32
34
32
34
32

query I rowsort
SELECT DISTINCT - - ( 49 ) + col0 + 11 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
151
152
75

query I rowsort
SELECT ALL - - col2 * 16 - - 88 + 51 + - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
1204
259
814

query I rowsort
SELECT - col2 / col2 * - 44 / - col1 AS col1 FROM tab0 GROUP BY col2, col2, col1 HAVING NULL < + + col2
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING - 33 = + col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 72, - + col0 * - - col2 + - + col1 ) FROM tab1 GROUP BY col1
----
72
72
72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7711
SELECT col1 FROM tab1 AS cor0 WHERE NOT ( CAST( NULL AS SIGNED ) ) IS NOT NULL GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-7711
SELECT col1 FROM tab1 AS cor0 WHERE NOT ( CAST ( NULL AS INTEGER ) ) IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - + 93 FROM tab1 cor0 GROUP BY col2
----
-93

query I rowsort
SELECT + 21 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <= ( NULL )
----

query I rowsort
SELECT ALL - col1 + - 54 FROM tab1 AS cor0 GROUP BY col1, col0
----
-111
-60
-98

query I rowsort
SELECT - 63 + + 68 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col2
----
5
5
5

query I rowsort
SELECT DISTINCT 61 FROM tab0 GROUP BY col1, col2
----
61

query I rowsort
SELECT ALL 23 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7718
SELECT 84 * CAST( NULL AS DECIMAL ) AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7718
SELECT 84 * CAST ( NULL AS REAL ) AS col1 FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7720
SELECT ALL + CAST( NULL AS SIGNED ) * - - 11 * - col2 AS col1 FROM tab2 GROUP BY col2 HAVING - col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-7720
SELECT ALL + CAST ( NULL AS INTEGER ) * - - 11 * - col2 AS col1 FROM tab2 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 + 46 FROM tab1 AS cor0 GROUP BY col2
----
-18
-1979
-4995

query II rowsort
SELECT col0 + col0 + col2 * + 63, - 78 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
1598
-78
2560
-78
5029
-78

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT col0 + - - col0 * + col0 * - - 11 AS col1 FROM tab2 GROUP BY col0
----
2490
91182
93196

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 89 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + 69 FROM tab0 AS cor0 WHERE NULL NOT IN ( - col1 ) GROUP BY col0
----

query I rowsort
SELECT ALL - col2 - - - 7 * - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT col1 < col1
----
-38
-79
543

query I rowsort
SELECT + ( - col0 ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL - ( col1 ) AS col2 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab1 GROUP BY col1, col2 HAVING NOT + col2 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7732
SELECT col2 * 43 AS col2 FROM tab0 WHERE NOT 85 < + col1 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( - col2 ) AND - CAST( + 87 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-7732
SELECT col2 * 43 AS col2 FROM tab0 WHERE NOT 85 < + col1 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( - col2 ) AND - CAST ( + 87 AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST( col2 AS SIGNED ) ) AND ( 13 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST ( col2 AS INTEGER ) ) AND ( 13 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 0, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT 66 FROM tab2 GROUP BY col2
----
66
66
66

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - 40 IS NULL
----

query I rowsort
SELECT DISTINCT 92 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
1380
8372
8464

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 WHERE NULL NOT IN ( - col2 * 59 ) GROUP BY col2
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL ( - - 13 ) FROM tab0 GROUP BY col2
----
13
13
13

query I rowsort
SELECT - col0 + - 13 FROM tab2 cor0 GROUP BY col0, col0
----
-104
-105
-28

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
0
81

query I rowsort
SELECT + col0 + + 69 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IN ( col1 )
----

query I rowsort
SELECT + col0 * - - 77 FROM tab1 GROUP BY col0, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL 47 AS col1 FROM tab2 GROUP BY col0, col2, col0
----
47
47
47

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col0, col1, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL - + ( + 44 ) + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-16
-22
38

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING ( + 89 ) < NULL
----

query I rowsort
SELECT + 44 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN NULL AND col2
----

query II rowsort
SELECT + col1 AS col1, 39 FROM tab0 GROUP BY col1, col0
----
0
39
0
39
81
39

query I rowsort
SELECT ALL + col2 + - col2 AS col0 FROM tab1 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT - col0 * + col0 + + 73 AS col2 FROM tab2 GROUP BY col0
----
-152
-8208
-8391

query I rowsort
SELECT 86 FROM tab1 WHERE NULL IS NULL GROUP BY col0, col1
----
86
86
86

query I rowsort
SELECT ( + + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-7757
SELECT ALL - CAST( NULL AS SIGNED ) AS col1, col0 * + col0 + + col0 DIV - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
NULL
483
NULL
6723
NULL
783

skipif mysql # not compatible
query II rowsort label-7757
SELECT ALL - CAST ( NULL AS INTEGER ) AS col1, col0 * + col0 + + col0 / - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
NULL
483
NULL
6723
NULL
783

query I rowsort
SELECT ALL 24 * ( 29 ) + - col1 FROM tab2 GROUP BY col0, col1, col1
----
635
637
655

query I rowsort
SELECT - 17 * 58 + col2 * + col2 FROM tab1 WHERE NULL NOT IN ( 82 * 63 ) GROUP BY col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT - NULLIF ( + 98, 52 ) AS col1 FROM tab0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT 74 + - col0 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col1, col2 HAVING - col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * col1 + 57 FROM tab1 GROUP BY col1
----
-1879
-3192
21

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 * + 36 - - 41 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( + 7 * 92 + - col1 ) IS NOT NULL
----

query I rowsort
SELECT col0 - - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NOT ( NULL ) IS NULL )
----
182
184
30

query I rowsort
SELECT DISTINCT - 35 FROM tab1 WHERE + col2 NOT IN ( + + ( 72 ), - NULLIF ( - col0, - - col0 ), - 62, + + col1 ) GROUP BY col2
----
-35

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7768
SELECT CAST( NULL AS SIGNED ) * + - col0 AS col2, col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-7768
SELECT CAST ( NULL AS INTEGER ) * + - col0 AS col2, col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
22
NULL
28
NULL
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 89, + col2 ) FROM tab0 cor0 GROUP BY col1
----
89
89

query I rowsort
SELECT + 89 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) <> + col1
----

query I rowsort
SELECT + col0 - col0 * 61 * - 18 / + ( - col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7772
SELECT + col2 * + 22 * col0 FROM tab0 AS cor0 WHERE NOT - CAST( - col2 AS SIGNED ) <> - col1 * + - col0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7772
SELECT + col2 * + 22 * col0 FROM tab0 AS cor0 WHERE NOT - CAST ( - col2 AS INTEGER ) <> - col1 * + - col0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 42 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - ( col2 ) * - + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 WHERE NOT 31 BETWEEN NULL AND col1 GROUP BY col1
----
-6

query I rowsort
SELECT ALL - 44 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query II rowsort
SELECT ALL + col1 * - - 88 + + col2 + col1 * + NULLIF ( - col1, - col2 ) AS col1, + col2 FROM tab1 GROUP BY col1, col2
----
1812
45
2007
71
500
8

query I rowsort
SELECT ALL - col0 FROM tab2 WHERE NOT col0 + - 9 * 28 <> - col0 * - + 92 AND ( NULL > - 44 * + - col1 * col1 * 38 ) GROUP BY col0 HAVING NULL IN ( - col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 + 88 col0 FROM tab2 GROUP BY col1 HAVING NULL >= + col1 + col0
----

query I rowsort
SELECT 37 + ( - 62 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT ( - 31 ) FROM tab2 cor0 GROUP BY col1
----
-31
-31
-31

query I rowsort
SELECT - col2 AS col0 FROM tab2 WHERE NOT - - col0 IS NOT NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7784
SELECT ALL + + 84 DIV col2 + + col2 * - + 64 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1533
-2430
-5055

skipif mysql # not compatible
query I rowsort label-7784
SELECT ALL + + 84 / col2 + + col2 * - + 64 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1533
-2430
-5055

query I rowsort
SELECT DISTINCT 64 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col0
----
64

query I rowsort
SELECT + + ( + col2 ) FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - 74 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-74
-74
-74

query II rowsort
SELECT ALL + col2 AS col0, col2 AS col1 FROM tab1 AS cor0 WHERE NOT + 35 / + - col2 = col1 * - 78 GROUP BY col2
----
45
45
71
71
8
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7789
SELECT - col0 / CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7789
SELECT - col0 / CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col0, col0, col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-7790
SELECT ( + 67 ) DIV + + ( - col0 ) + - col0 FROM tab2 GROUP BY col0, col0
----
-19
-91
-92

skipif mysql # not compatible
query I rowsort label-7790
SELECT ( + 67 ) / + + ( - col0 ) + - col0 FROM tab2 GROUP BY col0, col0
----
-19
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7791
SELECT + 96 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT CAST( + - 96 AS SIGNED ) IS NULL
----
96
96
96

skipif mysql # not compatible
query I rowsort label-7791
SELECT + 96 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT CAST ( + - 96 AS INTEGER ) IS NULL
----
96
96
96

query I rowsort
SELECT ALL + 63 * - 75 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-4725
-4725
-4725

query I rowsort
SELECT DISTINCT + 95 * - col2 FROM tab1 GROUP BY col2
----
-4275
-6745
-760

query I rowsort
SELECT DISTINCT + 40 FROM tab0 GROUP BY col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING - - 90 IS NOT NULL
----
22
28
82

query I rowsort
SELECT + col2 * - 83 FROM tab0 AS cor0 GROUP BY col2
----
-1992
-3154
-6557

query I rowsort
SELECT + col0 * col0 + + 65 + col0 * + col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
16627
16993
515

query I rowsort
SELECT - + 92 FROM tab2 AS cor0 GROUP BY col2
----
-92
-92
-92

query I rowsort
SELECT - 36 * - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-1584
-2052
-216

query I rowsort
SELECT - - col2 * + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3306
6162
7482

query I rowsort
SELECT ALL + col1 - - col1 + - + 80 - - + 44 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-24
52
78

query II rowsort
SELECT col0 * - 81 * 51 AS col0, - 69 + col2 * 36 + col2 * + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2, col1
----
-107406
4829
-177633
1827
-342873
4453

query II rowsort
SELECT ALL col0 AS col1, + col0 FROM tab2 WHERE NULL > NULL GROUP BY col0 HAVING NOT NULL NOT BETWEEN + 39 AND - AVG ( ALL col2 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7804
SELECT 31 + - 97 * - col1 DIV + col1 AS col0 FROM tab2 GROUP BY col1
----
128
128
128

skipif mysql # not compatible
query I rowsort label-7804
SELECT 31 + - 97 * - col1 / + col1 AS col0 FROM tab2 GROUP BY col1
----
128
128
128

query I rowsort
SELECT 81 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL NULLIF ( - col1, - col2 * 93 ) * - col1 - - col1 + - - col1 FROM tab2 GROUP BY col1, col2 HAVING NULL NOT BETWEEN NULL AND - + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7807
SELECT - 45 + col1 + + col2 - - ( - col1 ) * + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7807
SELECT - 45 + col1 + + col2 - - ( - col1 ) * + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col1, col2
----
NULL
NULL
NULL

query II rowsort
SELECT ALL - col0 - + col0 AS col1, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-166
83
-52
26
-86
43

query I rowsort
SELECT + col2 + - 17 FROM tab0 AS cor0 GROUP BY col2
----
21
62
7

query I rowsort
SELECT - 27 FROM tab2 AS cor0 GROUP BY col2
----
-27
-27
-27

query I rowsort
SELECT ALL - col1 + + col1 + - 21 FROM tab2 AS cor0 GROUP BY col1
----
-21
-21
-21

query I rowsort
SELECT DISTINCT 17 AS col0 FROM tab2 GROUP BY col0, col2
----
17

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + - col1 * - col1 * - col1 + + ( - ( - - col1 ) ) FROM tab1 cor0 GROUP BY col1 HAVING + 67 IS NOT NULL
----
-185250
-222
-85228

query I rowsort
SELECT DISTINCT 98 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
98

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 * + - 7 <> NULL
----

query I rowsort
SELECT ALL + 11 - - col2 * - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1433
-565
-6230

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7820
SELECT - - col2, col2 - - col2 * + - CAST( 18 AS SIGNED ) * + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( + 46 ) > NULL
----

skipif mysql # not compatible
query II rowsort label-7820
SELECT - - col2, col2 - - col2 * + - CAST ( 18 AS INTEGER ) * + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( + 46 ) > NULL
----

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - - 58 IS NULL
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL 6 FROM tab2 GROUP BY col1
----
6
6
6

query I rowsort
SELECT ALL + 77 * - 29 FROM tab0 GROUP BY col2
----
-2233
-2233
-2233

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7827
SELECT ALL + CAST( - - 54 AS SIGNED ) / - - col0 - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 68 * 2 + + ( 9 ) + CAST( NULL AS DECIMAL ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7827
SELECT ALL + CAST ( - - 54 AS INTEGER ) / - - col0 - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT 68 * 2 + + ( 9 ) + CAST ( NULL AS REAL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7828
SELECT DISTINCT - CAST( ( - - 16 ) AS SIGNED ) col1 FROM tab0 GROUP BY col2, col2
----
-16

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7828
SELECT DISTINCT - CAST ( ( - - 16 ) AS INTEGER ) col1 FROM tab0 GROUP BY col2, col2
----
-16

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL 14 - 10 AS col0 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( col0 ) GROUP BY col1, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7831
SELECT ALL CAST( + ( - + 68 ) AS SIGNED ) FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-7831
SELECT ALL CAST ( + ( - + 68 ) AS INTEGER ) FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col1 AS col0, + col1 + - 19 FROM tab1 GROUP BY col1
----
44
25
57
38
6
-13

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( + - 31 ) * + 79 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7836
SELECT ALL - col2 AS col0 FROM tab0 WHERE ( NULL ) NOT IN ( CAST( 41 AS SIGNED ) ) GROUP BY col2 HAVING NOT ( col2 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-7836
SELECT ALL - col2 AS col0 FROM tab0 WHERE ( NULL ) NOT IN ( CAST ( 41 AS INTEGER ) ) GROUP BY col2 HAVING NOT ( col2 ) IS NULL
----

query I rowsort
SELECT 95 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab2 GROUP BY col2, col0 HAVING 24 > ( col2 )
----

query I rowsort
SELECT + 21 AS col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) < - 19
----

query I rowsort
SELECT - col2 * col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL + col0 * col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT 66 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NULL
----
1716
2838
5478

query I rowsort
SELECT DISTINCT 58 FROM tab0 AS cor0 GROUP BY col0 HAVING + col0 >= + NULLIF ( + col0, col0 )
----

query I rowsort
SELECT ALL + 85 FROM tab0 GROUP BY col2
----
85
85
85

query I rowsort
SELECT ALL + 75 FROM tab0 cor0 GROUP BY col1
----
75
75

query I rowsort
SELECT + + 94 * + col0 + 12 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
2456
4054
7814

query I rowsort
SELECT DISTINCT col1 - col1 FROM tab0 GROUP BY col1
----
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7848
SELECT ALL - CAST( NULL AS SIGNED ) + - col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7848
SELECT ALL - CAST ( NULL AS INTEGER ) + - col0 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT col2 FROM tab2 WHERE NOT - col1 + 58 * 76 BETWEEN 76 AND NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT 50 FROM tab2 GROUP BY col0
----
50

query I rowsort
SELECT ALL - 24 * - 49 FROM tab1 GROUP BY col2, col2
----
1176
1176
1176

query I rowsort
SELECT - 68 + ( 24 ) FROM tab0 WHERE NULL IN ( - 35, col1 ) GROUP BY col2, col0, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7853
SELECT 92 DIV - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING + col2 IS NOT NULL
----
-1
-2
-3

skipif mysql # not compatible
query I rowsort label-7853
SELECT 92 / - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING + col2 IS NOT NULL
----
-1
-2
-3

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - col2 < NULL
----

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col2 HAVING NOT - col2 IS NOT NULL
----

query II rowsort
SELECT DISTINCT - + 57 AS col1, col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-57
24
-57
38
-57
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7857
SELECT + col2 col2 FROM tab1 GROUP BY col2, col0 HAVING NOT - - NULLIF ( + - col2, CAST( NULL AS SIGNED ) * - col0 ) * - ( + col2 ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7857
SELECT + col2 col2 FROM tab1 GROUP BY col2, col0 HAVING NOT - - NULLIF ( + - col2, CAST ( NULL AS INTEGER ) * - col0 ) * - ( + col2 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + ( - col1 ) AS col2 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col2 * + 96 AS col1 FROM tab2 GROUP BY col2 HAVING + 58 - - - 59 <> NULL
----

query II rowsort
SELECT DISTINCT col1, col1 FROM tab2 GROUP BY col0, col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( ( col1 ) ) col2 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 * col0 AS col1 FROM tab2 GROUP BY col2, col0, col0 HAVING NOT + 13 * - col2 IS NULL
----
1305
5336
7189

query I rowsort
SELECT ALL 88 * + 70 AS col2 FROM tab1 GROUP BY col0, col0
----
6160
6160
6160

query I rowsort
SELECT - col1 AS col2 FROM tab0 WHERE ( - col1 ) IN ( ( - col0 ) ) GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * - 53 AS col1 FROM tab2 GROUP BY col0
----
-4823
-4876
-795

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT 30 + - col2 FROM tab0 GROUP BY col2
----
-49
-8
6

query I rowsort
SELECT + col1 AS col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL BETWEEN ( 91 ) AND - 67
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NOT NULL IN ( - 9 ) GROUP BY col2, col2
----

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col2, col1 HAVING col2 IS NULL
----

query I rowsort
SELECT + 14 * - ( col1 ) + + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col2 + 52 FROM tab2 GROUP BY col2
----
-27
-35
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-7873
SELECT ALL 7 DIV - ( + 49 ) * col1 AS col0 FROM tab2 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7873
SELECT ALL 7 / - ( + 49 ) * col1 AS col0 FROM tab2 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 60 col2 FROM tab1 AS cor0 GROUP BY col0
----
60
60
60

query I rowsort
SELECT - - col1 + - + 15 * + col1 * + 77 + + 11 FROM tab0 AS cor0 GROUP BY col1, col1
----
-93463
11

query I rowsort
SELECT ALL - col1 - - col2 * - - col2 * - - 99 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
332995
617800
749270

query I rowsort
SELECT + col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + - col1 * + - col1 + col1 + + col1 * - 36 FROM tab0 AS cor0 GROUP BY col1
----
0
3726

query II rowsort
SELECT ALL - col2 AS col0, col2 + + col2 + - + col2 FROM tab1 cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7880
SELECT - - col2 + + - CAST( NULL AS SIGNED ) * - - col2 col0 FROM tab0 WHERE NULL IS NULL GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-7880
SELECT - - col2 + + - CAST ( NULL AS INTEGER ) * - - col2 col0 FROM tab0 WHERE NULL IS NULL GROUP BY col2
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-7881
SELECT DISTINCT - ( - - col2 ) DIV + - 41 + - col2 + + - 29 FROM tab1 AS cor0 GROUP BY col1, col2
----
-37
-73
-99

skipif mysql # not compatible
query I rowsort label-7881
SELECT DISTINCT - ( - - col2 ) / + - 41 + - col2 + + - 29 FROM tab1 AS cor0 GROUP BY col1, col2
----
-37
-73
-99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7882
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT + CAST( + + 42 AS SIGNED ) IS NULL
----
22
28
82

skipif mysql # not compatible
query I rowsort label-7882
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT + CAST ( + + 42 AS INTEGER ) IS NULL
----
22
28
82

query I rowsort
SELECT 42 + - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-49
-50
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7884
SELECT DISTINCT + - col2 * 38 + 92 + + col1 * - col2 * - + 72 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + + AVG ( ALL CAST( NULL AS SIGNED ) ) * 24 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
query I rowsort label-7884
SELECT DISTINCT + - col2 * 38 + 92 + + col1 * - col2 * - + 72 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + + AVG ( ALL CAST ( NULL AS INTEGER ) ) * 24 NOT BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7885
SELECT + - 82 DIV - 13 + + col0 + + 48 + + + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
110
218
98

skipif mysql # not compatible
query I rowsort label-7885
SELECT + - 82 / - 13 + + col0 + + 48 + + + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
110
218
98

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7887
SELECT col0 * - 30 - col0 + - + col0 + - col0 / + 13 + - ( NULLIF ( 91, - ( + col0 ) ) ) + - + CAST( NULL AS SIGNED ) FROM tab2 cor0 GROUP BY col0 HAVING ( NOT - col0 IS NOT NULL )
----

skipif mysql # not compatible
query I rowsort label-7887
SELECT col0 * - 30 - col0 + - + col0 + - col0 / + 13 + - ( NULLIF ( 91, - ( + col0 ) ) ) + - + CAST ( NULL AS INTEGER ) FROM tab2 cor0 GROUP BY col0 HAVING ( NOT - col0 IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 * - col2 + - + col2 + - col2 * - 88 * + col2 / - col2 * - col2, col2 + - + col2 col2 FROM tab1 GROUP BY col2 HAVING - 89 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7889
SELECT + col0 DIV col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7889
SELECT + col0 / col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1

query II rowsort
SELECT 6, col0 + col0 + col0 AS col1 FROM tab2 GROUP BY col2, col0
----
6
273
6
276
6
45

query I rowsort
SELECT ALL + col1 + - 98 AS col0 FROM tab0 GROUP BY col1, col1
----
-17
-98

query I rowsort
SELECT ALL + 88 * col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( + col0 + + ( - col1 ) ) IS NOT NULL
----
3608
5192
5368

query I rowsort
SELECT DISTINCT - 99 AS col2 FROM tab1 GROUP BY col1, col1
----
-99

query I rowsort
SELECT + col1 * - 11 + + col1 + - col1 * col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING NOT + col0 * - col2 - - col2 + - + 56 + 99 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 26 FROM tab2 AS cor0 GROUP BY col2
----
-26

query I rowsort
SELECT DISTINCT - 24 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-24

query I rowsort
SELECT ALL - 45 + - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-126
-45

query I rowsort
SELECT - 41 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-41
-41
-41

query I rowsort
SELECT DISTINCT - col2 * - + col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query II rowsort
SELECT ALL col1, col1 AS col0 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

onlyif mysql # DIV for integer division: 
query I rowsort label-7901
SELECT DISTINCT - - col0 + - col0 - + + 94 DIV col0 * + ( - 96 ) + col0 - - col0 FROM tab1 AS cor0 GROUP BY col0
----
260
344
428

skipif mysql # not compatible
query I rowsort label-7901
SELECT DISTINCT - - col0 + - col0 - + + 94 / col0 * + ( - 96 ) + col0 - - col0 FROM tab1 AS cor0 GROUP BY col0
----
260
344
428

query I rowsort
SELECT + ( 29 ) AS col2 FROM tab2 AS cor0 WHERE 88 IS NULL GROUP BY col0
----

query I rowsort
SELECT - 12 FROM tab2 GROUP BY col2
----
-12
-12
-12

query I rowsort
SELECT ( + + col2 ) * + - col2 AS col2 FROM tab2 GROUP BY col2 HAVING 91 IS NOT NULL
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT - col2 + col2 * - 21 FROM tab1 GROUP BY col1, col2
----
-1562
-176
-990

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7906
SELECT ALL - CAST( col1 AS SIGNED ) * col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

skipif mysql # not compatible
query I rowsort label-7906
SELECT ALL - CAST ( col1 AS INTEGER ) * col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT 81 * col0 AS col2 FROM tab2 GROUP BY col0
----
1215
7371
7452

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-7908
SELECT + 64 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN NULL AND - CAST( 17 AS SIGNED ) + - + ( - CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-7908
SELECT + 64 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN NULL AND - CAST ( 17 AS INTEGER ) + - + ( - CAST ( NULL AS REAL ) )
----

query I rowsort
SELECT + + ( - + col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7910
SELECT DISTINCT CAST( NULL AS SIGNED ) * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-7910
SELECT DISTINCT CAST ( NULL AS INTEGER ) * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 * - col2 - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3422
-6320
-7656

query I rowsort
SELECT - 6 FROM tab1 GROUP BY col1, col0
----
-6
-6
-6

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + col0 * - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
-1825
-597
-6851

query I rowsort
SELECT + 30 FROM tab0 AS cor0 GROUP BY col2, col1
----
30
30
30

query I rowsort
SELECT DISTINCT - ( - 63 ) + + + 11 * + + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT - - 75 IS NOT NULL
----

query I rowsort
SELECT + + col0 + - - 48 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - 85 IS NULL
----

query I rowsort
SELECT - + 41 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-41
-41
-41

query II rowsort
SELECT + col0 * + ( - col0 ) * + 97 AS col2, - 19 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 79 * + + 82 FROM tab2 GROUP BY col2
----
-6478

query I rowsort
SELECT 37 + + col0 + + col0 AS col1 FROM tab2 GROUP BY col0
----
219
221
67

query I rowsort
SELECT 16 FROM tab0 cor0 GROUP BY col0
----
16
16
16

query I rowsort
SELECT - - col1 * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT 5 FROM tab0 cor0 GROUP BY col0
----
5
5
5

query I rowsort
SELECT ALL 7 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-7926
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 NOT BETWEEN - CAST( + 54 AS DECIMAL ) AND + + 93
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-7926
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 NOT BETWEEN - CAST ( + 54 AS REAL ) AND + + 93
----
-24
-38
-79

query II rowsort
SELECT 2 AS col0, + 13 FROM tab2 GROUP BY col1
----
2
13
2
13
2
13

query I rowsort
SELECT + - 37 FROM tab2 AS cor0 GROUP BY col0, col0
----
-37
-37
-37

query I rowsort
SELECT 87 FROM tab0 AS cor0 GROUP BY col0, col0
----
87
87
87

query I rowsort
SELECT ALL col1 * col1 * - col1 FROM tab2 GROUP BY col1, col1
----
-205379
-226981
-68921

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 + + col0 * + 19 col2 FROM tab1 AS cor0 GROUP BY col0
----
1640
440
560

query I rowsort
SELECT DISTINCT 53 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + - 16 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-16
-16
-16

query I rowsort
SELECT - ( - 56 ) AS col0 FROM tab2 GROUP BY col2
----
56
56
56

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT 2 NOT BETWEEN col2 + + 50 AND NULL
----

query I rowsort
SELECT DISTINCT + 89 AS col1 FROM tab0 GROUP BY col2
----
89

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
45
71
8

query II rowsort
SELECT + col0, + 42 * ( - col0 ) - - col0 * + col0 + + col0 FROM tab2 GROUP BY col0
----
15
-390
91
4550
92
4692

query I rowsort
SELECT - 92 + + - col2 FROM tab2 GROUP BY col2
----
-150
-171
-179

query I rowsort
SELECT + - 88 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-88
-88
-88

query I rowsort
SELECT DISTINCT + col1 * - col1 * + col2 FROM tab0 GROUP BY col1, col1, col2, col1
----
-157464
0

query II rowsort
SELECT - ( - col2 ) AS col0, col2 / + NULLIF ( - 34, + col2 ) + - col2 FROM tab0 GROUP BY col2 HAVING ( - 99 ) IS NULL
----

query I rowsort
SELECT DISTINCT + 77 + - col1 + col1 * col1 FROM tab1 GROUP BY col1, col1
----
107
1969
3269

query II rowsort
SELECT - col2 * col2 AS col2, - col2 * col2 FROM tab2 GROUP BY col2
----
-3364
-3364
-6241
-6241
-7569
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 36 * + + 81 col1, + col2 FROM tab1 GROUP BY col2
----
2916
45
2916
71
2916
8

query I rowsort
SELECT DISTINCT - 96 FROM tab2 GROUP BY col0, col0
----
-96

query II rowsort
SELECT DISTINCT - + col0 AS col0, ( - 83 ) FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-83
-91
-83
-92
-83

query I rowsort
SELECT DISTINCT + 17 FROM tab2 AS cor0 GROUP BY col2
----
17

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 60 col0 FROM tab1 GROUP BY col1, col0
----
60
60
60

query I rowsort
SELECT ALL - ( + + col1 ) * - 17 * + 41 FROM tab1 GROUP BY col1, col1
----
30668
39729
4182

query I rowsort
SELECT DISTINCT col0 + - + COALESCE ( - 77, 64 ) FROM tab1 AS cor0 GROUP BY col0, col0
----
105
159
99

query I rowsort
SELECT col0 - + ( - 85 ) AS col1 FROM tab2 AS cor0 WHERE NOT + 25 / - - col2 NOT BETWEEN NULL AND NULL GROUP BY col0, col1
----

query I rowsort
SELECT + col2 * - + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 82 col0 FROM tab2 AS cor0 GROUP BY col2
----
82
82
82

query I rowsort
SELECT + + 8 * + col2 * - col2 - - col2 * + col2 + 78 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-10030
-3954
-43609

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7957
SELECT + 90 / + CAST( NULL AS SIGNED ) / - 65 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-7957
SELECT + 90 / + CAST ( NULL AS INTEGER ) / - 65 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT - - ( + - col0 ) + col0 FROM tab2 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
22
28
82

query I rowsort
SELECT + - AVG ( - 83 ) FROM tab2 AS cor0 WHERE + 33 > NULL GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT - + 44 FROM tab1 cor0 GROUP BY col2
----
-44

query I rowsort
SELECT ( - col0 ) FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( - 10 / ( + 90 ) ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT - NULLIF ( - col2, - col1 + + 76 ) + col1 FROM tab2 GROUP BY col1, col2
----
138
148
99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING col1 <= NULL
----

query I rowsort
SELECT DISTINCT col1 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
3772
5369
915

query I rowsort
SELECT ALL 23 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col2 HAVING + col2 = - 41
----

query II rowsort
SELECT ALL 51 AS col2, + 4 * + col1 FROM tab0 GROUP BY col1 HAVING NULL >= NULL
----

query II rowsort
SELECT + col0, ( - 96 ) FROM tab0 AS cor0 GROUP BY col0
----
26
-96
43
-96
83
-96

query II rowsort
SELECT col1 AS col0, 57 + + + 39 FROM tab2 GROUP BY col1
----
41
96
59
96
61
96

query I rowsort
SELECT - - AVG ( DISTINCT + col1 ) FROM tab2 cor0 GROUP BY col2, col1, col0 HAVING - col0 > NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT col1 + - ( col1 ) AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0

query I rowsort
SELECT ALL col2 FROM tab2 cor0 GROUP BY col2 HAVING col2 >= + + 10
----
58
79
87

query I rowsort
SELECT ALL 78 FROM tab2 cor0 GROUP BY col2
----
78
78
78

query I rowsort
SELECT - 89 AS col0 FROM tab2 GROUP BY col1
----
-89
-89
-89

query I rowsort
SELECT + col1 * col1 * + 57 FROM tab1 GROUP BY col1
----
110352
185193
2052

query I rowsort
SELECT - + 67 + + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-39
-45
15

query I rowsort
SELECT ALL col0 * - + ( - - col2 ) AS col0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-1032
-2054
-3154

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col2, col2, col1 HAVING ( 48 ) <> ( NULL )
----

query I rowsort
SELECT DISTINCT + col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING + COALESCE ( - + col1, + AVG ( ALL - col1 ), - 96 ) IS NOT NULL
----
0
81

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query II rowsort
SELECT - 68 AS col0, col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT 16 + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
42
59
99

query I rowsort
SELECT - 62 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7988
SELECT ALL - CAST( - + col1 AS SIGNED ), col1 FROM tab2 AS cor0 WHERE - col1 IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-7988
SELECT ALL - CAST ( - + col1 AS INTEGER ), col1 FROM tab2 AS cor0 WHERE - col1 IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - ( + - col0 ) FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 + - col1 col0 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 * + 4 - ( 34 ) FROM tab0 GROUP BY col1
----
-34
290

query I rowsort
SELECT DISTINCT - + 29 AS col2 FROM tab1 WHERE NOT col0 / - - col2 IS NULL GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col2 AS col2 FROM tab0 GROUP BY col2, col0
----
-1032
-2054
-3154

query I rowsort
SELECT ALL - col1 * + 75 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-3075
-4425
-4575

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + 58 + + + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
2419
3481
3599

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7996
SELECT - + 19, CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-19
NULL
-19
NULL
-19
NULL

skipif mysql # not compatible
query II rowsort label-7996
SELECT - + 19, CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-19
NULL
-19
NULL
-19
NULL

query I rowsort
SELECT DISTINCT col1 * - - 5 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
-32805
0

query I rowsort
SELECT ALL - ( - + 59 ) FROM tab0 AS cor0 GROUP BY col0
----
59
59
59

query II rowsort
SELECT ALL 90, - col2 AS col2 FROM tab1 GROUP BY col2
----
90
-45
90
-71
90
-8

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT 21 AS col1 FROM tab1 GROUP BY col2
----
21
21
21

query II rowsort
SELECT ( col2 ), + 69 + - + 74 AS col1 FROM tab2 GROUP BY col2
----
58
-5
79
-5
87
-5

query I rowsort
SELECT + + col0 + - 33 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1, col0 HAVING ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT + 96 + col2 AS col2 FROM tab1 GROUP BY col2
----
104
141
167

query I rowsort
SELECT + 14 FROM tab2 AS cor0 GROUP BY col1
----
14
14
14

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8006
SELECT ALL - col2 + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 52 <> NULL
----

skipif mysql # not compatible
query I rowsort label-8006
SELECT ALL - col2 + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + 52 <> NULL
----

query I rowsort
SELECT - ( + - col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col0 - + + 59 FROM tab2 GROUP BY col2, col0 HAVING col2 IS NULL
----

query I rowsort
SELECT 84 + - col0 FROM tab2 GROUP BY col0
----
-7
-8
69

query I rowsort
SELECT 7 AS col2 FROM tab1 GROUP BY col0, col2
----
7
7
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 83 + - col2 col1 FROM tab1 cor0 GROUP BY col2
----
-128
-154
-91

query II rowsort
SELECT DISTINCT + - col0 * + col0, 12 * - 44 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-225
-528
-8281
-528
-8464
-528

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL >= - COALESCE ( - col0, - col0 )
----

query I rowsort
SELECT - + 42 AS col0 FROM tab0 WHERE NOT NULL NOT BETWEEN + col2 * + 41 * + col2 AND NULL GROUP BY col2, col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 61 - col2 col2 FROM tab2 GROUP BY col2
----
-18
-26
3

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING ( NOT ( NULL ) = - + col2 * - 43 )
----

query II rowsort
SELECT DISTINCT col2 AS col1, - 8 AS col1 FROM tab1 GROUP BY col2, col2
----
45
-8
71
-8
8
-8

query I rowsort
SELECT + - col0 - - col0 FROM tab1 cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT - - COALESCE ( + ( + 48 ), + + col2, - + ( - 87 ) ) + + ( + col2 ) FROM tab0 WHERE 40 IS NOT NULL GROUP BY col2, col2 HAVING NULL IN ( + 56 * - 92 * + col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8022
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY col0, col0, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8022
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY col0, col0, col1
----
NULL

query I rowsort
SELECT ALL 38 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
38
38
38

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2, col0 HAVING NULL > + col0
----

query I rowsort
SELECT DISTINCT - 29 + - - col2 FROM tab2 GROUP BY col2, col2
----
29
50
58

query I rowsort
SELECT - col2 AS col0 FROM tab0 WHERE - - 35 IS NOT NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - 34 * 20 FROM tab2 GROUP BY col0
----
-680
-680
-680

query I rowsort
SELECT - + col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING + 33 IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-8029
SELECT DISTINCT col2 AS col2, + 80 DIV + + col1 FROM tab2 GROUP BY col1, col2
----
58
1
79
1
87
1

skipif mysql # not compatible
query II rowsort label-8029
SELECT DISTINCT col2 AS col2, + 80 / + + col1 FROM tab2 GROUP BY col1, col2
----
58
1
79
1
87
1

query I rowsort
SELECT ALL col0 + 58 * - 75 AS col1 FROM tab1 WHERE ( ( col0 ) IS NULL ) GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8031
SELECT DISTINCT - col2 DIV - 31 + + 44 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
44
45
46

skipif mysql # not compatible
query I rowsort label-8031
SELECT DISTINCT - col2 / - 31 + + 44 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
44
45
46

query I rowsort
SELECT - 68 FROM tab0 GROUP BY col0, col2
----
-68
-68
-68

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8033
SELECT ALL - CAST( NULL AS DECIMAL ) FROM tab0 GROUP BY col2, col1 HAVING - 76 IS NULL
----

skipif mysql # not compatible
query I rowsort label-8033
SELECT ALL - CAST ( NULL AS REAL ) FROM tab0 GROUP BY col2, col1 HAVING - 76 IS NULL
----

query I rowsort
SELECT - - 10 + + ( 8 ) FROM tab0 WHERE NULL IS NULL GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-8035
SELECT DISTINCT 41 FROM tab1 AS cor0 WHERE NOT col0 NOT IN ( + col0 + + col2 * COALESCE ( + CAST( + - COALESCE ( ( 55 ), + CAST( NULL AS DECIMAL ) ) AS SIGNED ), - col0, - col1 ) * 0 ) GROUP BY col0
----
41

skipif mysql # not compatible
query I rowsort label-8035
SELECT DISTINCT 41 FROM tab1 AS cor0 WHERE NOT col0 NOT IN ( + col0 + + col2 * COALESCE ( + CAST ( + - COALESCE ( ( 55 ), + CAST ( NULL AS REAL ) ) AS INTEGER ), - col0, - col1 ) * 0 ) GROUP BY col0
----
41

query I rowsort
SELECT ALL 43 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL = - 38
----

query I rowsort
SELECT ALL - 89 * - col2 FROM tab0 GROUP BY col2
----
2136
3382
7031

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 * - COALESCE ( - 24, + 44 ) + + + col2 + NULLIF ( + + ( - 41 ), + col2 - NULLIF ( col2, - 24 ) ) FROM tab2 AS cor0 GROUP BY col2
----
-1375
-1858
-2042

query I rowsort
SELECT ALL col1 * - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 - - 59 FROM tab0 GROUP BY col0, col1, col2
----
138
83
97

query I rowsort
SELECT DISTINCT + 19 FROM tab2 WHERE NOT - col2 / col0 <> NULL GROUP BY col0, col0
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( 39 IS NOT NULL )
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST( NULL AS SIGNED ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST( NULL AS DECIMAL ) > ( - + 7 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST ( NULL AS INTEGER ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST ( NULL AS REAL ) > ( - + 7 )
----

query I rowsort
SELECT 91 FROM tab2 GROUP BY col2
----
91
91
91

query I rowsort
SELECT 95 FROM tab1 GROUP BY col0
----
95
95
95

query I rowsort
SELECT DISTINCT 12 + + col0 AS col2 FROM tab0 GROUP BY col0
----
38
55
95

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - 3 + + col1 * - col1 + - col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
-1977
-3303
-39

query I rowsort
SELECT DISTINCT + ( + ( col1 ) ) FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-8052
SELECT + + col1 + - 23 + + col1 - + col2 DIV 17 FROM tab2 cor0 GROUP BY col2, col1
----
56
91
94

skipif mysql # not compatible
query I rowsort label-8052
SELECT + + col1 + - 23 + + col1 - + col2 / 17 FROM tab2 cor0 GROUP BY col2, col1
----
56
91
94

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 WHERE NOT ( - col1 + + col2 ) NOT BETWEEN + col0 AND + col2 GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + - 73 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 53 * + 8 + col1 * + 13 - - COALESCE ( + 83, - col0, - col1 * + 59 ) AS col2 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----
1560
507

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0, col0, col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT AVG ( - col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( col2 ) < NULL
----

query I rowsort
SELECT ALL 25 FROM tab2 GROUP BY col2, col0 HAVING NOT ( + + 67 + col0 + - col2 ) IS NOT NULL
----

query I rowsort
SELECT col1 * - + ( - + COALESCE ( + 82, ( - 55 ) ) ) + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + - col1 + + col1 + - - col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8061
SELECT ALL + ( + ( + COALESCE ( CAST( + 0 AS SIGNED ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8061
SELECT ALL + ( + ( + COALESCE ( CAST ( + 0 AS INTEGER ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

query I rowsort
SELECT - AVG ( ALL - - 59 ) AS col1 FROM tab1 cor0 WHERE NOT ( NULL ) NOT IN ( - col2 ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL >= ( ( col0 ) )
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT - col1 + - - ( + col2 ) FROM tab1 GROUP BY col1, col0, col2 HAVING NOT 68 + + ( - col2 ) + col1 BETWEEN col1 + - col2 * + col0 AND - col0 * + col1 AND ( NULL ) > NULL
----

query I rowsort
SELECT 36 FROM tab1 WHERE NULL NOT BETWEEN NULL AND + col0 * col2 AND col1 IS NULL GROUP BY col1
----

query II rowsort
SELECT ALL col2, - col2 - + + col2 FROM tab2 AS cor0 GROUP BY col2
----
58
-116
79
-158
87
-174

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) <= NULL GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8069
SELECT DISTINCT + CAST( NULL AS SIGNED ) + + 63 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) <> + col1 GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-8069
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + + 63 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) <> + col1 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8070
SELECT + col2 * NULLIF ( 31 / CAST( NULL AS SIGNED ), - col2 ) AS col0 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8070
SELECT + col2 * NULLIF ( 31 / CAST ( NULL AS INTEGER ), - col2 ) AS col0 FROM tab1 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NOT 10 + - 88 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8072
SELECT ALL + 64 * + col1 + - col1 DIV col1 AS col0 FROM tab2 GROUP BY col1, col1
----
2623
3775
3903

skipif mysql # not compatible
query I rowsort label-8072
SELECT ALL + 64 * + col1 + - col1 / col1 AS col0 FROM tab2 GROUP BY col1, col1
----
2623
3775
3903

query I rowsort
SELECT ALL - 27 * + col1 + col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-2106
0

onlyif mysql # DIV for integer division: 
query I rowsort label-8074
SELECT DISTINCT col1 DIV col1 + col1 * col1 FROM tab2 GROUP BY col1
----
1682
3482
3722

skipif mysql # not compatible
query I rowsort label-8074
SELECT DISTINCT col1 / col1 + col1 * col1 FROM tab2 GROUP BY col1
----
1682
3482
3722

query I rowsort
SELECT ALL + 89 - - col1 * - col1 AS col0 FROM tab2 GROUP BY col1
----
-1592
-3392
-3632

query I rowsort
SELECT col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT 6 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
6
6
6

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT col1 IS NULL
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8079
SELECT - col2 FROM tab2 GROUP BY col2 HAVING + CAST( NULL AS SIGNED ) > NULL
----

skipif mysql # not compatible
query I rowsort label-8079
SELECT - col2 FROM tab2 GROUP BY col2 HAVING + CAST ( NULL AS INTEGER ) > NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT 31 FROM tab1 GROUP BY col1
----
31

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8082
SELECT col0 / - 59 + 86 FROM tab1 WHERE ( NULL ) BETWEEN ( 60 ) AND ( 71 ) GROUP BY col0 HAVING ( CAST( NULL AS DECIMAL ) / col0 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8082
SELECT col0 / - 59 + 86 FROM tab1 WHERE ( NULL ) BETWEEN ( 60 ) AND ( 71 ) GROUP BY col0 HAVING ( CAST ( NULL AS REAL ) / col0 ) IS NULL
----

query I rowsort
SELECT ALL - col2 * 29 AS col1 FROM tab0 GROUP BY col2
----
-1102
-2291
-696

query I rowsort
SELECT - 12 AS col0 FROM tab2 GROUP BY col2
----
-12
-12
-12

query I rowsort
SELECT - 3 AS col1 FROM tab0 GROUP BY col0
----
-3
-3
-3

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( col0 ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col1 * col1 FROM tab0 WHERE NOT ( 43 ) IS NULL GROUP BY col1
----
-6561
0

query I rowsort
SELECT 15 FROM tab0 GROUP BY col2
----
15
15
15

query I rowsort
SELECT + 4 + + col2 FROM tab2 AS cor0 WHERE NOT ( + 75 / - col2 + + col2 * col0 ) NOT BETWEEN NULL AND col2 GROUP BY col2
----

query I rowsort
SELECT - 49 AS col0 FROM tab2 GROUP BY col1
----
-49
-49
-49

onlyif mysql # DIV for integer division: 
query I rowsort label-8091
SELECT + 24 DIV - + 89 + + + col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

skipif mysql # not compatible
query I rowsort label-8091
SELECT + 24 / - + 89 + + + col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query II rowsort
SELECT DISTINCT - 47 / col0 * + + col0 * col0, - 94 * + COALESCE ( + 10, + 50 + - col0, col0 ) * - col0 / + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + 76 IS NOT NULL
----

query I rowsort
SELECT ALL - 0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + - 27 FROM tab1 cor0 GROUP BY col0
----
-27
-27
-27

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8095
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING - CAST( NULL AS DECIMAL ) IS NULL
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8095
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING - CAST ( NULL AS REAL ) IS NULL
----
26
43
83

query II rowsort
SELECT col2 AS col2, + col2 / + + 1 FROM tab0 AS cor0 WHERE NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT ALL col2 * - 27 + - 33 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
-1599
-2166
-2382

query I rowsort
SELECT DISTINCT 23 * + col1 FROM tab2 GROUP BY col1
----
1357
1403
943

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8099
SELECT col2 FROM tab2 GROUP BY col2 HAVING ( - 98 ) * - 61 NOT BETWEEN - + CAST( NULL AS SIGNED ) AND NULL
----

skipif mysql # not compatible
query I rowsort label-8099
SELECT col2 FROM tab2 GROUP BY col2 HAVING ( - 98 ) * - 61 NOT BETWEEN - + CAST ( NULL AS INTEGER ) AND NULL
----

query I rowsort
SELECT - ( 86 ) FROM tab0 GROUP BY col2, col1
----
-86
-86
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col2, + 14 AS col0 FROM tab0 AS cor0 WHERE NOT ( NOT + col2 IS NULL ) GROUP BY col1 HAVING NOT 59 IS NULL
----

query I rowsort
SELECT 69 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
69
69
69

query II rowsort
SELECT ALL + col1 * - - 15, + col1 * col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
615
1681
885
3481
915
3721

query I rowsort
SELECT DISTINCT - - 70 * col0 * - + col0 FROM tab2 AS cor0 GROUP BY col0
----
-15750
-579670
-592480

query I rowsort
SELECT ALL - + 84 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-84
-84
-84

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8106
SELECT - - col0 col1 FROM tab2 AS cor0 WHERE NOT ( NOT + col2 BETWEEN - - CAST( NULL AS DECIMAL ) AND + col0 ) GROUP BY col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8106
SELECT - - col0 col1 FROM tab2 AS cor0 WHERE NOT ( NOT + col2 BETWEEN - - CAST ( NULL AS REAL ) AND + col0 ) GROUP BY col0
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING ( NULL IS NULL )
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 82 col1 FROM tab1 WHERE ( NOT NULL NOT BETWEEN col0 AND + ( - 5 ) ) GROUP BY col1, col0
----

query I rowsort
SELECT ALL 57 AS col2 FROM tab2 GROUP BY col1, col2
----
57
57
57

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8110
SELECT 45 - + + CAST( - 26 AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
71
71
71

skipif mysql # not compatible
query I rowsort label-8110
SELECT 45 - + + CAST ( - 26 AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY col0
----
71
71
71

query I rowsort
SELECT ( + 56 ) + + 55 FROM tab1 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - 89 AS col2 FROM tab1 GROUP BY col2, col0
----
-89
-89
-89

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 WHERE NOT - col0 <> col1 + col1 GROUP BY col1 HAVING + col1 IS NOT NULL
----

query I rowsort
SELECT col0 * - + col0 AS col2 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT ( col0 ) AS col2 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT 74 * + col1 + - col0 AS col0 FROM tab2 GROUP BY col0, col1, col0
----
2942
4275
4499

query II rowsort
SELECT DISTINCT ( + + col2 ), + 89 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2 HAVING - - col2 < NULL
----

query I rowsort
SELECT + col2 + - col2 + + 77 * - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-4466
-6083
-6699

query I rowsort
SELECT ALL col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 67 col0 FROM tab2 GROUP BY col0, col0
----
67

query I rowsort
SELECT - 34 FROM tab2 GROUP BY col0
----
-34
-34
-34

query I rowsort
SELECT + col1 + col1 FROM tab2 GROUP BY col1 HAVING - col1 = NULL
----

query I rowsort
SELECT col2 * - col2 FROM tab1 GROUP BY col2 HAVING NULL NOT IN ( - col2 )
----

query I rowsort
SELECT DISTINCT 85 AS col1 FROM tab1 GROUP BY col0, col2 HAVING ( + col2 ) + + + 26 > col0 AND 63 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8129
SELECT CAST( NULL AS SIGNED ) * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8129
SELECT CAST ( NULL AS INTEGER ) * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL 36 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
36
36
36

query I rowsort
SELECT DISTINCT - 41 * 86 FROM tab0 AS cor0 GROUP BY col1
----
-3526

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8133
SELECT - col2 + - - col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NOT NULL = - CAST( NULL AS DECIMAL ) )
----

skipif mysql # not compatible
query I rowsort label-8133
SELECT - col2 + - - col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NOT NULL = - CAST ( NULL AS REAL ) )
----

query I rowsort
SELECT + 60 + - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
141
60
60

query I rowsort
SELECT - 99 AS col1 FROM tab1 GROUP BY col1, col0, col1 HAVING ( NOT ( NULL ) IS NULL )
----

query II rowsort
SELECT DISTINCT + col2 * col2 AS col1, + 7 AS col0 FROM tab1 GROUP BY col2
----
2025
7
5041
7
64
7

query II rowsort
SELECT ALL - + 7, + 85 + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-7
166
-7
85

query I rowsort
SELECT col1 * - col1 + + 57 - - 25 FROM tab0 AS cor0 GROUP BY col1
----
-6479
82

query I rowsort
SELECT col2 * + - col1 FROM tab2 GROUP BY col2, col1
----
-2378
-4661
-5307

query I rowsort
SELECT DISTINCT col2 + - col2 - + - 63 FROM tab1 AS cor0 GROUP BY col2
----
63

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8141
SELECT COALESCE ( + col2, + col2 ) + col2 + - 70 + - + ( + - col2 ) / + - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8141
SELECT COALESCE ( + col2, + col2 ) + col2 + - 70 + - + ( + - col2 ) / + - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT - 58 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
-58
-58

query I rowsort
SELECT - - col1 * - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + col0 + + col0 * - + col0 * + col0 AS col1 FROM tab2 GROUP BY col0
----
-3360
-753480
-778596

query I rowsort
SELECT 63 FROM tab2 AS cor0 GROUP BY col0
----
63
63
63

query I rowsort
SELECT ALL - + COALESCE ( - col2, + + col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * - - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( col0 ) BETWEEN 24 AND NULL
----

query I rowsort
SELECT ALL 83 FROM tab1 GROUP BY col1, col1 HAVING + 53 * ( + col1 ) * 39 * - col1 IS NULL
----

query I rowsort
SELECT - 91 FROM tab1 GROUP BY col2, col2
----
-91
-91
-91

query I rowsort
SELECT DISTINCT col1 / + - 84 AS col2 FROM tab0 GROUP BY col1 HAVING - 40 IS NULL
----

query I rowsort
SELECT DISTINCT - 52 FROM tab1 GROUP BY col2 HAVING NOT 39 + - 89 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NOT 36 + + ( + 75 ) IS NOT NULL GROUP BY col0 HAVING - 56 + col0 + + 87 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 / + col0 - + - col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL BETWEEN + 80 AND - 5
----

query I rowsort
SELECT ALL 11 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT ( NOT + ( - + 98 ) <= NULL )
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT 55 * col1 FROM tab0 GROUP BY col1, col1
----
0
4455

query I rowsort
SELECT + 21 + - col0 + + 96 + - - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND ( col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8159
SELECT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8159
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT 63 FROM tab2 GROUP BY col0
----
63
63
63

onlyif mysql # DIV for integer division: 
query I rowsort label-8161
SELECT - - 67 * - - col2 DIV + + col2 - - col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
131
2092
5108

skipif mysql # not compatible
query I rowsort label-8161
SELECT - - 67 * - - col2 / + + col2 - - col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
131
2092
5108

query I rowsort
SELECT + col1 - 36 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT + 26 IS NULL
----
23
25
5

query I rowsort
SELECT ALL - + 4 * - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING 32 * + col2 IS NOT NULL
----
180
284
32

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8165
SELECT CAST( - 30 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( + col0 ) NOT IN ( 41 * 78 )
----

skipif mysql # not compatible
query I rowsort label-8165
SELECT CAST ( - 30 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( + col0 ) NOT IN ( 41 * 78 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 9 - col1 * 72 * - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL NOT BETWEEN - col2 AND ( NULL )
----

query I rowsort
SELECT 26 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
26
26

query II rowsort
SELECT - 42 + col2, col2 FROM tab2 cor0 GROUP BY col2, col0
----
16
58
37
79
45
87

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2, col2 HAVING NOT - - 37 <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8170
SELECT DISTINCT 62 DIV ( + col2 ) * + 53 + - 82 AS col1 FROM tab2 GROUP BY col2, col2
----
-29
-82

skipif mysql # not compatible
query I rowsort label-8170
SELECT DISTINCT 62 / ( + col2 ) * + 53 + - 82 AS col1 FROM tab2 GROUP BY col2, col2
----
-29
-82

query I rowsort
SELECT - 42 / - col0 AS col0 FROM tab2 WHERE ( NULL > NULL ) GROUP BY col0
----

query II rowsort
SELECT DISTINCT - 66 AS col2, col0 AS col0 FROM tab2 GROUP BY col0 HAVING + COALESCE ( - col0, - 88, - + 55 ) + - col0 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8173
SELECT ( CAST( NULL AS SIGNED ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8173
SELECT ( CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 87 FROM tab1 GROUP BY col0, col2
----
87

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( - col0 ) IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - 94 col2 FROM tab2 cor0 GROUP BY col1
----
-94

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT - AVG ( DISTINCT - col0 ) FROM tab1 WHERE NOT - NULLIF ( 56, - 98 + col0 ) + col0 <= NULL GROUP BY col0
----

query I rowsort
SELECT 90 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 65 IS NULL
----
90
90
90

query I rowsort
SELECT - ( ( col2 ) ) + 59 FROM tab0 GROUP BY col2
----
-20
21
35

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 cor0 GROUP BY col1
----
0
81

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8182
SELECT + CAST( NULL AS SIGNED ) + 91 AS col0 FROM tab0 GROUP BY col2 HAVING NOT ( 29 ) <> NULL
----

skipif mysql # not compatible
query I rowsort label-8182
SELECT + CAST ( NULL AS INTEGER ) + 91 AS col0 FROM tab0 GROUP BY col2 HAVING NOT ( 29 ) <> NULL
----

query I rowsort
SELECT - 70 + + col2 FROM tab2 GROUP BY col2
----
-12
17
9

query I rowsort
SELECT ALL - col0 * 20 + 34 * + col0 AS col2 FROM tab1 GROUP BY col0
----
1148
308
392

query I rowsort
SELECT DISTINCT col0 + 40 FROM tab2 GROUP BY col0
----
131
132
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8186
SELECT DISTINCT + CAST( NULL AS SIGNED ) + col1 * + col1 FROM tab0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8186
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + col1 * + col1 FROM tab0 GROUP BY col1
----
NULL

query I rowsort
SELECT - col2 * col2 FROM tab0 GROUP BY col2, col0 HAVING NOT ( - ( ( 58 ) ) * col0 ) IS NULL
----
-1444
-576
-6241

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col1, col0 HAVING NOT + AVG ( DISTINCT col0 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 88 col2 FROM tab2 WHERE NULL NOT BETWEEN - 28 * + 46 AND col0 GROUP BY col2, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8190
SELECT CAST( NULL AS SIGNED ) * col0 * 68 AS col0 FROM tab0 GROUP BY col2, col0, col0 HAVING NOT ( NULL ) = col0
----

skipif mysql # not compatible
query I rowsort label-8190
SELECT CAST ( NULL AS INTEGER ) * col0 * 68 AS col0 FROM tab0 GROUP BY col2, col0, col0 HAVING NOT ( NULL ) = col0
----

query I rowsort
SELECT ALL - col0 * + col0 - + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1, col0 HAVING + ( col1 ) * col1 IN ( - col0 )
----

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 WHERE NOT - col1 NOT BETWEEN col0 AND NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col2 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - col1 * - 44 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - + 35 FROM tab2 AS cor0 GROUP BY col2 HAVING ( 86 ) IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 cor0 GROUP BY col0, col1, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 * + col0 AS col2 FROM tab2 GROUP BY col2, col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL + 61 AS col0 FROM tab2 GROUP BY col1, col0
----
61
61
61

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT - ( + + col1 ) FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL >= - 99
----

onlyif mysql # DIV for integer division: 
query II rowsort label-8202
SELECT DISTINCT 51 AS col1, col1 DIV col1 + col0 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
51
23
51
29
51
83

skipif mysql # not compatible
query II rowsort label-8202
SELECT DISTINCT 51 AS col1, col1 / col1 + col0 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
51
23
51
29
51
83

query I rowsort
SELECT + 82 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
82
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + 92 col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-92
-92
-92

query II rowsort
SELECT DISTINCT - 49 - + - col2 AS col2, - NULLIF ( + - col2, 8 ) FROM tab1 GROUP BY col2 HAVING NOT NULL <> col2
----

query I rowsort
SELECT DISTINCT - col1 * + - 48 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
1968
2832
2928

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT ( col2 IS NULL )
----
24
38
79

query I rowsort
SELECT - - col2 AS col0 FROM tab0 AS cor0 WHERE NOT - col1 NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT + - 23 FROM tab0 AS cor0 GROUP BY col0, col0
----
-23
-23
-23

query I rowsort
SELECT ALL 9 * + col0 FROM tab1 cor0 GROUP BY col0
----
198
252
738

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT + col1 = + 81 * - + 1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col0 AS col0 FROM tab0 WHERE NOT 64 * + col1 IS NULL GROUP BY col0
----
26
43
83

query II rowsort
SELECT DISTINCT - - col1 AS col0, col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
81
81

query I rowsort
SELECT DISTINCT 81 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
81

query I rowsort
SELECT ALL col2 + - - col0 FROM tab0 GROUP BY col2, col0
----
105
121
67

query I rowsort
SELECT DISTINCT + 32 FROM tab0 WHERE + + ( + col1 ) IS NOT NULL GROUP BY col0
----
32

onlyif mysql # DIV for integer division: 
query I rowsort label-8217
SELECT + col2 * col2 DIV + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8217
SELECT + col2 * col2 / + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT 81 AS col0 FROM tab2 cor0 GROUP BY col2
----
81
81
81

query II rowsort
SELECT ALL ( - - col2 ), col2 AS col0 FROM tab2 cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2 HAVING NOT ( AVG ( + col2 ) ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col1 * - col1 + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 - - COALESCE ( - col2, + col2 ) AS col1 FROM tab2 GROUP BY col2
----
-116
-158
-174

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8226
SELECT - - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING + + col1 <= NULL
----

skipif mysql # not compatible
query I rowsort label-8226
SELECT - - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING + + col1 <= NULL
----

query I rowsort
SELECT DISTINCT + 27 FROM tab0 GROUP BY col0, col2, col1 HAVING NULL IS NULL
----
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8228
SELECT ( - CAST( col1 AS SIGNED ) ) AS col2 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-8228
SELECT ( - CAST ( col1 AS INTEGER ) ) AS col2 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - - col2 * ( 86 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
3870
6106
688

query I rowsort
SELECT DISTINCT - - 2 FROM tab2 AS cor0 GROUP BY col0
----
2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8233
SELECT + col0 * + CAST( NULL AS SIGNED ) FROM tab2 cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8233
SELECT + col0 * + CAST ( NULL AS INTEGER ) FROM tab2 cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + 36 FROM tab0 AS cor0 WHERE NOT NULL <= NULL GROUP BY col0
----

query I rowsort
SELECT + 16 FROM tab1 AS cor0 GROUP BY col1
----
16
16
16

query I rowsort
SELECT DISTINCT + - 42 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-42

query I rowsort
SELECT - 2 * - ( + - col2 ) AS col0 FROM tab0 AS cor0 WHERE col0 IS NOT NULL GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT - col2 + - 25 * - 21 - - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
351
367
409

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8240
SELECT DISTINCT NULLIF ( - ( - 67 ), CAST( NULL AS SIGNED ) ) - + + col1 + + + col1 * col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
3798
5377
921

skipif mysql # not compatible
query I rowsort label-8240
SELECT DISTINCT NULLIF ( - ( - 67 ), CAST ( NULL AS INTEGER ) ) - + + col1 + + + col1 * col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
3798
5377
921

query I rowsort
SELECT DISTINCT + col0 * col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
225
8281
8464

query I rowsort
SELECT col0 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT - - col0 IS NOT NULL
----

query I rowsort
SELECT - 42 FROM tab0 GROUP BY col1
----
-42
-42

query I rowsort
SELECT - col1 * + - 3 * - 99 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 93 FROM tab2 AS cor0 GROUP BY col2, col1
----
93

query I rowsort
SELECT + col0 * 83 FROM tab0 GROUP BY col0, col2 HAVING - - 35 <= - ( - 63 )
----
2158
3569
6889

query II rowsort
SELECT ALL - 93, - ( - col1 ) AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL AND NOT ( 89 * col1 NOT IN ( - 11 ) )
----

query I rowsort
SELECT 44 * - col2 * + col0 FROM tab0 GROUP BY col0, col2
----
-138776
-45408
-90376

query I rowsort
SELECT ALL - ( - col1 ) AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8250
SELECT DISTINCT + + 3 AS col2 FROM tab0 AS cor0 WHERE NOT - 85 NOT IN ( + col1 * - + 35, - 44 ) GROUP BY col1, col2 HAVING CAST( col2 AS SIGNED ) < NULL
----

skipif mysql # not compatible
query I rowsort label-8250
SELECT DISTINCT + + 3 AS col2 FROM tab0 AS cor0 WHERE NOT - 85 NOT IN ( + col1 * - + 35, - 44 ) GROUP BY col1, col2 HAVING CAST ( col2 AS INTEGER ) < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8251
SELECT + col1 DIV - + ( + col0 ) FROM tab2 GROUP BY col1, col0
----
-4
0
0

skipif mysql # not compatible
query I rowsort label-8251
SELECT + col1 / - + ( + col0 ) FROM tab2 GROUP BY col1, col0
----
-4
0
0

query I rowsort
SELECT - col2 AS col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING - col0 + + col0 / + - 72 IS NULL
----

query I rowsort
SELECT + 93 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
93
93
93

query I rowsort
SELECT - col1 * - - 68 + + col1 - + - 13 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query II rowsort
SELECT ALL col1 * + ( + + col1 ) AS col2, col1 * + col1 FROM tab2 GROUP BY col1
----
1681
1681
3481
3481
3721
3721

query I rowsort
SELECT ALL - col0 * 7 + col0 FROM tab2 AS cor0 GROUP BY col0
----
-546
-552
-90

onlyif mysql # DIV for integer division: 
query I rowsort label-8257
SELECT - col0 DIV col0 + ( - 32 ) FROM tab1 AS cor0 GROUP BY col0
----
-33
-33
-33

skipif mysql # not compatible
query I rowsort label-8257
SELECT - col0 / col0 + ( - 32 ) FROM tab1 AS cor0 GROUP BY col0
----
-33
-33
-33

query II rowsort
SELECT col2 AS col0, 95 AS col1 FROM tab1 WHERE NOT - - 3 NOT BETWEEN + col2 * - col0 AND ( + col2 ) GROUP BY col2
----
45
95
71
95
8
95

query I rowsort
SELECT - 46 AS col2 FROM tab1 GROUP BY col0
----
-46
-46
-46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8260
SELECT DISTINCT col0 + - + col0 + + + col0 + + - col0 * col0 * - col0 * + 18 FROM tab2 GROUP BY col0 HAVING NOT + CAST( NULL AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8260
SELECT DISTINCT col0 + - + col0 + + + col0 + + - col0 * col0 * - col0 * + 18 FROM tab2 GROUP BY col0 HAVING NOT + CAST ( NULL AS INTEGER ) IS NULL
----

query I rowsort
SELECT 10 FROM tab2 GROUP BY col1 HAVING NOT - col1 <> ( NULL )
----

query I rowsort
SELECT - 18 * - NULLIF ( - - col2, - + 54 ) FROM tab0 AS cor0 GROUP BY col2
----
1422
432
684

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN + col0 AND + col0 GROUP BY col2, col0
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL = NULL
----

query II rowsort
SELECT - - col1, col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
0
38
0
79
81
24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8266
SELECT + col2 + - CAST( NULL AS SIGNED ) / 11 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING + - ( - - 62 ) NOT BETWEEN + 56 * 2 AND NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8266
SELECT + col2 + - CAST ( NULL AS INTEGER ) / 11 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING + - ( - - 62 ) NOT BETWEEN + 56 * 2 AND NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT ALL 82 AS col1 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8269
SELECT col0 DIV + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8269
SELECT col0 / + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

query I rowsort
SELECT col0 AS col1 FROM tab0 WHERE NOT 85 IS NOT NULL GROUP BY col1, col1, col0
----

query I rowsort
SELECT 16 FROM tab0 GROUP BY col2
----
16
16
16

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + + col2 <= - 42
----
22
28
82

query I rowsort
SELECT 98 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
98
98
98

query I rowsort
SELECT DISTINCT - + 15 - 94 + - 35 * - - ( - col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
1396
2796
801

query I rowsort
SELECT + 71 FROM tab2 cor0 GROUP BY col0
----
71
71
71

query I rowsort
SELECT DISTINCT 86 FROM tab2 GROUP BY col2, col1, col2
----
86

query I rowsort
SELECT DISTINCT col1 + - col1 FROM tab0 GROUP BY col2, col1, col0 HAVING - 90 * - col0 IN ( 23 + - col1 + + col0 + - 51 )
----

query I rowsort
SELECT col2 / + - col2 FROM tab2 GROUP BY col2 HAVING NOT - ( - 21 ) NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT - col1 * - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 89 col2 FROM tab2 GROUP BY col0, col2 HAVING NOT + col2 * + 83 IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING ( NULL BETWEEN + ( + - 53 ) AND NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8283
SELECT DISTINCT - ( - 24 ) col1, - CAST( NULL AS SIGNED ) col1 FROM tab0 GROUP BY col0
----
24
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8283
SELECT DISTINCT - ( - 24 ) col1, - CAST ( NULL AS INTEGER ) col1 FROM tab0 GROUP BY col0
----
24
NULL

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col2 HAVING 82 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8285
SELECT DISTINCT - 68 - - + ( - col1 ) + + AVG ( - col1 ) * - - 56 - - + CAST( NULL AS SIGNED ) / - - col1 AS col2 FROM tab1 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8285
SELECT DISTINCT - 68 - - + ( - col1 ) + + AVG ( - col1 ) * - - 56 - - + CAST ( NULL AS INTEGER ) / - - col1 AS col2 FROM tab1 GROUP BY col1
----
NULL

query I rowsort
SELECT - 47 * col1 * + col1 * + col1 FROM tab2 AS cor0 WHERE NOT + col1 * - + ( ( - - col0 ) ) IS NULL GROUP BY col1, col1
----
-10668107
-3239287
-9652813

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8287
SELECT ALL - CAST( - 85 AS SIGNED ) * - col2 + - col2 * - 76 + - - col2, col2 * + 4 + 84 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULLIF ( 48, ( - AVG ( + 70 ) ) * 1 ) ) IS NULL
----

skipif mysql # not compatible
query II rowsort label-8287
SELECT ALL - CAST ( - 85 AS INTEGER ) * - col2 + - col2 * - 76 + - - col2, col2 * + 4 + 84 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULLIF ( 48, ( - AVG ( + 70 ) ) * 1 ) ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8288
SELECT + col2 * 78 + + - 91 DIV + + col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
1869
2962
6161

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8288
SELECT + col2 * 78 + + - 91 / + + col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
1869
2962
6161

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 AS cor0 WHERE - col1 NOT BETWEEN - + 15 AND + - ( + - NULLIF ( - + col0, - ( + col1 ) ) ) - + col2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - col0 + - col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NULL < NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-8291
SELECT + + 74 * col0 DIV + col0 + - - 47 * - + col0 AS col1, + col0 FROM tab2 AS cor0 GROUP BY col0
----
-4203
91
-4250
92
-631
15

skipif mysql # not compatible
query II rowsort label-8291
SELECT + + 74 * col0 / + col0 + - - 47 * - + col0 AS col1, + col0 FROM tab2 AS cor0 GROUP BY col0
----
-4203
91
-4250
92
-631
15

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - 72 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - 49 NOT BETWEEN ( - 46 ) AND - + 47 + - + col2
----
-72
-72
-72

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * 27 col0 FROM tab0 GROUP BY col1
----
-2187
0

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col1 + 29 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
35
73
86

query I rowsort
SELECT - col0 * 48 * - 8 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
34944
35328
5760

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8297
SELECT 8 + col2 col0 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT + + col2 NOT IN ( - col0 * - col0, + CAST( NULL AS SIGNED ) / + 25, + - col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8297
SELECT 8 + col2 col0 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT + + col2 NOT IN ( - col0 * - col0, + CAST ( NULL AS INTEGER ) / + 25, + - col0 )
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab1 GROUP BY col1, col2, col0 HAVING NOT + col0 - + col0 IS NULL
----
22
28
82

query I rowsort
SELECT col1 * 79 FROM tab2 AS cor0 GROUP BY col1
----
3239
4661
4819

query I rowsort
SELECT ALL - - col1 + + - 14 * - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
615
885
915

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - 40 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
40

query I rowsort
SELECT col2 - + + col1 * - + col1 + + 19 + col2 FROM tab0 GROUP BY col1, col2
----
177
6628
95

query I rowsort
SELECT ALL - 97 FROM tab1 GROUP BY col0 HAVING NULL >= - 88
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8305
SELECT CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8305
SELECT CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 42 FROM tab0 GROUP BY col1 HAVING NULL NOT IN ( - 44 )
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT - + col1 - + 41 + - col1 IS NOT NULL
----

query I rowsort
SELECT - - col2 * + 29 - - col2 AS col2 FROM tab0 WHERE NOT + NULLIF ( col2, + col0 + - col2 + 67 ) IS NULL GROUP BY col1, col2
----
1140
2370
720

query II rowsort
SELECT DISTINCT col1 + + 1 + + 76, col1 AS col1 FROM tab1 GROUP BY col1
----
121
44
134
57
83
6

query II rowsort
SELECT + + 57 + + 33, - 51 + + col0 * - ( + col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1 HAVING NOT 15 IS NULL
----
90
-1647
90
-183
90
-3659

query I rowsort
SELECT DISTINCT - 0 FROM tab1 GROUP BY col0, col0 HAVING NOT + col0 IS NULL
----
0

query II rowsort
SELECT ALL + col0 AS col0, - 92 * + - ( - + col0 ) * + - col1 * - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
0
43
-25955316
83
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 22 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ( + col2 ) * 63 + + - col2 + ( col2 ) AS col0 FROM tab2 cor0 GROUP BY col2
----
3654
4977
5481

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING col1 / - col1 >= ( - - 61 + 26 )
----

query I rowsort
SELECT ALL + 20 * - col1 * + col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL >= - col1 * col1 * + col1
----

query I rowsort
SELECT - + 2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-2
-2

query I rowsort
SELECT - col0 FROM tab1 WHERE + - 71 IN ( 53 - - col0 ) GROUP BY col0 HAVING NOT 81 + + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 83 + + 29 FROM tab2 AS cor0 GROUP BY col0
----
-54

query I rowsort
SELECT ALL 11 AS col1 FROM tab0 GROUP BY col2
----
11
11
11

onlyif mysql # DIV for integer division: 
query I rowsort label-8321
SELECT DISTINCT - 16 DIV col1 * - col1 AS col1 FROM tab1 GROUP BY col1
----
0
12

skipif mysql # not compatible
query I rowsort label-8321
SELECT DISTINCT - 16 / col1 * - col1 AS col1 FROM tab1 GROUP BY col1
----
0
12

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
45
71
8

query I rowsort
SELECT col1 * + col1 + + - 23 AS col0 FROM tab2 cor0 GROUP BY col1, col1
----
1658
3458
3698

query I rowsort
SELECT - 17 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-17
-17
-17

query I rowsort
SELECT DISTINCT + + 49 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 83 - col1 AS col1 FROM tab2 GROUP BY col1
----
22
24
42

query II rowsort
SELECT DISTINCT col2 AS col2, + col2 * - - col2 * - 81 FROM tab0 AS cor0 GROUP BY col2
----
24
-46656
38
-116964
79
-505521

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8328
SELECT ALL - 43 + + CAST( NULL AS SIGNED ) FROM tab1 cor0 WHERE - 88 + - col2 IS NULL GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-8328
SELECT ALL - 43 + + CAST ( NULL AS INTEGER ) FROM tab1 cor0 WHERE - 88 + - col2 IS NULL GROUP BY col0, col2
----

query II rowsort
SELECT ALL col1 AS col2, - 96 FROM tab2 GROUP BY col1
----
41
-96
59
-96
61
-96

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8330
SELECT DISTINCT - 54 AS col1, NULLIF ( - CAST( NULL AS SIGNED ), + 51 ) AS col0 FROM tab1 GROUP BY col1, col0
----
-54
NULL

skipif mysql # not compatible
query II rowsort label-8330
SELECT DISTINCT - 54 AS col1, NULLIF ( - CAST ( NULL AS INTEGER ), + 51 ) AS col0 FROM tab1 GROUP BY col1, col0
----
-54
NULL

query II rowsort
SELECT - col1 * - + col1 AS col2, - col1 - 61 * + col1 * + - col1 FROM tab0 cor0 GROUP BY col1
----
0
0
6561
400140

onlyif mysql # DIV for integer division: 
query I rowsort label-8332
SELECT - col0 DIV 97 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8332
SELECT - col0 / 97 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col0 + + col0 * + - col0 * col0 * - col0 FROM tab1 WHERE NULL < 82 GROUP BY col0 HAVING ( NOT + 43 * + + 60 IS NOT NULL )
----

query I rowsort
SELECT ALL 96 FROM tab1 GROUP BY col2, col0, col0
----
96
96
96

query I rowsort
SELECT + 32 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1376
-2656
-832

query I rowsort
SELECT ALL - - col1 FROM tab2 cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < + ( 85 )
----

query I rowsort
SELECT 89 AS col2 FROM tab2 GROUP BY col1, col0
----
89
89
89

query I rowsort
SELECT 52 FROM tab2 GROUP BY col0, col0
----
52
52
52

query II rowsort
SELECT DISTINCT col2, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8341
SELECT col2, col2 / - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT ( CAST( NULL AS SIGNED ) ) NOT BETWEEN - 12 + + 65 * - 70 + - - 79 AND NULL
----

skipif mysql # not compatible
query II rowsort label-8341
SELECT col2, col2 / - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT ( CAST ( NULL AS INTEGER ) ) NOT BETWEEN - 12 + + 65 * - 70 + - - 79 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST( + + 36 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST ( + + 36 AS INTEGER ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8343
SELECT - + col1 DIV + col1 + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
40
58
60

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8343
SELECT - + col1 / + col1 + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
40
58
60

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * + 54 col0 FROM tab1 GROUP BY col0
----
1188
1512
4428

query I rowsort
SELECT + 45 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
45
45
45

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0 HAVING NOT - + 74 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING - ( - col2 ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8348
SELECT DISTINCT col0 * + CAST( ( - col0 ) AS SIGNED ) FROM tab2 GROUP BY col0, col1, col0 HAVING NOT - 40 IS NULL
----
-225
-8281
-8464

skipif mysql # not compatible
query I rowsort label-8348
SELECT DISTINCT col0 * + CAST ( ( - col0 ) AS INTEGER ) FROM tab2 GROUP BY col0, col1, col0 HAVING NOT - 40 IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( + + 30 ) IS NOT NULL
----
22
28
82

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-8350
SELECT + col0 * + - CAST( NULL AS DECIMAL ) / + col0 / - 32, + 67 AS col1 FROM tab1 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col0 HAVING ( 16 ) IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-8350
SELECT + col0 * + - CAST ( NULL AS REAL ) / + col0 / - 32, + 67 AS col1 FROM tab1 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col0 HAVING ( 16 ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8351
SELECT + CAST( NULL AS SIGNED ) + + 65 * col0 * - - 26 FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8351
SELECT + CAST ( NULL AS INTEGER ) + + 65 * col0 * - - 26 FROM tab2 cor0 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 GROUP BY col0, col2, col1, col2 HAVING NOT - + ( - 4 ) * + + 36 * - 80 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8353
SELECT ALL CAST( - + 30 AS SIGNED ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8353
SELECT ALL CAST ( - + 30 AS INTEGER ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 - - 16 AS col2 FROM tab0 GROUP BY col2, col2
----
40
54
95

query I rowsort
SELECT DISTINCT col2 * 59 + 50 + + col2 * + col2 FROM tab1 GROUP BY col2 HAVING NOT - col2 + + 31 IN ( col2 )
----
4730
586
9280

query I rowsort
SELECT ALL ( - - col1 ) FROM tab0 GROUP BY col1, col0
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-8357
SELECT ALL + 63 DIV 34 * + col0 - + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

skipif mysql # not compatible
query I rowsort label-8357
SELECT ALL + 63 / 34 * + col0 - + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col2, col0
----
44
57
6

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - ( 50 ) col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL < 47
----

query I rowsort
SELECT ALL NULLIF ( - + ( + col0 ), + col0 + - + col2 * 14 * - + col0 ) FROM tab2 GROUP BY col1, col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col2 + - 99 FROM tab0 cor0 GROUP BY col0, col2
----
-123
-137
-178

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8363
SELECT - ( - 64 ) + + - col1 AS col1 FROM tab1 WHERE NOT + - col1 NOT BETWEEN + CAST( + col2 AS SIGNED ) / - 2 AND NULL GROUP BY col1, col1
----

skipif mysql # not compatible
query I rowsort label-8363
SELECT - ( - 64 ) + + - col1 AS col1 FROM tab1 WHERE NOT + - col1 NOT BETWEEN + CAST ( + col2 AS INTEGER ) / - 2 AND NULL GROUP BY col1, col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8364
SELECT + 57 + + 44 * - + ( CAST( col1 AS SIGNED ) ) col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8364
SELECT + 57 + + 44 * - + ( CAST ( col1 AS INTEGER ) ) col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + ( - - 17 ) AS col2, COALESCE ( - col2, + col0 ) col0 FROM tab1 GROUP BY col0, col2, col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT ALL + 67 FROM tab2 WHERE + 64 + + 64 * + 59 * - col2 BETWEEN + + col2 AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT 93 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL > ( ( + 87 ) * - 84 + 93 ) AND NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8370
SELECT + col0 + - col1 * - + CAST( NULL AS DECIMAL ) * - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + 55 NOT BETWEEN + col0 AND + 77
----
NULL

skipif mysql # not compatible
query I rowsort label-8370
SELECT + col0 + - col1 * - + CAST ( NULL AS REAL ) * - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + 55 NOT BETWEEN + col0 AND + 77
----
NULL

query I rowsort
SELECT DISTINCT - 46 AS col0 FROM tab2 GROUP BY col0, col0
----
-46

query II rowsort
SELECT - - 17 AS col1, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
17
26
17
43
17
83

onlyif mysql # DIV for integer division: 
query I rowsort label-8373
SELECT DISTINCT + ( + - col1 ) DIV + col1 FROM tab1 AS cor0 WHERE NOT ( ( ( - 10 ) ) ) IS NULL GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-8373
SELECT DISTINCT + ( + - col1 ) / + col1 FROM tab1 AS cor0 WHERE NOT ( ( ( - 10 ) ) ) IS NULL GROUP BY col1
----
-1

query I rowsort
SELECT DISTINCT + + 23 FROM tab1 AS cor0 GROUP BY col2 HAVING - 3 + + 38 IS NOT NULL
----
23

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8375
SELECT - + col2, col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( + 18 ) BETWEEN - col2 * + CAST( NULL AS SIGNED ) AND NULL
----

skipif mysql # not compatible
query II rowsort label-8375
SELECT - + col2, col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( + 18 ) BETWEEN - col2 * + CAST ( NULL AS INTEGER ) AND NULL
----

query I rowsort
SELECT ALL 1 + col2 FROM tab0 AS cor0 WHERE ( + col0 + - col0 ) IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - 58 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-58

query I rowsort
SELECT DISTINCT 11 * - - 60 * - col2 FROM tab1 GROUP BY col2
----
-29700
-46860
-5280

query I rowsort
SELECT col0 - col0 + - 99 + - ( col0 ) + col0 / + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( col0 ) = NULL
----

query I rowsort
SELECT ( - 76 ) AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( 18 ) IS NULL
----
-76
-76
-76

query I rowsort
SELECT + - col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT 1 + - col1 + + col1 * - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-1979
-3305
-41

query I rowsort
SELECT - col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT - ( - 50 ) FROM tab0 AS cor0 GROUP BY col1
----
50
50

query I rowsort
SELECT DISTINCT + 91 + - + 24 + - col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) <= NULL
----

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8388
SELECT ALL - col0 + col0 AS col1, CAST( + 32 AS SIGNED ) col2 FROM tab1 cor0 GROUP BY col0
----
0
32
0
32
0
32

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8388
SELECT ALL - col0 + col0 AS col1, CAST ( + 32 AS INTEGER ) col2 FROM tab1 cor0 GROUP BY col0
----
0
32
0
32
0
32

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 9 + - col2 * + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( 95 ) IS NOT NULL
----
-3355
-6232
-7560

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * - - 53 * + 95 col1 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL BETWEEN - - 57 AND + - 48
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col1, col0, col2 HAVING 61 NOT IN ( + - CASE - col0 WHEN 62 + NULLIF ( - col2, col2 * + col0 ) THEN NULL WHEN col2 THEN NULL ELSE - col1 * col0 END )
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query II rowsort label-8392
SELECT 47, col2 DIV - - col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
47
0
47
0
47
5

skipif mysql # not compatible
query II rowsort label-8392
SELECT 47, col2 / - - col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
47
0
47
0
47
5

query I rowsort
SELECT ALL 61 AS col1 FROM tab1 WHERE NOT 7 IS NOT NULL GROUP BY col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 91 + - col1 * col1 col2 FROM tab2 GROUP BY col1
----
-1590
-3390
-3630

query I rowsort
SELECT ALL 14 * + col2 + - 62 AS col2 FROM tab1 WHERE 76 NOT IN ( col1 * - col2 ) GROUP BY col1, col2 HAVING + col1 BETWEEN ( NULL ) AND 98 - + 2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - 3 col1 FROM tab2 GROUP BY col0, col1
----
-123
-177
-183

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8397
SELECT CAST( - 3 AS SIGNED ) FROM tab1 GROUP BY col1, col2, col2
----
-3
-3
-3

skipif mysql # not compatible
query I rowsort label-8397
SELECT CAST ( - 3 AS INTEGER ) FROM tab1 GROUP BY col1, col2, col2
----
-3
-3
-3

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING - 63 NOT BETWEEN - 54 AND 21
----
0
81

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - 38 * - col1 FROM tab2 GROUP BY col1
----
1558
2242
2318

query I rowsort
SELECT 96 FROM tab1 GROUP BY col1
----
96
96
96

query I rowsort
SELECT DISTINCT col1 + - col1 AS col0 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT - + 62 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT ( col2 ) + - 30 FROM tab0 AS cor0 WHERE 35 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL NOT BETWEEN ( NULL ) AND ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8407
SELECT ALL 90 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN ( + CAST( NULL AS SIGNED ) ) AND ( col0 )
----

skipif mysql # not compatible
query I rowsort label-8407
SELECT ALL 90 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN ( + CAST ( NULL AS INTEGER ) ) AND ( col0 )
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 WHERE col2 IN ( - 67 * col0 ) GROUP BY col0, col2, col1, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8409
SELECT ALL + AVG ( ALL - CAST( NULL AS SIGNED ) ) + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8409
SELECT ALL + AVG ( ALL - CAST ( NULL AS INTEGER ) ) + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8411
SELECT DISTINCT 76 * 13 FROM tab0 AS cor0 WHERE NOT + CAST( NULL AS DECIMAL ) IS NULL GROUP BY col0, col1
----

skipif mysql # not compatible
query I rowsort label-8411
SELECT DISTINCT 76 * 13 FROM tab0 AS cor0 WHERE NOT + CAST ( NULL AS REAL ) IS NULL GROUP BY col0, col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8412
SELECT CAST( NULL AS DECIMAL ) - - 73 / + 25 col2 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8412
SELECT CAST ( NULL AS REAL ) - - 73 / + 25 col2 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL ( - col1 ) * col1 col2 FROM tab2 cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0 HAVING NULL IS NULL
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-8415
SELECT ALL ( + 19 ) DIV + col1 col2 FROM tab2 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8415
SELECT ALL ( + 19 ) / + col1 col2 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 + + col2 FROM tab2 GROUP BY col2 HAVING NULL NOT IN ( + col2 )
----

query I rowsort
SELECT ALL - 40 AS col2 FROM tab1 GROUP BY col1
----
-40
-40
-40

query I rowsort
SELECT DISTINCT col0 / + col2 AS col2 FROM tab0 WHERE - 49 + + col0 = col0 GROUP BY col0, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8419
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8419
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT col0 * + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT - 51 FROM tab1 GROUP BY col1, col2
----
-51

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8422
SELECT CAST( NULL AS SIGNED ) - + - col1 AS col0, 36 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

skipif mysql # not compatible
query II rowsort label-8422
SELECT CAST ( NULL AS INTEGER ) - + - col1 AS col0, 36 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL - 60 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL NOT BETWEEN NULL AND ( NULL ) )
----

query I rowsort
SELECT ALL + - ( col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - ( col2 ) FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + ( 74 ) IS NULL
----
15
91
92

query II rowsort
SELECT ALL + 2 + + + col2 AS col1, - 2 FROM tab0 GROUP BY col2, col2, col0
----
26
-2
40
-2
81
-2

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8429
SELECT ALL + CAST( - col2 AS SIGNED ) FROM tab1 GROUP BY col2, col0, col2
----
-45
-71
-8

skipif mysql # not compatible
query I rowsort label-8429
SELECT ALL + CAST ( - col2 AS INTEGER ) FROM tab1 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT ALL + - 44 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-44
-44

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8432
SELECT DISTINCT - - col1 * - AVG ( ALL CAST( NULL AS SIGNED ) ) / col1 + + - 68 + + 94 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8432
SELECT DISTINCT - - col1 * - AVG ( ALL CAST ( NULL AS INTEGER ) ) / col1 + + - 68 + + 94 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
NULL

query II rowsort
SELECT DISTINCT + col1, col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
44
0
57
0
6
0

query I rowsort
SELECT - 16 AS col0 FROM tab0 AS cor0 WHERE NOT + 94 IS NOT NULL GROUP BY col2, col2, col0 HAVING NOT + - 86 < - col2
----

query I rowsort
SELECT + col1 + 41 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
100
102
82

query I rowsort
SELECT DISTINCT + 67 FROM tab2 AS cor0 GROUP BY col1
----
67

query I rowsort
SELECT + + ( - 39 ) * + col1 AS col1 FROM tab1 WHERE NOT col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col0 * - - col0 * 46 + + col0 - 78 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-22320
-309300
-36114

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8439
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 * - CAST( - - 19 AS SIGNED ) BETWEEN + + 99 AND - 14
----

skipif mysql # not compatible
query I rowsort label-8439
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 * - CAST ( - - 19 AS INTEGER ) BETWEEN + + 99 AND - 14
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8440
SELECT ALL + COALESCE ( - + 30, NULLIF ( + + col2, + ( + + col2 ) ) ) * col0 * ( - + CAST( NULL AS SIGNED ) ) FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8440
SELECT ALL + COALESCE ( - + 30, NULLIF ( + + col2, + ( + + col2 ) ) ) * col0 * ( - + CAST ( NULL AS INTEGER ) ) FROM tab1 AS cor0 GROUP BY col2, col0
----
NULL
NULL
NULL

query I rowsort
SELECT NULLIF ( - 6, + + col0 ) AS col2 FROM tab2 AS cor0 WHERE 41 IS NULL GROUP BY col2, col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + col0, col0 / - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - ( col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab0 AS cor0 WHERE - col2 <= + + 4 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT col2 + col1 AS col0 FROM tab1 GROUP BY col1, col2
----
102
115
14

query I rowsort
SELECT DISTINCT + ( + - ( ( - 41 ) ) ) AS col2 FROM tab2 GROUP BY col0, col2, col1 HAVING NOT - ( - 71 ) IS NOT NULL
----

query I rowsort
SELECT ALL - col1 + + - col1 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
-162
0
0

query I rowsort
SELECT col2 * + col2 * - col2 + + 65 AS col1 FROM tab0 GROUP BY col2
----
-13759
-492974
-54807

query I rowsort
SELECT - 91 * - 49 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT + + 64 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
64
64
64

onlyif mysql # DIV for integer division: 
query II rowsort label-8452
SELECT - + col2 DIV 6 * + - 58 + - + col2, col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
208
24
310
38
675
79

skipif mysql # not compatible
query II rowsort label-8452
SELECT - + col2 / 6 * + - 58 + - + col2, col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
208
24
310
38
675
79

query I rowsort
SELECT + 56 AS col2 FROM tab1 cor0 GROUP BY col0
----
56
56
56

query II rowsort
SELECT + 31 * + col1, + col1 FROM tab0 GROUP BY col1
----
0
0
2511
81

query I rowsort
SELECT NULLIF ( - col2, 56 ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT - 95 FROM tab2 GROUP BY col1 HAVING NOT 6 IS NULL
----
-95
-95
-95

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 56 col0 FROM tab0 GROUP BY col1, col0
----
56

query I rowsort
SELECT DISTINCT 52 AS col1 FROM tab0 GROUP BY col2
----
52

query I rowsort
SELECT - 88 * - + ( - 50 ) AS col1 FROM tab0 GROUP BY col0
----
-4400
-4400
-4400

query I rowsort
SELECT - 36 + + 65 FROM tab0 AS cor0 GROUP BY col0
----
29
29
29

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + 82 + - col1 + + - 6 - COALESCE ( + 79, 34 + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-44
-62
-64

query I rowsort
SELECT DISTINCT + col1 * 38 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1672
2166
228

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8463
SELECT - AVG ( + CAST( NULL AS SIGNED ) ) FROM tab2 cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8463
SELECT - AVG ( + CAST ( NULL AS INTEGER ) ) FROM tab2 cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query II rowsort
SELECT - - 56 + + 22 AS col1, 44 * + col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8465
SELECT DISTINCT + col2 * + + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8465
SELECT DISTINCT + col2 * + + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 - + 53 / + 34 FROM tab1 WHERE NULL IS NULL GROUP BY col1 HAVING + 8 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, 46 + + col2 + + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
136
71
188
8
62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 31 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8469
SELECT DISTINCT ( + - CAST( NULL AS SIGNED ) ) FROM tab1 cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8469
SELECT DISTINCT ( + - CAST ( NULL AS INTEGER ) ) FROM tab1 cor0 GROUP BY col2
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8470
SELECT CAST( + - 61 AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-61
-61
-61

skipif mysql # not compatible
query I rowsort label-8470
SELECT CAST ( + - 61 AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-61
-61
-61

query I rowsort
SELECT DISTINCT + - 31 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-31

query II rowsort
SELECT ALL - col0 AS col0, + 23 AS col0 FROM tab2 GROUP BY col1, col0
----
-15
23
-91
23
-92
23

query I rowsort
SELECT + - ( col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING + - 87 IS NOT NULL
----
-24
-38
-79

query II rowsort
SELECT DISTINCT + 23 * col0 * + 93, col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
177537
83
55614
26
91977
43

query I rowsort
SELECT ALL - col2 + + COALESCE ( - 3, 30, col2 + - + 61 ) + + + 36 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2, col0
----
-46
-5
9

query I rowsort
SELECT - ( + + 35 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1, col2
----
-35
-35
-35

query II rowsort
SELECT ALL col0 AS col0, 54 FROM tab1 GROUP BY col0, col0 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + CASE - - 56 WHEN + 25 THEN + - col2 * + + 18 * + 96 + - ( + + 15 ) * col2 - + col2 * - col0 + + col0 END FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query II rowsort
SELECT ALL - col2 * - 36 * + 31, - col2 AS col0 FROM tab1 GROUP BY col2
----
50220
-45
79236
-71
8928
-8

query I rowsort
SELECT ALL - col2 - + col2 + - 28 / + col2 * col2 + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8482
SELECT col0 DIV + 70 AS col2 FROM tab2 GROUP BY col0
----
0
1
1

skipif mysql # not compatible
query I rowsort label-8482
SELECT col0 / + 70 AS col2 FROM tab2 GROUP BY col0
----
0
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8483
SELECT - + CAST( NULL AS SIGNED ) / col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8483
SELECT - + CAST ( NULL AS INTEGER ) / col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8484
SELECT ALL 68 * 65 + + CAST( - - 90 AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
4510
4510
4510

skipif mysql # not compatible
query I rowsort label-8484
SELECT ALL 68 * 65 + + CAST ( - - 90 AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY col0
----
4510
4510
4510

query II rowsort
SELECT DISTINCT - + 42 * 35, - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - NULLIF ( - 13, - col2 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
13
13
13

query I rowsort
SELECT 69 + - col0 / - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + + 56 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 58 + 43 AS col1 FROM tab2 cor0 GROUP BY col2, col1
----
-15

query I rowsort
SELECT + 81 FROM tab1 cor0 GROUP BY col2, col1
----
81
81
81

query I rowsort
SELECT ALL col2 * 85 AS col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT ( NOT ( NULL ) IS NULL )
----
2040
3230
6715

query I rowsort
SELECT ALL + col2 * - col2 AS col1 FROM tab0 WHERE + COALESCE ( - col1, col2 ) NOT IN ( 20 * - col0 ) GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT col0 * + 46 FROM tab1 GROUP BY col0
----
1012
1288
3772

query I rowsort
SELECT + col2 + 30 AS col2 FROM tab1 cor0 GROUP BY col2
----
101
38
75

query I rowsort
SELECT DISTINCT ( 84 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT 55 FROM tab2 GROUP BY col1
----
55

query II rowsort
SELECT DISTINCT col1 AS col1, col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( + - 12 ) FROM tab1 GROUP BY col1
----
-12

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL = + 26
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8499
SELECT CAST( NULL AS SIGNED ) + + col0 / + col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT - ( - CAST( - 69 AS SIGNED ) ) IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8499
SELECT CAST ( NULL AS INTEGER ) + + col0 / + col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT - ( - CAST ( - 69 AS INTEGER ) ) IS NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + ( col1 ) FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 WHERE NOT NULL < + 45 GROUP BY col1, col2 HAVING NOT NULL IN ( - col2, - col2, + col2 + 51, 43, + col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8502
SELECT 77 AS col1 FROM tab1 GROUP BY col1 HAVING + - CAST( - - 25 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-8502
SELECT 77 AS col1 FROM tab1 GROUP BY col1 HAVING + - CAST ( - - 25 AS INTEGER ) IS NULL
----

query I rowsort
SELECT ALL + + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-8504
SELECT + 41 DIV - col1 AS col0 FROM tab1 GROUP BY col1, col0
----
-6
0
0

skipif mysql # not compatible
query I rowsort label-8504
SELECT + 41 / - col1 AS col0 FROM tab1 GROUP BY col1, col0
----
-6
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-8505
SELECT DISTINCT - + col0 DIV - 28 + + - 58 * - 40 FROM tab0 AS cor0 GROUP BY col0, col1
----
2320
2321
2322

skipif mysql # not compatible
query I rowsort label-8505
SELECT DISTINCT - + col0 / - 28 + + - 58 * - 40 FROM tab0 AS cor0 GROUP BY col0, col1
----
2320
2321
2322

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 77 col1 FROM tab1 cor0 GROUP BY col1, col0
----
77
77
77

query I rowsort
SELECT DISTINCT - ( - - col0 ) + + 54 FROM tab2 GROUP BY col0
----
-37
-38
39

onlyif mysql # DIV for integer division: 
query I rowsort label-8508
SELECT DISTINCT col2 DIV col2 * - 59 + 74 FROM tab2 GROUP BY col2
----
15

skipif mysql # not compatible
query I rowsort label-8508
SELECT DISTINCT col2 / col2 * - 59 + 74 FROM tab2 GROUP BY col2
----
15

query I rowsort
SELECT ALL - ( - col2 ) * + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT - + 61 FROM tab2 AS cor0 GROUP BY col2
----
-61
-61
-61

query I rowsort
SELECT - 64 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-64
-64

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col1 HAVING NOT + + col1 IS NULL
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8513
SELECT + 88 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT ( + CAST( + col2 AS SIGNED ) ) IS NULL
----
88
88
88

skipif mysql # not compatible
query I rowsort label-8513
SELECT + 88 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT ( + CAST ( + col2 AS INTEGER ) ) IS NULL
----
88
88
88

query I rowsort
SELECT - 17 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) > ( NULL )
----

query I rowsort
SELECT DISTINCT col1 + 83 FROM tab0 AS cor0 GROUP BY col1
----
164
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col1, - 69 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( - 79 ) = ( NULL )
----

query I rowsort
SELECT col0 * - - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
3772
5369
915

query I rowsort
SELECT + 58 - - col2 + + col2 + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + 83 IS NULL
----

query I rowsort
SELECT ALL col0 - + col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) >= + col1 GROUP BY col0
----

query I rowsort
SELECT 5 * - col0 * - + col0 FROM tab0 GROUP BY col0, col1
----
3380
34445
9245

query I rowsort
SELECT col1 - AVG ( + + 78 ) - + + ( - 61 ) * col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING 65 IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE col0 = - 7 GROUP BY col2, col2 HAVING NOT ( NOT NULL NOT BETWEEN - 10 * - col2 AND + + 38 / + 91 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8523
SELECT CAST( NULL AS SIGNED ) AS col1, 45 FROM tab1 GROUP BY col1, col0, col2 HAVING col1 IS NOT NULL
----
NULL
45
NULL
45
NULL
45

skipif mysql # not compatible
query II rowsort label-8523
SELECT CAST ( NULL AS INTEGER ) AS col1, 45 FROM tab1 GROUP BY col1, col0, col2 HAVING col1 IS NOT NULL
----
NULL
45
NULL
45
NULL
45

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * + 36 col1 FROM tab2 GROUP BY col1
----
1476
2124
2196

query II rowsort
SELECT + 0 AS col1, + col0 FROM tab2 GROUP BY col0 HAVING NOT ( ( col0 ) ) < ( NULL ) AND NULL IS NOT NULL
----

query I rowsort
SELECT col2 + + - 72 FROM tab2 cor0 GROUP BY col2, col2
----
-14
15
7

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + 94 - 57 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
37

query I rowsort
SELECT - ( 54 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-54
-54
-54

query I rowsort
SELECT - 74 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8531
SELECT DISTINCT + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8531
SELECT DISTINCT + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
NULL

query I rowsort
SELECT DISTINCT - ( - - 13 ) AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( + 42 ) IS NULL
----
-13

query I rowsort
SELECT ALL - col2 + - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT 40 * + AVG ( 99 ) + 65 IS NULL
----
-116
-158
-174

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0, col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - 94 FROM tab0 AS cor0 GROUP BY col1, col2
----
-94
-94
-94

query I rowsort
SELECT DISTINCT 22 FROM tab1 GROUP BY col1 HAVING NULL IN ( 76 )
----

query I rowsort
SELECT + 90 * col1 AS col2 FROM tab1 GROUP BY col1
----
3960
5130
540

query I rowsort
SELECT DISTINCT - + col1 + - + 79 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-120
-138
-140

query I rowsort
SELECT - - col1 + - col1 FROM tab1 cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT - - col2 + - 48 FROM tab1 AS cor0 GROUP BY col2
----
-3
-40
23

query I rowsort
SELECT col1 * 66 * + - col1 + col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2, col2 col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING + 11 IS NOT NULL
----
22
28
82

query I rowsort
SELECT ( - + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - 96 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-96
-96
-96

query I rowsort
SELECT + col0 / + - col1 FROM tab0 GROUP BY col0, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - 17 FROM tab2 GROUP BY col2, col0, col0 HAVING NULL IN ( col0 * 12 )
----

query I rowsort
SELECT - 92 AS col1 FROM tab1 GROUP BY col1, col0
----
-92
-92
-92

query I rowsort
SELECT ALL 89 FROM tab1 GROUP BY col2
----
89
89
89

query I rowsort
SELECT DISTINCT + col0 + - col0 * col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING 86 * - 12 IS NOT NULL
----
-3440
26
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8551
SELECT ALL col2 * CAST( NULL AS SIGNED ) + + 16 FROM tab1 WHERE ( 80 ) > - 3 * col2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8551
SELECT ALL col2 * CAST ( NULL AS INTEGER ) + + 16 FROM tab1 WHERE ( 80 ) > - 3 * col2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 80 FROM tab1 GROUP BY col1
----
-80
-80
-80

query I rowsort
SELECT DISTINCT col2 - + 52 FROM tab0 GROUP BY col1, col2, col2 HAVING - 57 = - col2
----

query I rowsort
SELECT DISTINCT - col0 + col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NOT - 62 NOT BETWEEN - col0 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 57 * + 29 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
1653
1653
1653

query II rowsort
SELECT + - col1, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
-81
0
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8557
SELECT ALL col0, col0 FROM tab2 WHERE + CAST( NULL AS SIGNED ) IS NOT NULL OR NOT - col0 IS NOT NULL GROUP BY col2, col0
----

skipif mysql # not compatible
query II rowsort label-8557
SELECT ALL col0, col0 FROM tab2 WHERE + CAST ( NULL AS INTEGER ) IS NOT NULL OR NOT - col0 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL 29 FROM tab1 GROUP BY col2, col0
----
29
29
29

query I rowsort
SELECT + 30 FROM tab0 AS cor0 GROUP BY col0, col2
----
30
30
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + + - 27 col0 FROM tab0 GROUP BY col1
----
-27
54

query I rowsort
SELECT - col2 * - 16 + col2 FROM tab1 GROUP BY col2, col2
----
1207
136
765

query I rowsort
SELECT - col2 / + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT - ( col1 ) FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query II rowsort
SELECT 6 + col0, + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
28
22
34
28
88
82

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 DISTINCT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 - + + col1 FROM tab0 GROUP BY col1
----
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8568
SELECT DISTINCT + col0 + + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-8568
SELECT DISTINCT + col0 + + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT + + 80 + + col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
138
159
167

query I rowsort
SELECT ALL + col2 * + 36 + + - 93 FROM tab2 AS cor0 GROUP BY col2
----
1995
2751
3039

query I rowsort
SELECT 58 + + col2 AS col0 FROM tab1 GROUP BY col2
----
103
129
66

query I rowsort
SELECT ALL col1 * col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL - 17 FROM tab0 GROUP BY col1 HAVING NOT NULL IN ( + 52 )
----

query I rowsort
SELECT - 67 FROM tab0 GROUP BY col2, col0
----
-67
-67
-67

query II rowsort
SELECT col0, - col0 AS col0 FROM tab1 AS cor0 WHERE NULL >= NULL GROUP BY col0
----

query I rowsort
SELECT ALL + 98 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
98
98
98

query I rowsort
SELECT 25 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
25
25
25

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT 67 AS col0 FROM tab1 GROUP BY col1
----
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 30 col1 FROM tab1 GROUP BY col0, col2, col1 HAVING NOT + col2 + - col0 IS NULL
----
30
30
30

query I rowsort
SELECT DISTINCT col1 * col1 * - - col1 FROM tab2 GROUP BY col1, col1
----
205379
226981
68921

query I rowsort
SELECT - ( + 93 ) AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-93
-93
-93

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + 80 + col1 FROM tab2 AS cor0 GROUP BY col1
----
-19
-21
-39

query I rowsort
SELECT ALL - + NULLIF ( - 53, - col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
53
53
53

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8586
SELECT DISTINCT CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1 HAVING NOT + + 9 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8586
SELECT DISTINCT CAST ( NULL AS REAL ) FROM tab2 GROUP BY col1 HAVING NOT + + 9 IS NOT NULL
----

query I rowsort
SELECT ALL - 0 + + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + ( 79 ) FROM tab2 GROUP BY col0
----
79
79
79

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-8589
SELECT DISTINCT - CAST( - CAST( + col0 AS DECIMAL ) AS SIGNED ) * - col0 / - col0 * + col0 * - col0 / col0, + col0 AS col1 FROM tab2 GROUP BY col0 HAVING 61 IS NULL
----

skipif mysql # not compatible
query II rowsort label-8589
SELECT DISTINCT - CAST ( - CAST ( + col0 AS REAL ) AS INTEGER ) * - col0 / - col0 * + col0 * - col0 / col0, + col0 AS col1 FROM tab2 GROUP BY col0 HAVING 61 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8590
SELECT - CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8590
SELECT - CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query II rowsort
SELECT - 8 + col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-2
6
36
44
49
57

query I rowsort
SELECT + 25 - - col1 FROM tab1 cor0 GROUP BY col1
----
31
69
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + - col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT ALL col2 * + - col2 + + col2 AS col1 FROM tab0 cor0 WHERE + col0 BETWEEN + ( + 79 ) AND + col0 * + col2 - - - col0 * + + col2 + - col0 GROUP BY col2
----

query II rowsort
SELECT ALL - ( - 5 ) AS col2, - 40 FROM tab1 WHERE NOT + ( + 24 ) = + COALESCE ( - 11, - + col0 ) * col2 + - + col0 * + col1 * + 70 / col1 GROUP BY col1 HAVING NULL IS NULL
----
5
-40
5
-40
5
-40

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8597
SELECT - col0 + col0 - - col0 * CAST( NULL AS SIGNED ) / + col0 / + 34 col1 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8597
SELECT - col0 + col0 - - col0 * CAST ( NULL AS INTEGER ) / + col0 / + 34 col1 FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-8598
SELECT - col0 DIV + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8598
SELECT - col0 / + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8599
SELECT - + 5 / 17 / CAST( NULL AS SIGNED ) col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - + col2 + col1 < - col1 * + 81 * - 57 * - col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8599
SELECT - + 5 / 17 / CAST ( NULL AS INTEGER ) col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - + col2 + col1 < - col1 * + 81 * - 57 * - col1
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 99 + - col0 * col0 col2 FROM tab0 GROUP BY col0
----
-1750
-577
-6790

query I rowsort
SELECT ALL - col2 FROM tab2 WHERE - + col0 IS NULL GROUP BY col2
----

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

query I rowsort
SELECT ALL - ( + - col2 ) * - col2 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-195112
-493039
-658503

onlyif mysql # DIV for integer division: 
query I rowsort label-8604
SELECT DISTINCT - 31 DIV + col2 col0 FROM tab0 cor0 GROUP BY col2
----
-1
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8604
SELECT DISTINCT - 31 / + col2 col0 FROM tab0 cor0 GROUP BY col2
----
-1
0

query II rowsort
SELECT col0 AS col1, + ( - col0 ) FROM tab1 AS cor0 GROUP BY col2, col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT + + 20 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
20
20
20

query I rowsort
SELECT ALL + + 93 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + ( - 73 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col1 HAVING NOT - col1 IS NULL
----
44
57
6

query I rowsort
SELECT - col1 * - - col2 FROM tab0 GROUP BY col1, col2
----
-1944
0
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING 54 <> NULL
----

query I rowsort
SELECT ALL + - col0 + - 65 - col0 + + - 26 AS col1 FROM tab2 cor0 GROUP BY col2, col0 HAVING + 20 IS NOT NULL
----
-121
-273
-275

query I rowsort
SELECT + 89 FROM tab0 GROUP BY col1
----
89
89

query I rowsort
SELECT ALL col1 + + ( - col1 ) FROM tab1 WHERE ( 10 ) IS NOT NULL GROUP BY col1
----
0
0
0

query I rowsort
SELECT - 42 * + col0 FROM tab2 GROUP BY col2, col0
----
-3822
-3864
-630

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL 27 + 15 * + 11 * - 51 - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-8410
-8416
-8470

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL NOT BETWEEN NULL AND col2
----

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col1 HAVING + - 67 >= + col1
----

query I rowsort
SELECT col2 + - + 22 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
36
57
65

query I rowsort
SELECT 25 FROM tab0 GROUP BY col0, col0
----
25
25
25

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8622
SELECT DISTINCT col0 AS col1, - CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0, col1
----
22
NULL
28
NULL
82
NULL

skipif mysql # not compatible
query II rowsort label-8622
SELECT DISTINCT col0 AS col1, - CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0, col1
----
22
NULL
28
NULL
82
NULL

query I rowsort
SELECT DISTINCT + 13 + + 60 FROM tab0 GROUP BY col0
----
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8624
SELECT DISTINCT 41 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT 14 * - CAST( NULL AS SIGNED ) IS NOT NULL
----
41

skipif mysql # not compatible
query I rowsort label-8624
SELECT DISTINCT 41 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT 14 * - CAST ( NULL AS INTEGER ) IS NOT NULL
----
41

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 WHERE NOT ( - 64 NOT BETWEEN + col2 AND col2 * + 7 ) GROUP BY col2
----

query I rowsort
SELECT - 1 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT - ( 69 ) AS col2 FROM tab1 GROUP BY col1
----
-69
-69
-69

query I rowsort
SELECT ALL 30 + - 74 - col1 + - - col1 AS col1 FROM tab1 GROUP BY col1, col0
----
-44
-44
-44

query I rowsort
SELECT ALL ( + col0 ) FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND - 54 * + col1 + 55
----

query I rowsort
SELECT - 25 AS col0 FROM tab1 GROUP BY col2
----
-25
-25
-25

query II rowsort
SELECT ALL 73, col1 * - col1 + + - 92 AS col2 FROM tab1 cor0 GROUP BY col1
----
73
-128
73
-2028
73
-3341

query I rowsort
SELECT + 95 / - - 36 / 79 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2 HAVING NOT NULL <= + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8634
SELECT DISTINCT - CAST( NULL AS SIGNED ) + 25 FROM tab0 AS cor0 GROUP BY col2
----
NULL

skipif mysql # not compatible
query I rowsort label-8634
SELECT DISTINCT - CAST ( NULL AS INTEGER ) + 25 FROM tab0 AS cor0 GROUP BY col2
----
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-8635
SELECT ALL + col1 * - - col1 * - col1 DIV col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

skipif mysql # not compatible
query I rowsort label-8635
SELECT ALL + col1 * - - col1 * - col1 / col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT 57 * col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL ( - + col0 ) * - col0 col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8638
SELECT DISTINCT CAST( - col1 AS SIGNED ) FROM tab0 cor0 GROUP BY col0, col0, col1
----
-81
0

skipif mysql # not compatible
query I rowsort label-8638
SELECT DISTINCT CAST ( - col1 AS INTEGER ) FROM tab0 cor0 GROUP BY col0, col0, col1
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8639
SELECT ALL ( + - CAST( + 94 AS SIGNED ) ) AS col0 FROM tab2 GROUP BY col1
----
-94
-94
-94

skipif mysql # not compatible
query I rowsort label-8639
SELECT ALL ( + - CAST ( + 94 AS INTEGER ) ) AS col0 FROM tab2 GROUP BY col1
----
-94
-94
-94

query I rowsort
SELECT + ( col0 ) AS col2 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT 97 - col0 FROM tab1 GROUP BY col0
----
15
69
75

query I rowsort
SELECT col1 * - ( - col1 ) + - 75 FROM tab0 GROUP BY col1
----
-75
6486

query I rowsort
SELECT + 59 FROM tab1 WHERE NOT ( - col2 * col0 ) >= ( col0 ) GROUP BY col1
----
59
59
59

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8644
SELECT - 21 + 87 AS col0 FROM tab2 GROUP BY col1, col2, col0 HAVING NULL IN ( - 13 + CASE 38 + + col0 WHEN - CAST( NULL AS SIGNED ) THEN col1 ELSE NULL END )
----

skipif mysql # not compatible
query I rowsort label-8644
SELECT - 21 + 87 AS col0 FROM tab2 GROUP BY col1, col2, col0 HAVING NULL IN ( - 13 + CASE 38 + + col0 WHEN - CAST ( NULL AS INTEGER ) THEN col1 ELSE NULL END )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 27 col1 FROM tab1 WHERE NOT ( 5 ) IN ( - col0 ) GROUP BY col1
----
-27

query I rowsort
SELECT ALL + 20 * col1 FROM tab0 GROUP BY col2, col1
----
0
0
1620

query I rowsort
SELECT col0 FROM tab2 WHERE NOT 56 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT 88 FROM tab1 GROUP BY col0, col1
----
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 37 col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
37
37
37

query I rowsort
SELECT DISTINCT col2 - + 6 FROM tab2 GROUP BY col2
----
52
73
81

query I rowsort
SELECT DISTINCT col2 * 87 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL > ( + col2 * 90 )
----

query I rowsort
SELECT + 95 FROM tab2 cor0 GROUP BY col2
----
95
95
95

query I rowsort
SELECT 20 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
20
20
20

query I rowsort
SELECT + ( col1 ) FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) NOT BETWEEN 4 AND 94
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0 HAVING 82 - - col0 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8656
SELECT - CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8656
SELECT - CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + + col0 + - 93 FROM tab1 AS cor0 GROUP BY col1, col0
----
-11
-65
-71

query I rowsort
SELECT ALL 96 FROM tab0 GROUP BY col1, col2
----
96
96
96

query I rowsort
SELECT - 73 AS col0 FROM tab1 GROUP BY col2
----
-73
-73
-73

query II rowsort
SELECT - col2 + 36 AS col2, - 50 + - 97 AS col0 FROM tab0 GROUP BY col2
----
-2
-147
-43
-147
12
-147

query I rowsort
SELECT ALL - col1 * col1 * - 43 FROM tab1 GROUP BY col1
----
139707
1548
83248

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col0 + - - col1 FROM tab2 GROUP BY col0, col2, col1
----
133
150
76

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8665
SELECT DISTINCT + col1 + + col1 col2 FROM tab0 WHERE CAST( NULL AS SIGNED ) + 58 * - col2 BETWEEN NULL AND NULL GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8665
SELECT DISTINCT + col1 + + col1 col2 FROM tab0 WHERE CAST ( NULL AS INTEGER ) + 58 * - col2 BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT col0 + + col0 + - col0 * + + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + col0 = + 96
----
-1763
-624
-6723

query I rowsort
SELECT - ( - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT 88 - - 97 FROM tab2 GROUP BY col2, col0, col1 HAVING ( - col0 ) <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8669
SELECT ALL col2 * + col2 * + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8669
SELECT ALL col2 * + col2 * + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT - AVG ( ALL - col2 ) + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING 84 IS NULL
----

query I rowsort
SELECT + 78 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
78
78
78

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8673
SELECT - + col2 + - - col2 AS col0 FROM tab0 AS cor0 WHERE NOT CAST( NULL AS DECIMAL ) NOT BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT - + col2 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8673
SELECT - + col2 + - - col2 AS col0 FROM tab0 AS cor0 WHERE NOT CAST ( NULL AS REAL ) NOT BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT - + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT 9 * + + col1 * + 20 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
10260
1080
7920

query I rowsort
SELECT + col2 * - col1 + + - col2 * + 46 FROM tab0 GROUP BY col1, col2
----
-1748
-3048
-3634

query I rowsort
SELECT ALL - col1 + + col1 * + col0 FROM tab1 GROUP BY col1, col0 HAVING 92 = - - AVG ( - 90 ) * col1 - + - 54
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8678
SELECT - col0 * + CAST( col0 AS SIGNED ) - 45 + + + col2 + - 53 + - - col0 + col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING + 29 IS NOT NULL
----
-206
-8118
-8320

skipif mysql # not compatible
query I rowsort label-8678
SELECT - col0 * + CAST ( col0 AS INTEGER ) - 45 + + + col2 + - 53 + - - col0 + col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING + 29 IS NOT NULL
----
-206
-8118
-8320

query I rowsort
SELECT ALL col1 * - - col0 FROM tab1 GROUP BY col1, col0
----
132
1596
3608

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8680
SELECT 41 + - 6, col0 + col0 + - CAST( NULL AS SIGNED ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND ( NULL )
----

skipif mysql # not compatible
query II rowsort label-8680
SELECT 41 + - 6, col0 + col0 + - CAST ( NULL AS INTEGER ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL col2 * + col2 AS col2 FROM tab0 GROUP BY col2, col1
----
1444
576
6241

query I rowsort
SELECT + 87 + - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT + 97 IS NULL
----
145
166
174

query II rowsort
SELECT ALL col1 * + - col1 + - 83 + - + 14 AS col0, 80 - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8684
SELECT ALL - col2 * - col2 - + col2 DIV - + col2 FROM tab0 AS cor0 GROUP BY col2
----
1445
577
6242

skipif mysql # not compatible
query I rowsort label-8684
SELECT ALL - col2 * - col2 - + col2 / - + col2 FROM tab0 AS cor0 GROUP BY col2
----
1445
577
6242

query I rowsort
SELECT + 43 * col1 + + col0 AS col0 FROM tab1 GROUP BY col1, col0, col1
----
1974
2479
280

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 3 col1 FROM tab0 GROUP BY col1, col0
----
3
3
3

query I rowsort
SELECT + col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT 50 FROM tab1 AS cor0 GROUP BY col0, col2
----
50
50
50

query I rowsort
SELECT DISTINCT - 26 AS col0 FROM tab2 WHERE col0 - + col1 IS NULL GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8690
SELECT col0 * + + ( + CAST( NULL AS SIGNED ) ) + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8690
SELECT col0 * + + ( + CAST ( NULL AS INTEGER ) ) + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 76 * - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-6156
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8692
SELECT + CAST( NULL AS SIGNED ) / col2 col0 FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8692
SELECT + CAST ( NULL AS INTEGER ) / col2 col0 FROM tab0 GROUP BY col2, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + ( col1 ) + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - ( col0 ) AS col0 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - 3 AS col1 FROM tab1 GROUP BY col0
----
-3
-3
-3

query II rowsort
SELECT - 20, + col2 AS col0 FROM tab1 GROUP BY col2, col1
----
-20
45
-20
71
-20
8

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT + col2 IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + 59 AS col2 FROM tab1 GROUP BY col0, col0
----
59

query II rowsort
SELECT ALL + 34, col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
34
0
34
0
34
81

query II rowsort
SELECT - col1 AS col0, col1 + - + col1 + col1 * - col1 FROM tab1 GROUP BY col1 HAVING - col1 > NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col1, col1
----
15
91
92

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT 11 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
11
11
11

query I rowsort
SELECT + 20 + col0 FROM tab2 AS cor0 GROUP BY col0
----
111
112
35

onlyif mysql # DIV for integer division: 
query I rowsort label-8705
SELECT DISTINCT - + 40 + + col2 * - col2 DIV col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + - col2 IS NOT NULL
----
-119
-127
-98

skipif mysql # not compatible
query I rowsort label-8705
SELECT DISTINCT - + 40 + + col2 * - col2 / col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + - col2 IS NOT NULL
----
-119
-127
-98

query I rowsort
SELECT + col1 + 4 - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 14 * - col2 + - - col2 - col2 + 99 + - col2 * - - col2 * - 31 * + 81 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1446099
15670144
3625451

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8708
SELECT ( col2 ) * - CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8708
SELECT ( col2 ) * - CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 26 + col2 FROM tab0 AS cor0 WHERE NOT col2 IS NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + 18 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-18
-18
-18

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8711
SELECT ALL col2 AS col2 FROM tab0 AS cor0 WHERE + CAST( NULL AS SIGNED ) = + col2 GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-8711
SELECT ALL col2 AS col2 FROM tab0 AS cor0 WHERE + CAST ( NULL AS INTEGER ) = + col2 GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + - 91 - + 27 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-118

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col2, col0, col2 HAVING + - 52 IS NULL
----

query I rowsort
SELECT 9 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col1 + 35 FROM tab0 AS cor0 GROUP BY col1, col1
----
-46
35

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + col1 + col0 IS NULL
----

query I rowsort
SELECT - + 79 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-79
-79
-79

query I rowsort
SELECT - 79 * - - ( - col1 ) AS col1 FROM tab0 GROUP BY col1
----
0
6399

query I rowsort
SELECT DISTINCT - + 4 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-4

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 40 * + 93 + + - 7 col2 FROM tab2 GROUP BY col2, col1
----
3713
3713
3713

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8721
SELECT - 91 / CAST( NULL AS SIGNED ) * - 65 AS col2 FROM tab1 GROUP BY col1 HAVING NULL >= NULL
----

skipif mysql # not compatible
query I rowsort label-8721
SELECT - 91 / CAST ( NULL AS INTEGER ) * - 65 AS col2 FROM tab1 GROUP BY col1 HAVING NULL >= NULL
----

query II rowsort
SELECT + col2 AS col1, col2 AS col2 FROM tab1 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT ALL 97 FROM tab1 GROUP BY col1
----
97
97
97

query I rowsort
SELECT 83 AS col2 FROM tab1 GROUP BY col2, col1
----
83
83
83

query I rowsort
SELECT - CASE - 20 WHEN - - col1 THEN + 77 END AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-8726
SELECT DISTINCT + col2 + + + 96 DIV + 34 FROM tab2 AS cor0 GROUP BY col0, col2
----
60
81
89

skipif mysql # not compatible
query I rowsort label-8726
SELECT DISTINCT + col2 + + + 96 / + 34 FROM tab2 AS cor0 GROUP BY col0, col2
----
60
81
89

query I rowsort
SELECT ALL - col2 / - - col2 + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL NOT BETWEEN + + 75 AND + 73
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8728
SELECT ALL + - 12 DIV 48 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - AVG ( + col2 ) IS NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-8728
SELECT ALL + - 12 / 48 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - AVG ( + col2 ) IS NULL
----
0
0
0

query I rowsort
SELECT 2 * 8 + + + 46 - + + 27 FROM tab2 GROUP BY col0
----
35
35
35

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE - col0 * + - col0 >= + col2 GROUP BY col1 HAVING NOT ( 45 ) IS NULL
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8731
SELECT - CAST( NULL AS SIGNED ) + - col1 * col1 * + + 17 col0 FROM tab0 cor0 GROUP BY col1 HAVING ( NULL ) IN ( - 31 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8731
SELECT - CAST ( NULL AS INTEGER ) + - col1 * col1 * + + 17 col0 FROM tab0 cor0 GROUP BY col1 HAVING ( NULL ) IN ( - 31 )
----

query I rowsort
SELECT DISTINCT - 87 + - col2 FROM tab2 GROUP BY col1, col2
----
-145
-166
-174

query I rowsort
SELECT DISTINCT - - 12 AS col1 FROM tab0 WHERE 54 > col1 GROUP BY col2, col2
----
12

query I rowsort
SELECT DISTINCT + ( + 87 ) * - col0 + - 35 AS col2 FROM tab1 GROUP BY col0, col0, col0
----
-1949
-2471
-7169

query I rowsort
SELECT col2 + COALESCE ( - - 4, CASE - ( + col0 ) WHEN - 58 THEN NULL ELSE + - col2 END ) * 19 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT NULL IN ( + col2 )
----

query I rowsort
SELECT + 63 FROM tab1 GROUP BY col0, col0
----
63
63
63

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING ( col0 <> NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8738
SELECT - col1 / - CAST( NULL AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT ( col1 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8738
SELECT - col1 / - CAST ( NULL AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT 37 + - - col0 FROM tab2 GROUP BY col0 HAVING 13 IS NULL
----

query I rowsort
SELECT ( col1 ) AS col0 FROM tab1 GROUP BY col0, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + 10 FROM tab1 AS cor0 GROUP BY col1
----
10
10
10

query I rowsort
SELECT ( + - 25 ) AS col1 FROM tab1 GROUP BY col0
----
-25
-25
-25

onlyif mysql # DIV for integer division: 
query I rowsort label-8744
SELECT DISTINCT - col0 + 86 DIV 12 FROM tab0 GROUP BY col0, col0
----
-19
-36
-76

skipif mysql # not compatible
query I rowsort label-8744
SELECT DISTINCT - col0 + 86 / 12 FROM tab0 GROUP BY col0, col0
----
-19
-36
-76

query I rowsort
SELECT DISTINCT - 12 * - 31 + col0 FROM tab2 AS cor0 GROUP BY col0
----
387
463
464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col0 HAVING NOT - ( 19 ) IS NOT NULL
----

query I rowsort
SELECT - col0 * col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
-17576
-571787
-79507

query I rowsort
SELECT ALL - col2 + + + 77 AS col1 FROM tab2 GROUP BY col2
----
-10
-2
19

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col2 + + col0 * 99 FROM tab1 WHERE NOT - 85 * col2 <= col0 GROUP BY col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 67 col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 35 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-35

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( - 51 ) IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 50 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) NOT BETWEEN ( col2 ) AND + col0 + 13 * col0
----

query I rowsort
SELECT - ( - + col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + ( + - col2 ) + - + ( + col2 ) FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT ( - COALESCE ( + col1, + ( 78 ) ) ) AS col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col2 + + ( - col0 ) * - ( + 66 ) * - 30 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( col0 ) < - col0 + - 41
----

query I rowsort
SELECT ALL col1 * + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
1681
3481
3721

query I rowsort
SELECT ( + col1 ) FROM tab1 WHERE col2 IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8761
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8761
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + CASE WHEN NOT NULL NOT BETWEEN NULL AND NULL THEN - col1 ELSE NULL END FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT - 99 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
-99
-99

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST( NULL AS SIGNED ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST ( NULL AS INTEGER ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING - + col2 BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + AVG ( col2 ) * + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL <= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 * col2 + col2 + - ( + col2 ) + + 64 * 72 FROM tab2 GROUP BY col2
----
10849
12177
7972

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8768
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-8768
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 70 * 69 col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2 HAVING NOT NULL >= + 37
----

query I rowsort
SELECT + 59 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
59
59
59

query I rowsort
SELECT ALL 87 AS col0 FROM tab2 GROUP BY col2, col1
----
87
87
87

query I rowsort
SELECT 74 FROM tab1 GROUP BY col2, col2
----
74
74
74

query I rowsort
SELECT col2 * - - 11 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + - - 81 - - col1 * + + col0 FROM tab1 GROUP BY col1, col0
----
1734
219
3733

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - 92 + - col0 * + col0 * 23 col2 FROM tab1 AS cor0 GROUP BY col0
----
-11040
-154560
-17940

query I rowsort
SELECT 20 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
20
20
20

query I rowsort
SELECT col2 * col2 FROM tab1 GROUP BY col2 HAVING + 59 - + col2 - + col2 < - col2
----
5041

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 WHERE - col2 IS NULL GROUP BY col1, col0 HAVING NOT + 39 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 AS col1 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
58
79
87

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-8781
SELECT ALL + + CAST( NULL AS DECIMAL ) * + - col1, - col1 col2 FROM tab1 cor0 GROUP BY col0, col1
----
NULL
-44
NULL
-57
NULL
-6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8781
SELECT ALL + + CAST ( NULL AS REAL ) * + - col1, - col1 col2 FROM tab1 cor0 GROUP BY col0, col1
----
NULL
-44
NULL
-57
NULL
-6

query I rowsort
SELECT ALL - 32 FROM tab0 AS cor0 GROUP BY col0, col1
----
-32
-32
-32

onlyif mysql # DIV for integer division: 
query I rowsort label-8783
SELECT ALL + + col2 - 69 DIV - - 76 AS col2 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-8783
SELECT ALL + + col2 - 69 / - - 76 AS col2 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col0 + - - col0 + + ( + + col0 ) FROM tab0 WHERE col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + 47 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8786
SELECT ALL CAST( col2 AS SIGNED ) FROM tab1 GROUP BY col0, col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-8786
SELECT ALL CAST ( col2 AS INTEGER ) FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - 19 * col0 * col1 FROM tab2 cor0 GROUP BY col0, col1
----
-102011
-17385
-71668

query I rowsort
SELECT ALL - col0 * + - 24 AS col1 FROM tab0 GROUP BY col0, col0
----
1032
1992
624

query I rowsort
SELECT DISTINCT - - col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + ( 15 ) + + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT + col2 IS NULL
----
-29
-42
9

query I rowsort
SELECT ALL + 29 AS col2 FROM tab0 cor0 GROUP BY col1
----
29
29

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8793
SELECT col0 * CAST( - 45 AS SIGNED ) * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query I rowsort label-8793
SELECT col0 * CAST ( - 45 AS INTEGER ) * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col2 + - 89 * - - ( - 44 ) + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
3932
4006
4058

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8795
SELECT + col0 / + col0 + - 78 + + + CAST( NULL AS SIGNED ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8795
SELECT + col0 / + col0 + - 78 + + + CAST ( NULL AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 13 FROM tab2 GROUP BY col1 HAVING + col1 > NULL
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT ( + col0 ) AS col0 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING - col2 IS NULL
----

query II rowsort
SELECT + col1, - col1 FROM tab0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT DISTINCT - col2 + col2 * + + 38 * - col2 / col2 * + - 42 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL < NULL )
----

query I rowsort
SELECT DISTINCT - col1 * - - 95 AS col1 FROM tab0 AS cor0 WHERE - col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT col0 * 51 * - col0 - + - col0 AS col2 FROM tab1 GROUP BY col0 HAVING - 88 IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 WHERE NOT - col1 NOT BETWEEN col2 AND + col1 * 14 GROUP BY col1
----

query I rowsort
SELECT - 19 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-19
-19
-19

query I rowsort
SELECT ALL col1 * + ( col1 ) FROM tab1 cor0 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab0 GROUP BY col2 HAVING NOT ( NOT ( + 27 ) IS NOT NULL )
----
24
38
79

query II rowsort
SELECT 50 AS col2, + 48 - - ( - 77 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
50
-29
50
-29
50
-29

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE col2 <= NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT - - 13 FROM tab0 WHERE + col0 IS NULL GROUP BY col1, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8812
SELECT + - 10 DIV - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0
0
1

skipif mysql # not compatible
query I rowsort label-8812
SELECT + - 10 / - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0
0
1

query I rowsort
SELECT DISTINCT + col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT + 44 FROM tab1 AS cor0 GROUP BY col1
----
44

query I rowsort
SELECT DISTINCT 78 AS col0 FROM tab1 GROUP BY col0
----
78

query I rowsort
SELECT ALL + + 74 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
74
74
74

onlyif mysql # DIV for integer division: 
query I rowsort label-8817
SELECT DISTINCT ( col0 ) + col0 DIV + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
14
90
91

skipif mysql # not compatible
query I rowsort label-8817
SELECT DISTINCT ( col0 ) + col0 / + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
14
90
91

query I rowsort
SELECT + 99 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
99
99
99

query II rowsort
SELECT ALL 54 * - col2 - 30, - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-8821
SELECT DISTINCT - col2 DIV - ( + ( col1 ) ) AS col0 FROM tab1 GROUP BY col1, col2 HAVING + ( + 20 ) NOT IN ( + 49 )
----
0
1

skipif mysql # not compatible
query I rowsort label-8821
SELECT DISTINCT - col2 / - ( + ( col1 ) ) AS col0 FROM tab1 GROUP BY col1, col2 HAVING + ( + 20 ) NOT IN ( + 49 )
----
0
1

query I rowsort
SELECT ALL + 95 FROM tab2 GROUP BY col1, col2 HAVING 52 = + 75 + - - ( - - col2 ) + + NULLIF ( + + ( + + 64 ), col2 )
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL 0 FROM tab2 GROUP BY col1, col2
----
0
0
0

query I rowsort
SELECT 83 FROM tab0 GROUP BY col1
----
83
83

query I rowsort
SELECT DISTINCT 36 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT IN ( AVG ( DISTINCT + 85 ) + + 64 )
----

query I rowsort
SELECT + 26 * - col1 + col1 * - 41 * - col1 FROM tab1 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL - 70 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 + - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
164
44
56

onlyif mysql # DIV for integer division: 
query I rowsort label-8830
SELECT DISTINCT col2 DIV + 57 col0 FROM tab2 AS cor0 WHERE col1 <= col2 GROUP BY col2, col2
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8830
SELECT DISTINCT col2 / + 57 col0 FROM tab2 AS cor0 WHERE col1 <= col2 GROUP BY col2, col2
----
1

query I rowsort
SELECT col0 * + 48 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL - col2 AS col2, + 82 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
82
-71
82
-8
82

query I rowsort
SELECT - 99 * - col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
5742
7821
8613

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING - col1 + 21 IS NOT NULL
----
-41
-59
-61

query II rowsort
SELECT DISTINCT 40 AS col1, - col1 + + 80 * 73 - + 70 FROM tab1 GROUP BY col0, col1
----
40
5713
40
5726
40
5764

query I rowsort
SELECT ALL - col0 * + - 7 * - col0 AS col1 FROM tab2 GROUP BY col0, col1
----
-1575
-57967
-59248

query II rowsort
SELECT 20 * + col0 AS col1, - 17 AS col2 FROM tab0 GROUP BY col0
----
1660
-17
520
-17
860
-17

query II rowsort
SELECT - col0 AS col2, + col0 AS col2 FROM tab1 GROUP BY col0
----
-22
22
-28
28
-82
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL ( + col1 ) AS col0, col1 AS col2 FROM tab0 AS cor0 WHERE NOT ( + ( + col0 ) ) IS NULL GROUP BY col1 HAVING ( NOT col2 * + 27 * + - 3 <> NULL )
----

query I rowsort
SELECT - 92 - + + 12 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-104
-104
-104

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 * COALESCE ( 0, 77 * NULLIF ( + col0, - col0 ) + - 30, + col0, col1 * + 49 ) FROM tab1 WHERE NOT 27 * + - col1 IS NULL GROUP BY col0, col0 HAVING NOT + 81 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 44 AS col2 FROM tab1 WHERE NULL < NULL GROUP BY col1, col0
----

query I rowsort
SELECT + - col0 + + 30 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-61
-62
15

query I rowsort
SELECT DISTINCT + col0 * + 92 + 52 + col0 + + 4 * - 29 * + 97 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-3574
-8596
-9154

query II rowsort
SELECT ALL + col0 + - + col0 + + - col0 + - 39 * col1 AS col2, + col1 FROM tab2 GROUP BY col0, col1, col0
----
-1691
41
-2392
59
-2394
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL OR NOT - col0 < NULL
----
45
71
8

query I rowsort
SELECT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL <> ( col0 * 84 + - 24 )
----

query I rowsort
SELECT DISTINCT - + 65 FROM tab1 cor0 GROUP BY col0
----
-65

query I rowsort
SELECT - + ( - col0 ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( - + 75 ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL - col2 * + + 10 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
-14440
-5760
-62410

query I rowsort
SELECT DISTINCT + 67 FROM tab0 AS cor0 GROUP BY col2
----
67

query I rowsort
SELECT - 25 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
-25
-25
-25

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 60 AS col1, col0 + - col0 col2 FROM tab1 GROUP BY col0
----
60
0

query I rowsort
SELECT 37 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 91 * 42 + col1 IS NOT NULL
----

query I rowsort
SELECT 64 * - col1 + - 91 + - col2 + - + col2 + ( - ( - NULLIF ( - 25, col1 ) ) ) FROM tab0 AS cor0 WHERE NOT NULL < + COALESCE ( col1, + 67 * - + 23 ) GROUP BY col2, col0, col1 HAVING - 9 < - 62
----

query I rowsort
SELECT DISTINCT + + 76 FROM tab1 AS cor0 GROUP BY col1
----
76

query I rowsort
SELECT - + 59 * - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
-4779
0

query I rowsort
SELECT ALL + 80 FROM tab1 GROUP BY col0, col0, col2
----
80
80
80

query I rowsort
SELECT DISTINCT col2 + ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-12
-34
72

query I rowsort
SELECT ALL col2 + + - ( - col2 ) FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT - - ( - - ( col1 ) ) + - 69 * + 37 AS col1 FROM tab1 cor0 GROUP BY col1
----
-2496
-2509
-2547

query I rowsort
SELECT 3 AS col1 FROM tab0 GROUP BY col2, col2
----
3
3
3

query I rowsort
SELECT DISTINCT col0 * - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING 65 NOT IN ( 28 )
----
-225
-8281
-8464

query I rowsort
SELECT col1 FROM tab2 cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col0 / - 32 + + col0 * + col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 = - col0
----

query II rowsort
SELECT - col1 + + - col1, - 45 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 * 44 IS NULL
----
-114
-2565
-12
-270
-88
-1980

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 78 + 48 * 54 col0 FROM tab0 GROUP BY col0 HAVING NULL IN ( 8 - - col0 * col0 )
----

query I rowsort
SELECT + 90 + + 75 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * + 37 + - + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8870
SELECT col2 * CAST( 46 AS SIGNED ) FROM tab1 GROUP BY col2
----
2070
3266
368

skipif mysql # not compatible
query I rowsort label-8870
SELECT col2 * CAST ( 46 AS INTEGER ) FROM tab1 GROUP BY col2
----
2070
3266
368

query I rowsort
SELECT + + 75 + - 49 + col2 * 66 FROM tab0 AS cor0 GROUP BY col2
----
1610
2534
5240

query I rowsort
SELECT ALL 80 AS col0 FROM tab0 GROUP BY col2, col0
----
80
80
80

query II rowsort
SELECT DISTINCT + col1 + col0 AS col0, col1 FROM tab0 GROUP BY col1, col0
----
124
81
26
0
83
0

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col2 FROM tab2 cor0 GROUP BY col2, col2, col1
----
58
79
87

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 WHERE col2 < ( NULL ) GROUP BY col2, col2, col1 HAVING NOT col2 * + col1 IS NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING + 66 BETWEEN - 36 AND NULL
----

query I rowsort
SELECT DISTINCT - 16 + - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 IS NOT NULL
----
-24
-61
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 - + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING NOT ( 40 ) IS NULL
----
-24
-38
-79

query I rowsort
SELECT col0 * + col1 + col0 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NULL ) NOT IN ( 63 / - 63 )
----

query I rowsort
SELECT 73 AS col2 FROM tab2 GROUP BY col1
----
73
73
73

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8883
SELECT CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8883
SELECT CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 90 AS col2 FROM tab1 GROUP BY col1, col0
----
-90
-90
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - 29 AS col2 FROM tab2 GROUP BY col0, col0
----
-29
-29
-29

query I rowsort
SELECT col2 - - - col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT DISTINCT - + 60 FROM tab2 AS cor0 GROUP BY col0
----
-60

query I rowsort
SELECT DISTINCT + col0 + col0 + - 80 * - - col0 + - col0 FROM tab1 AS cor0 WHERE col1 BETWEEN NULL AND + col1 GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - 58 AS col0 FROM tab0 cor0 GROUP BY col2
----
-58
-58
-58

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8891
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN + col1 * + CAST( NULL AS SIGNED ) AND CAST( + AVG ( ALL 90 ) AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-8891
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN + col1 * + CAST ( NULL AS INTEGER ) AND CAST ( + AVG ( ALL 90 ) AS INTEGER )
----

query I rowsort
SELECT col2 * - 18 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 + 55 * - col2 AS col2 FROM tab1 GROUP BY col1, col2
----
-2430
-3834
-432

query I rowsort
SELECT DISTINCT - col1 * - col1 + - col1 FROM tab2 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT col0 <= + 53
----
-83

query I rowsort
SELECT ( - col1 ) FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT ( + 79 ) FROM tab1 GROUP BY col1
----
79
79
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8898
SELECT ALL 52 * - ( - col2 * + CAST( NULL AS SIGNED ) ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-8898
SELECT ALL 52 * - ( - col2 * + CAST ( NULL AS INTEGER ) ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL col0 * 92 AS col2 FROM tab0 GROUP BY col0, col2 HAVING + col2 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8900
SELECT ALL + col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( CAST( NULL AS SIGNED ) ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-8900
SELECT ALL + col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( CAST ( NULL AS INTEGER ) ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col2 HAVING - 90 * + 75 NOT BETWEEN col2 AND ( NULL )
----
-26
-43
-83

query I rowsort
SELECT ALL 23 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
23
23
23

query I rowsort
SELECT ALL + col0 + ( 85 ) * col0 FROM tab0 AS cor0 GROUP BY col0
----
2236
3698
7138

query I rowsort
SELECT + 90 FROM tab0 AS cor0 GROUP BY col0, col0
----
90
90
90

query I rowsort
SELECT col2 - + col2 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - 13 * 50 + - 38 AS col2 FROM tab2 GROUP BY col0
----
-688
-688
-688

query I rowsort
SELECT ALL 36 AS col0 FROM tab2 GROUP BY col1, col0
----
36
36
36

query I rowsort
SELECT DISTINCT col0 * col1 AS col1 FROM tab1 GROUP BY col1, col0
----
132
1596
3608

query I rowsort
SELECT + 63 * col1 FROM tab2 GROUP BY col1
----
2583
3717
3843

query I rowsort
SELECT DISTINCT - 63 / col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL - 29 FROM tab1 AS cor0 GROUP BY col0, col2
----
-29
-29
-29

query I rowsort
SELECT 24 FROM tab1 cor0 GROUP BY col0 HAVING 41 + 90 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col0 * - 21 FROM tab0 GROUP BY col0 HAVING ( NULL ) = NULL
----

query I rowsort
SELECT + 18 FROM tab0 GROUP BY col2
----
18
18
18

query I rowsort
SELECT ALL - 65 FROM tab2 AS cor0 GROUP BY col0
----
-65
-65
-65

query I rowsort
SELECT col0 + - + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + ( col1 ) AS col1 FROM tab2 GROUP BY col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8918
SELECT DISTINCT + + col0 AS col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN col0 / - col1 AND + CAST( NULL AS SIGNED ) GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-8918
SELECT DISTINCT + + col0 AS col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN col0 / - col1 AND + CAST ( NULL AS INTEGER ) GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8919
SELECT DISTINCT + 73 DIV 85 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL OR NOT NULL = NULL
----
0

skipif mysql # not compatible
query I rowsort label-8919
SELECT DISTINCT + 73 / 85 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL OR NOT NULL = NULL
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col2, col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT - - 96 FROM tab2 AS cor0 GROUP BY col1, col1
----
96
96
96

query I rowsort
SELECT ALL + - col0 * + - 47 * 60 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
231322
62062
78988

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + 37 * - ( - NULLIF ( - col2, - CASE - 78 WHEN - 26 THEN NULL ELSE 7 END ) ) / - col2 FROM tab1 GROUP BY col2 HAVING ( col2 ) IS NULL
----

query III rowsort
SELECT + ( + ( - + col1 ) ), col1 AS col0, - 83 AS col0 FROM tab0 cor0 GROUP BY col2, col1 HAVING ( NULL ) >= col2
----

query I rowsort
SELECT DISTINCT + 7 - - - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
-1
-38
-64

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL > ( + - 20 * + col0 )
----

query I rowsort
SELECT ALL 21 AS col0 FROM tab0 GROUP BY col2, col2, col0
----
21
21
21

query I rowsort
SELECT ALL 10 * - col2 AS col0 FROM tab2 GROUP BY col2, col2, col2 HAVING + 7 IS NOT NULL
----
-580
-790
-870

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT - 37 >= - + 87
----

query II rowsort
SELECT DISTINCT col1 * - - 77 - + + col1 AS col0, + 15 FROM tab1 GROUP BY col1
----
3344
15
4332
15
456
15

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL - col2 + - + col2 FROM tab0 GROUP BY col1, col2 HAVING NOT + + 63 IS NULL
----
-158
-48
-76

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col1, col2
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 68 col2, + col0 FROM tab0 AS cor0 GROUP BY col0
----
68
26
68
43
68
83

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL BETWEEN - col0 AND NULL
----

query I rowsort
SELECT 61 + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-22
18
35

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 12 * - col1 col2 FROM tab0 cor0 GROUP BY col1
----
0
972

query I rowsort
SELECT DISTINCT - 69 FROM tab1 AS cor0 GROUP BY col1 HAVING + COALESCE ( - col1, - col1 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8940
SELECT ALL col1 DIV + col1 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8940
SELECT ALL col1 / + col1 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT + 2 * - 57 AS col0 FROM tab1 GROUP BY col1
----
-114

query I rowsort
SELECT + col2 * 0 * + 85 AS col2 FROM tab1 GROUP BY col2, col1
----
0
0
0

query II rowsort
SELECT DISTINCT 14, col0 AS col0 FROM tab1 GROUP BY col0
----
14
22
14
28
14
82

query I rowsort
SELECT + 91 AS col0 FROM tab2 WHERE NOT + ( + - col1 ) IN ( + - CASE 82 WHEN col1 * + col1 THEN NULL ELSE - 64 END, - col0, 30 ) GROUP BY col1, col2
----
91
91
91

onlyif mysql # DIV for integer division: 
query I rowsort label-8945
SELECT DISTINCT col0 DIV COALESCE ( + 74, - 77 - - + 32 ) FROM tab0 AS cor0 GROUP BY col0
----
0
1

skipif mysql # not compatible
query I rowsort label-8945
SELECT DISTINCT col0 / COALESCE ( + 74, - 77 - - + 32 ) FROM tab0 AS cor0 GROUP BY col0
----
0
1

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query II rowsort
SELECT - col2 * + ( + 1 ), - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + + 33 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 55 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
55

query I rowsort
SELECT col2 + - col2 FROM tab1 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT - col1 * + col1 * col1 * + 89 + - - 54 AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
-16482123
-19170
-7581322

query II rowsort
SELECT col2 * - 8 * - + col2 AS col2, + 8 FROM tab0 GROUP BY col2
----
11552
8
4608
8
49928
8

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8953
SELECT DISTINCT + col2 + 5 + + col1 col0, 50 - - 34 * ( + CAST( NULL AS SIGNED ) ) AS col1 FROM tab0 GROUP BY col2, col1
----
110
NULL
43
NULL
84
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8953
SELECT DISTINCT + col2 + 5 + + col1 col0, 50 - - 34 * ( + CAST ( NULL AS INTEGER ) ) AS col1 FROM tab0 GROUP BY col2, col1
----
110
NULL
43
NULL
84
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8954
SELECT + CAST( NULL AS SIGNED ) * col0 + + col0 col2 FROM tab2 AS cor0 WHERE NOT - 72 IS NOT NULL GROUP BY col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8954
SELECT + CAST ( NULL AS INTEGER ) * col0 + + col0 col2 FROM tab2 AS cor0 WHERE NOT - 72 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ( col2 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( col0 IS NOT NULL )
----

query I rowsort
SELECT ALL + 60 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1320
-1680
-4920

query I rowsort
SELECT ALL - 26 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-26
-26
-26

query II rowsort
SELECT 48, col0 FROM tab1 GROUP BY col0 HAVING NOT NULL < 70 * - - col0 * - col0
----

query I rowsort
SELECT col0 * + - ( + + col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NULL >= ( + col0 ) GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8962
SELECT + col2 DIV col2 col0 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8962
SELECT + col2 / col2 col0 FROM tab2 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 47 col1 FROM tab2 GROUP BY col1 HAVING + 11 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8964
SELECT ALL + CAST( NULL AS SIGNED ) AS col1, col2 FROM tab2 AS cor0 GROUP BY col2
----
NULL
58
NULL
79
NULL
87

skipif mysql # not compatible
query II rowsort label-8964
SELECT ALL + CAST ( NULL AS INTEGER ) AS col1, col2 FROM tab2 AS cor0 GROUP BY col2
----
NULL
58
NULL
79
NULL
87

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
0
0
81

query II rowsort
SELECT + - 42, + col2 + + 96 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-42
104
-42
141
-42
167

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 + + ( col0 ) + + ( 72 ) col0 FROM tab0 GROUP BY col0, col0
----
124
158
238

query I rowsort
SELECT ALL - - col0 * - ( col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT - + 2 * - 17 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-49
-9
8

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + ( - col2 ) FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * - col2 col0 FROM tab1 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT + col1 + - 61 FROM tab0 GROUP BY col0, col1
----
-61
20

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT - col2 FROM tab1 WHERE - - 0 = col1 GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col1 * - - 88 + + - col1 FROM tab2 GROUP BY col2, col1
----
3567
5133
5307

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab2 GROUP BY col0, col0
----
-182
-184
-30

query I rowsort
SELECT DISTINCT col1 * + col1 + - col1 FROM tab1 cor0 WHERE + 2 + + 69 IS NOT NULL GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT ALL + + col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT 64 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
64

query I rowsort
SELECT 74 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - ( col2 ) FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8983
SELECT + CAST( col2 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-8983
SELECT + CAST ( col2 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-8985
SELECT DISTINCT - - col1 * + ( + - CAST( NULL AS DECIMAL ) ) + 12 FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-8985
SELECT DISTINCT - - col1 * + ( + - CAST ( NULL AS REAL ) ) + 12 FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-8986
SELECT - col1 DIV - + 39 + - col2 FROM tab2 GROUP BY col2, col1
----
-57
-78
-86

skipif mysql # not compatible
query I rowsort label-8986
SELECT - col1 / - + 39 + - col2 FROM tab2 GROUP BY col2, col1
----
-57
-78
-86

query I rowsort
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL BETWEEN NULL AND - col0
----

query I rowsort
SELECT col2 * 22 + col2 FROM tab0 GROUP BY col2 HAVING 32 * 7 IS NULL
----

query I rowsort
SELECT ( - col0 ) FROM tab0 GROUP BY col0 HAVING ( col0 ) NOT IN ( col0 )
----

query I rowsort
SELECT + - 43 FROM tab2 AS cor0 GROUP BY col1
----
-43
-43
-43

query I rowsort
SELECT DISTINCT + 61 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT col1 * - 5 NOT BETWEEN NULL AND col1 / + 7
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab2 WHERE NOT + col2 * 4 >= col2 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 7 col1 FROM tab2 GROUP BY col1
----
-7

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + COALESCE ( - ( + 44 ), 60 / col0 ) FROM tab0 WHERE NOT - col2 * 32 NOT BETWEEN ( COALESCE ( - col2, + col0 ) ) AND NULL GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - ( col1 ) AS col1 FROM tab1 GROUP BY col1
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8998
SELECT ALL - 94 + CAST( + col2 AS SIGNED ) FROM tab2 cor0 GROUP BY col2
----
-15
-36
-7

skipif mysql # not compatible
query I rowsort label-8998
SELECT ALL - 94 + CAST ( + col2 AS INTEGER ) FROM tab2 cor0 GROUP BY col2
----
-15
-36
-7

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 WHERE NOT NULL BETWEEN + col0 * + 1 AND ( NULL ) GROUP BY col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 AS cor0 WHERE NOT ( + 84 + + 75 * + col2 ) NOT IN ( col0 ) GROUP BY col0, col0, col1 HAVING - col0 * - 45 < col0
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 WHERE col2 IS NOT NULL GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-9002
SELECT ALL + + 99 * col0 + + 82 DIV - 72 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
2177
2771
8117

skipif mysql # not compatible
query I rowsort label-9002
SELECT ALL + + 99 * col0 + + 82 / - 72 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
2177
2771
8117

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT ( AVG ( - col0 ) * + 25 ) >= NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT 0 BETWEEN - 44 / + 57 AND ( + 72 )
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL col2 + - - COALESCE ( 85, ( + 86 ) ) + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
201
243
259

query I rowsort
SELECT DISTINCT col2 + - 70 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-32
-46
9

query I rowsort
SELECT ALL - ( + col2 ) * 28 AS col2 FROM tab2 cor0 GROUP BY col2
----
-1624
-2212
-2436

query I rowsort
SELECT + 53 FROM tab1 GROUP BY col1
----
53
53
53

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL AND ( NULL ) NOT BETWEEN ( NULL ) AND + - 62
----

query I rowsort
SELECT 66 AS col0 FROM tab1 GROUP BY col1 HAVING NOT col1 <= - col1
----
66
66
66

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + + col1 * - + 62 + + 12 * - 34 col0 FROM tab2 AS cor0 GROUP BY col1
----
-2909
-4007
-4129

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9013
SELECT ALL + 96 DIV 90 + - CAST( 33 AS SIGNED ) AS col0 FROM tab1 GROUP BY col1, col1, col1
----
-32
-32
-32

skipif mysql # not compatible
query I rowsort label-9013
SELECT ALL + 96 / 90 + - CAST ( 33 AS INTEGER ) AS col0 FROM tab1 GROUP BY col1, col1, col1
----
-32
-32
-32

query I rowsort
SELECT 90 FROM tab0 WHERE ( NULL ) BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT + 91 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
91
91
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0, 52 col2 FROM tab2 GROUP BY col1, col0
----
15
52
91
52
92
52

query I rowsort
SELECT ALL 96 * + 59 - col1 AS col2 FROM tab0 GROUP BY col1
----
5583
5664

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING 79 * - col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 19 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-19
-19
-19

query I rowsort
SELECT DISTINCT + col1 + - ( - col1 ) + + 77 FROM tab2 WHERE + + col1 * + - 18 + - col0 <= NULL GROUP BY col1
----

query II rowsort
SELECT DISTINCT col0 * 8 AS col0, - 78 FROM tab0 GROUP BY col0
----
208
-78
344
-78
664
-78

query I rowsort
SELECT ALL - - 10 FROM tab2 AS cor0 GROUP BY col0, col1
----
10
10
10

query II rowsort
SELECT DISTINCT ( 18 ) * + 1, - col2 AS col2 FROM tab2 GROUP BY col2
----
18
-58
18
-79
18
-87

query I rowsort
SELECT DISTINCT - 53 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-53

query I rowsort
SELECT ALL + col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * + - col2 col0 FROM tab2 GROUP BY col2, col1
----
2378
4661
5307

query I rowsort
SELECT - 23 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-23
-23
-23

query I rowsort
SELECT + 86 * 12 FROM tab0 AS cor0 WHERE - ( col2 ) IS NOT NULL GROUP BY col0, col2
----
1032
1032
1032

query II rowsort
SELECT + 87, 81 AS col2 FROM tab2 cor0 GROUP BY col0, col0, col2
----
87
81
87
81
87
81

query II rowsort
SELECT col2, - col1 + + CASE 13 WHEN - col1 THEN + col1 + + col1 ELSE - col1 END AS col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1, col1 HAVING + ( - col0 ) <= ( col2 )
----
45
-114
71
-88
8
-12

query I rowsort
SELECT + 10 * col1 + - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1271
-2891
-3111

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING ( NOT 69 - col2 + + 36 IS NULL )
----
0
0
81

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NOT + col0 NOT BETWEEN NULL AND - + col2 GROUP BY col0
----

query I rowsort
SELECT col0 * - + 18 FROM tab1 AS cor0 GROUP BY col0
----
-1476
-396
-504

query II rowsort
SELECT col0, - col0 + - col0 FROM tab1 GROUP BY col1, col0 HAVING ( NULL ) IS NULL
----
22
-44
28
-56
82
-164

query I rowsort
SELECT ALL col1 + + col1 AS col1 FROM tab0 GROUP BY col1, col1, col1
----
0
162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 45 col1 FROM tab2 GROUP BY col0
----
45
45
45

query I rowsort
SELECT DISTINCT col1 * col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT + - 19 BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 + - 66 FROM tab0 AS cor0 GROUP BY col2
----
-28
-42
13

query I rowsort
SELECT ALL - col0 + - ( 56 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-147
-148
-71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - 95 * - - col0 AS col2 FROM tab1 GROUP BY col0 HAVING ( NOT NULL NOT IN ( ( + 0 ) ) )
----

query I rowsort
SELECT col0 + - + col0 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT 52 FROM tab2 cor0 GROUP BY col0
----
52
52
52

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9046
SELECT CAST( - 50 AS SIGNED ) col1 FROM tab1 AS cor0 GROUP BY col2
----
-50
-50
-50

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9046
SELECT CAST ( - 50 AS INTEGER ) col1 FROM tab1 AS cor0 GROUP BY col2
----
-50
-50
-50

query I rowsort
SELECT col1 * ( col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + 4 FROM tab0 WHERE NOT + - col2 IS NOT NULL GROUP BY col1
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9049
SELECT + CAST( NULL AS DECIMAL ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9049
SELECT + CAST ( NULL AS REAL ) FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT + col0 + + + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
166
52
86

query I rowsort
SELECT DISTINCT - col2 * + 18 AS col0 FROM tab1 AS cor0 WHERE NULL < + col2 * + + col0 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9052
SELECT ALL - + CAST( NULL AS SIGNED ) * + col0 + + - col0 * + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9052
SELECT ALL - + CAST ( NULL AS INTEGER ) * + col0 + + - col0 * + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - ( + + col0 ) - col0 * col0 * + + ( - col0 ) * - + col0 - 69 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
-50709
-68575121
-71639457

query I rowsort
SELECT + + 63 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING - ( + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 AS col0 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL 0 AS col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL 38 * + col1 + + + 6 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1564
2248
2324

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 col0, col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
81
0
0

query I rowsort
SELECT DISTINCT 37 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + 23 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-102
-110
-81

query II rowsort
SELECT col2 AS col1, ( col2 ) / + ( - col2 ) + + 32 FROM tab2 AS cor0 WHERE - col1 * - col2 IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 AS cor0 WHERE NOT - col2 + - 18 IS NOT NULL GROUP BY col2 HAVING ( ( col2 IS NULL ) )
----

query I rowsort
SELECT + 12 FROM tab2 AS cor0 GROUP BY col1, col2
----
12
12
12

query I rowsort
SELECT 20 FROM tab0 AS cor0 GROUP BY col2, col2
----
20
20
20

query I rowsort
SELECT ALL + 96 FROM tab1 AS cor0 GROUP BY col0
----
96
96
96

query I rowsort
SELECT col2 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-9069
SELECT ALL + ( + col1 ), ( + col1 ) * + col1 * - + ( - col1 ) + + 72 - + ( 79 ) * CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col1 HAVING + ( + col1 ) > NULL
----

skipif mysql # not compatible
query II rowsort label-9069
SELECT ALL + ( + col1 ), ( + col1 ) * + col1 * - + ( - col1 ) + + 72 - + ( 79 ) * CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col1 HAVING + ( + col1 ) > NULL
----

query I rowsort
SELECT ALL - ( + ( - 82 ) ) FROM tab2 GROUP BY col0, col1 HAVING + col0 IS NOT NULL
----
82
82
82

query I rowsort
SELECT DISTINCT col1 * col0 FROM tab2 GROUP BY col0, col1, col0
----
3772
5369
915

query I rowsort
SELECT ALL col0 * + + 31 FROM tab1 GROUP BY col0, col1 HAVING NOT - 35 IS NULL
----
2542
682
868

query I rowsort
SELECT + 66 * + - col0 AS col2 FROM tab2 GROUP BY col0, col2
----
-6006
-6072
-990

query I rowsort
SELECT ALL - col0 * + col0 AS col2 FROM tab2 GROUP BY col2, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT + 53 * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 WHERE NOT NULL >= NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL - - col2 * - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT 91 IS NOT NULL
----

query I rowsort
SELECT + ( + + col0 ) AS col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query II rowsort
SELECT 35 AS col1, 21 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( ( 85 IS NOT NULL ) )
----

query I rowsort
SELECT ALL + col0 + + ( - 42 ) AS col2 FROM tab0 WHERE - col1 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab0 WHERE NOT + 23 * - CASE - - col2 WHEN - + 79 + + - col1 THEN - col2 ELSE - 40 * - col2 * 68 + + col1 * + col1 END IS NULL GROUP BY col1
----
0
162

query I rowsort
SELECT ALL 13 AS col1 FROM tab0 cor0 WHERE - ( + - col0 ) NOT BETWEEN col1 AND NULL GROUP BY col0
----
13

query II rowsort
SELECT DISTINCT + col0, col0 * + + 57 AS col1 FROM tab1 GROUP BY col0 HAVING ( NOT ( - 25 * - 57 ) IS NULL )
----
22
1254
28
1596
82
4674

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9084
SELECT ALL + CASE - + col2 WHEN + col1 * + col1 / + CAST( + 50 AS SIGNED ) THEN NULL WHEN + - 33 THEN + 57 WHEN 28 THEN NULL WHEN + - col2 THEN NULL ELSE - col2 END + + col1 + col2 AS col0 FROM tab1 GROUP BY col1, col2, col1 HAVING 23 = + col1 * - AVG ( - 17 )
----

skipif mysql # not compatible
query I rowsort label-9084
SELECT ALL + CASE - + col2 WHEN + col1 * + col1 / + CAST ( + 50 AS INTEGER ) THEN NULL WHEN + - 33 THEN + 57 WHEN 28 THEN NULL WHEN + - col2 THEN NULL ELSE - col2 END + + col1 + col2 AS col0 FROM tab1 GROUP BY col1, col2, col1 HAVING 23 = + col1 * - AVG ( - 17 )
----

query I rowsort
SELECT col0 * + 36 + - + col0 + - col0 FROM tab1 GROUP BY col0, col0
----
2788
748
952

query I rowsort
SELECT DISTINCT col1 + - col2 FROM tab1 GROUP BY col2, col1, col2
----
-2
-27
12

query II rowsort
SELECT - + col2 AS col1, col2 + col2 * + + 49 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
2250
-71
3550
-8
400

query I rowsort
SELECT + - col0 / - ( - - 18 ) FROM tab1 AS cor0 WHERE ( + - col0 ) + col0 < - + 34 GROUP BY col1, col2, col0
----

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NOT ( + 89 ) IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2 HAVING NOT 66 - - + col2 / - - 66 + 87 / + + 73 IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL ( + 1 ) * col2 + - 76 FROM tab1 GROUP BY col2
----
-31
-5
-68

query I rowsort
SELECT ALL - 49 FROM tab2 AS cor0 GROUP BY col1
----
-49
-49
-49

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + col2 col2 FROM tab0 GROUP BY col2, col1 HAVING ( NULL ) IN ( col2 / col2 )
----

query I rowsort
SELECT DISTINCT + - 44 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-44

query I rowsort
SELECT ALL col0 + + 64 + + + col0 * 4 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
174
204
474

query I rowsort
SELECT DISTINCT - - col2 - - 1 FROM tab0 AS cor0 GROUP BY col2
----
25
39
80

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - 32 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IN ( - 8 )
----

query I rowsort
SELECT ALL + + 6 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + 39 IS NULL
----

query I rowsort
SELECT - + 24 FROM tab0 AS cor0 WHERE NOT + 87 IS NULL GROUP BY col2
----
-24
-24
-24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9100
SELECT DISTINCT + + col0 * col0 * - CAST( - 35 AS SIGNED ) - + 82 FROM tab2 AS cor0 GROUP BY col0
----
289753
296158
7793

skipif mysql # not compatible
query I rowsort label-9100
SELECT DISTINCT + + col0 * col0 * - CAST ( - 35 AS INTEGER ) - + 82 FROM tab2 AS cor0 GROUP BY col0
----
289753
296158
7793

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab0 GROUP BY col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - 19 AS col1 FROM tab1 GROUP BY col2 HAVING + + 51 NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - ( - - col1 ) FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 + col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NULL
----
0

query II rowsort
SELECT DISTINCT - 71, col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-71
45
-71
71
-71
8

query I rowsort
SELECT - - col0 * - col0 + + ( - col0 ) + - - 83 FROM tab0 AS cor0 GROUP BY col0
----
-1809
-619
-6889

query I rowsort
SELECT + 18 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 5 + col1 col1 FROM tab2 GROUP BY col2, col1, col0 HAVING NOT col2 IS NULL
----
46
64
66

query I rowsort
SELECT 46 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
46
46

query I rowsort
SELECT ALL - 95 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT 22 IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT 15 + + + 88 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
103

query I rowsort
SELECT - col1 * + col1 * + + col1 FROM tab0 GROUP BY col1 HAVING + 47 IS NULL
----

query I rowsort
SELECT DISTINCT 35 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
35

query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN ( NULL ) AND 63 GROUP BY col0
----

query I rowsort
SELECT + - col2 * + col2 * + 27 + - 83 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-136190
-1811
-54758

query I rowsort
SELECT - + 47 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col0 FROM tab1 WHERE NULL < COALESCE ( - COALESCE ( - col1, - ( + + col2 ) ), - col2 ) GROUP BY col1
----

query I rowsort
SELECT ALL 19 FROM tab2 GROUP BY col1, col0
----
19
19
19

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - 35 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-35
-35
-35

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + + 6 IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - ( + col1 ) ) AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT + 43 / 95 > - col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9126
SELECT DISTINCT col1 DIV + - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT - col1 * ( - col1 ) + col1 IS NULL
----
-1

skipif mysql # not compatible
query I rowsort label-9126
SELECT DISTINCT col1 / + - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT - col1 * ( - col1 ) + col1 IS NULL
----
-1

query I rowsort
SELECT - 53 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-53
-53
-53

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN 66 * + - col0 AND - col0 * - col1 GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query II rowsort
SELECT col2 AS col2, 21 + + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
-60
38
21
79
21

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - NULLIF ( + 48, - - 76 ) col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-48
-48
-48

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING ( NULL IS NULL )
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 * + + col2 + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
1482
600
6320

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9134
SELECT CAST( + 21 AS SIGNED ) + - - col1 + - - col0 * + col0 * col0 col1 FROM tab0 WHERE NOT + + col2 * - col2 BETWEEN - - col0 AND - col1 + + col2 GROUP BY col0, col1
----
17597
571808
79609

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9134
SELECT CAST ( + 21 AS INTEGER ) + - - col1 + - - col0 * + col0 * col0 col1 FROM tab0 WHERE NOT + + col2 * - col2 BETWEEN - - col0 AND - col1 + + col2 GROUP BY col0, col1
----
17597
571808
79609

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9136
SELECT CAST( NULL AS SIGNED ) * + col2 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9136
SELECT CAST ( NULL AS INTEGER ) * + col2 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT 34 FROM tab0 AS cor0 GROUP BY col1
----
34

query I rowsort
SELECT + - col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL + col0 * - + 9 * 91 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + + col0 IS NOT NULL
----

query I rowsort
SELECT + 74 + col1 / - - col1 + col1 * + col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - 75 FROM tab2 AS cor0 GROUP BY col1, col1
----
-75

query I rowsort
SELECT ALL - ( + col1 ) - 49 * + - CASE + col1 WHEN col0 THEN - - col1 END FROM tab0 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT 59 IS NULL
----
164
44
56

query I rowsort
SELECT - 98 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 <= + 36
----
-98
-98
-98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL col1 AS col0, col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL < col0
----

query I rowsort
SELECT col0 - col2 * + 71 FROM tab1 GROUP BY col2, col0 HAVING NOT - col0 > NULL
----

query I rowsort
SELECT - 64 FROM tab1 GROUP BY col0, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT - 91 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-135
-148
-97

query I rowsort
SELECT ALL - col0 + - - col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + 73 * 9 FROM tab1 GROUP BY col0
----
657

onlyif mysql # DIV for integer division: 
query I rowsort label-9151
SELECT + - col0 DIV - 24 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
1
1
3

skipif mysql # not compatible
query I rowsort label-9151
SELECT + - col0 / - 24 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
1
1
3

onlyif mysql # DIV for integer division: 
query I rowsort label-9152
SELECT 85 DIV + - 35 FROM tab2 WHERE + 20 IS NOT NULL GROUP BY col1
----
-2
-2
-2

skipif mysql # not compatible
query I rowsort label-9152
SELECT 85 / + - 35 FROM tab2 WHERE + 20 IS NOT NULL GROUP BY col1
----
-2
-2
-2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab0 WHERE NULL NOT BETWEEN + ( ( - col1 ) ) AND + - col0 GROUP BY col0, col1, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col0, 12 AS col1 FROM tab2 AS cor0 WHERE - col0 < NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9155
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9155
SELECT ALL CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT + 95 AS col1 FROM tab0 GROUP BY col2, col2
----
95
95
95

onlyif mysql # DIV for integer division: 
query I rowsort label-9157
SELECT ALL col2 * + + col2 DIV + col2 - + col2 * col2 * - col2 FROM tab1 GROUP BY col2
----
357982
520
91170

skipif mysql # not compatible
query I rowsort label-9157
SELECT ALL col2 * + + col2 / + col2 - + col2 * col2 * - col2 FROM tab1 GROUP BY col2
----
357982
520
91170

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL col1 + col1 FROM tab0 GROUP BY col1, col1
----
0
162

query I rowsort
SELECT col2 + + + 86 AS col1 FROM tab0 GROUP BY col2, col0
----
110
124
165

query I rowsort
SELECT DISTINCT - 36 FROM tab0 GROUP BY col2, col0
----
-36

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query II rowsort
SELECT COALESCE ( - col2, + - 17 ), + col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9165
SELECT ALL + col0 * col0 + + CAST( NULL AS SIGNED ), ( col0 ) FROM tab1 GROUP BY col0, col0
----
NULL
22
NULL
28
NULL
82

skipif mysql # not compatible
query II rowsort label-9165
SELECT ALL + col0 * col0 + + CAST ( NULL AS INTEGER ), ( col0 ) FROM tab1 GROUP BY col0, col0
----
NULL
22
NULL
28
NULL
82

query I rowsort
SELECT - 84 AS col0 FROM tab0 GROUP BY col2
----
-84
-84
-84

query I rowsort
SELECT ALL - 35 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-35
-35
-35

query I rowsort
SELECT + col0 * col0 * - 59 FROM tab2 GROUP BY col0
----
-13275
-488579
-499376

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9169
SELECT DISTINCT col0 * + CAST( NULL AS DECIMAL ) + + col0 AS col1 FROM tab2 GROUP BY col0
----
NULL

skipif mysql # not compatible
query I rowsort label-9169
SELECT DISTINCT col0 * + CAST ( NULL AS REAL ) + + col0 AS col1 FROM tab2 GROUP BY col0
----
NULL

query II rowsort
SELECT 15 - - - 82 * - - col0 * + col0, col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT - col2 AS col2, - col2 FROM tab0 GROUP BY col2, col0
----
-24
-24
-38
-38
-79
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT ( - + col0 ), col2 col1 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT 27 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT + 63 + - + ( + + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-8
18
55

query I rowsort
SELECT - + col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( ( - + col1 IS NOT NULL ) )
----

query I rowsort
SELECT col1 * - + 5 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-220
-285
-30

query I rowsort
SELECT ( + - ( - col2 ) ) FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT 46 + + col2 + + col2 AS col1 FROM tab2 GROUP BY col2 HAVING - - ( + 81 ) IS NOT NULL
----
162
204
220

query I rowsort
SELECT ( col0 ) FROM tab0 WHERE NOT + col1 IS NULL GROUP BY col0, col1 HAVING NULL IS NULL
----
26
43
83

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9180
SELECT ALL col1 * - CAST( - 12 AS DECIMAL ) FROM tab0 AS cor0 WHERE NOT col0 / + 51 NOT IN ( - col2 ) GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-9180
SELECT ALL col1 * - CAST ( - 12 AS REAL ) FROM tab0 AS cor0 WHERE NOT col0 / + 51 NOT IN ( - col2 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT ( + + 10 ) FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
10

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9182
SELECT DISTINCT - + ( - - 19 ) / CAST( NULL AS SIGNED ) + 29 * + + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9182
SELECT DISTINCT - + ( - - 19 ) / CAST ( NULL AS INTEGER ) + 29 * + + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
NULL

query I rowsort
SELECT ALL ( col2 ) FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - ( - 7 ) + col0 AS col2 FROM tab1 GROUP BY col0
----
29
35
89

query I rowsort
SELECT ALL - + 14 * ( 35 ) + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-433
-446
-484

query I rowsort
SELECT + col2 * + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING 96 IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * + - 3 FROM tab1 cor0 GROUP BY col2
----
-135
-213
-24

query I rowsort
SELECT + - 80 FROM tab2 AS cor0 GROUP BY col0
----
-80
-80
-80

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col2 HAVING NOT 99 IS NULL
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9192
SELECT DISTINCT ( - col2 ) - 20 AS col2 FROM tab2 AS cor0 WHERE ( NULL ) BETWEEN ( + 10 * - - CAST( NULL AS SIGNED ) ) AND NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-9192
SELECT DISTINCT ( - col2 ) - 20 AS col2 FROM tab2 AS cor0 WHERE ( NULL ) BETWEEN ( + 10 * - - CAST ( NULL AS INTEGER ) ) AND NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9194
SELECT DISTINCT - col1 * - 29 * CAST( NULL AS SIGNED ) * + col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + 54 IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-9194
SELECT DISTINCT - col1 * - 29 * CAST ( NULL AS INTEGER ) * + col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + 54 IS NOT NULL
----

query I rowsort
SELECT ALL col1 + + col2 FROM tab1 GROUP BY col1, col2, col2
----
102
115
14

query I rowsort
SELECT ALL - col1 * - col2 FROM tab1 GROUP BY col1, col2
----
2565
3124
48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - + col1 + col1 col2 FROM tab2 GROUP BY col1, col2
----
2419
4720
5368

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - 1 AS col1 FROM tab0 cor0 GROUP BY col1, col2, col2, col0
----
-1
-1
-1

query I rowsort
SELECT 36 AS col1 FROM tab1 AS cor0 WHERE col1 IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9201
SELECT DISTINCT - CAST( NULL AS SIGNED ) * - 90 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 0 + 66 IS NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-9201
SELECT DISTINCT - CAST ( NULL AS INTEGER ) * - 90 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT 0 + 66 IS NULL
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9202
SELECT ALL + CASE 91 WHEN 94 / + - CAST( - col2 AS SIGNED ) + + col1 THEN - 19 ELSE NULL END * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING col2 * + col2 IS NULL
----

skipif mysql # not compatible
query I rowsort label-9202
SELECT ALL + CASE 91 WHEN 94 / + - CAST ( - col2 AS INTEGER ) + + col1 THEN - 19 ELSE NULL END * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING col2 * + col2 IS NULL
----

query I rowsort
SELECT col0 * - 65 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1690
-2795
-5395

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9204
SELECT ALL 52 * - col2 FROM tab0 WHERE - - col1 / + col2 * + ( CAST( NULL AS DECIMAL ) ) + - 39 + - 52 NOT IN ( - col1 ) GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-9204
SELECT ALL 52 * - col2 FROM tab0 WHERE - - col1 / + col2 * + ( CAST ( NULL AS REAL ) ) + - 39 + - 52 NOT IN ( - col1 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query II rowsort
SELECT ALL - 8, col0 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-8
0
-8
0
-8
0

query I rowsort
SELECT ALL 28 + - col2 FROM tab0 GROUP BY col2, col2
----
-10
-51
4

query I rowsort
SELECT ALL col2 + - + 57 + ( - col2 ) - 2 * 32 FROM tab0 GROUP BY col2, col2
----
-121
-121
-121

query I rowsort
SELECT ALL NULLIF ( - 23, 59 ) + + + 20 - 49 AS col0 FROM tab2 GROUP BY col2, col1
----
-52
-52
-52

query I rowsort
SELECT ALL 44 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9211
SELECT + col1 * + 6 / - CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1, col0 HAVING ( NULL ) <> - ( col0 )
----

skipif mysql # not compatible
query I rowsort label-9211
SELECT + col1 * + 6 / - CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1, col0 HAVING ( NULL ) <> - ( col0 )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9212
SELECT + col2 DIV - + col2 AS col0 FROM tab1 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9212
SELECT + col2 / - + col2 AS col0 FROM tab1 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING + col2 * + col2 / + 76 * 85 >= NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( + ( + 70 ) * - col1 ) BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT - 9 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-9

query I rowsort
SELECT ALL + 58 + + col2 FROM tab0 cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
137
82
96

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING 5 IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL < + 55 / - col2 + - - ( - + 56 ) * - col2
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + - 46 IN ( - AVG ( DISTINCT + 79 ) )
----

query I rowsort
SELECT - 73 + - 7 FROM tab1 AS cor0 GROUP BY col1
----
-80
-80
-80

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NOT ( col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col0 HAVING NOT ( col2 + + 16 * + col0 ) <= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9223
SELECT DISTINCT - col0 + 40 / + col0 AS col0 FROM tab1 WHERE NULL <= ( + COALESCE ( col2, col2 ) ) GROUP BY col0 HAVING + 96 NOT IN ( - 23 * - CAST( col0 * 18 AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-9223
SELECT DISTINCT - col0 + 40 / + col0 AS col0 FROM tab1 WHERE NULL <= ( + COALESCE ( col2, col2 ) ) GROUP BY col0 HAVING + 96 NOT IN ( - 23 * - CAST ( col0 * 18 AS INTEGER ) )
----

query I rowsort
SELECT + 23 - + col1 FROM tab1 GROUP BY col1, col0
----
-21
-34
17

query I rowsort
SELECT 90 AS col2 FROM tab1 GROUP BY col1, col0
----
90
90
90

query I rowsort
SELECT col0 * col0 FROM tab1 GROUP BY col2, col0
----
484
6724
784

query I rowsort
SELECT DISTINCT ( + 40 ) AS col1 FROM tab2 GROUP BY col2
----
40

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + ( + col1 ) * + col1 col2 FROM tab1 WHERE NOT col2 - - ( + col2 ) * + col0 IS NULL GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT col1 AS col0 FROM tab2 WHERE col0 NOT IN ( + 56 + - 68 ) GROUP BY col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9230
SELECT DISTINCT col0 / col1 FROM tab0 WHERE NULL IN ( + CAST( NULL AS SIGNED ) ) GROUP BY col0, col1, col0
----

skipif mysql # not compatible
query I rowsort label-9230
SELECT DISTINCT col0 / col1 FROM tab0 WHERE NULL IN ( + CAST ( NULL AS INTEGER ) ) GROUP BY col0, col1, col0
----

query I rowsort
SELECT - col1 + col1 * - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-2419
-4720
-5368

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0, col2 HAVING - 44 * col2 = 95
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 19 * - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
1121
1159
779

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9234
SELECT + CAST( - 19 AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1, col1
----
-19
-19

skipif mysql # not compatible
query I rowsort label-9234
SELECT + CAST ( - 19 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1, col1
----
-19
-19

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1, col0 HAVING + 28 NOT IN ( + col0 * col1 )
----
44
57
6

query I rowsort
SELECT DISTINCT 54 FROM tab0 GROUP BY col1, col1, col1
----
54

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 WHERE NULL IN ( - col2 + - col1 ) GROUP BY col1, col1
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 WHERE ( + col0 * 20 ) IS NOT NULL GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT - ( - - 83 ) FROM tab0 AS cor0 GROUP BY col2
----
-83
-83
-83

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT ( - col1 + - ( + 17 ) ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( - + 18, + - 49, + - col2 + - col2 * 99 ) * 70 FROM tab1 GROUP BY col0 HAVING + 33 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + 72 ) + - col1 col2 FROM tab0 GROUP BY col1
----
-9
72

query I rowsort
SELECT 37 / col1 AS col0 FROM tab1 WHERE NOT ( col2 ) IS NOT NULL GROUP BY col0, col1 HAVING NOT ( NULL ) < COALESCE ( - col0, col0, col1 )
----

query I rowsort
SELECT DISTINCT 72 * + 19 FROM tab2 GROUP BY col0 HAVING ( + 3 + + 13 ) >= + 64
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT + 81 FROM tab0 GROUP BY col0
----
81
81
81

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - COALESCE ( - ( + 3 ), col0 ) - col1 * NULLIF ( col1, col1 - 24 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL 37 AS col1 FROM tab0 GROUP BY col1, col2
----
37
37
37

query I rowsort
SELECT + 74 - + + ( + - col2 ) FROM tab1 cor0 GROUP BY col2, col0
----
119
145
82

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col1 * + - 63 + + col1 AS col2 FROM tab2 GROUP BY col1
----
-2542
-3658
-3782

onlyif mysql # DIV for integer division: 
query I rowsort label-9252
SELECT DISTINCT col1 DIV col1 AS col2 FROM tab2 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-9252
SELECT DISTINCT col1 / col1 AS col2 FROM tab2 GROUP BY col1
----
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9253
SELECT ALL - - CAST( NULL AS SIGNED ) + - - 33 * - + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9253
SELECT ALL - - CAST ( NULL AS INTEGER ) + - - 33 * - + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9254
SELECT + + 23 / - col2 * - - col2 * + CAST( + 66 AS SIGNED ) * - 73 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9254
SELECT + + 23 / - col2 * - - col2 * + CAST ( + 66 AS INTEGER ) * - 73 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL + - 52 FROM tab0 WHERE ( NOT ( NULL ) IS NULL ) GROUP BY col1, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9257
SELECT DISTINCT col1 DIV + 70 AS col1 FROM tab2 GROUP BY col2, col0, col1
----
0

skipif mysql # not compatible
query I rowsort label-9257
SELECT DISTINCT col1 / + 70 AS col1 FROM tab2 GROUP BY col2, col0, col1
----
0

query I rowsort
SELECT ALL - col0 * - + col2 + + 4 * - + col2 + + - 64 AS col2 FROM tab0 GROUP BY col2, col0
----
1674
2938
872

query II rowsort
SELECT - + 68 * + col0 AS col2, - col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-1020
225
-6188
8281
-6256
8464

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING + 49 IS NOT NULL
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9261
SELECT + 12 FROM tab1 GROUP BY col0, col2 HAVING NULL IN ( + col0 + ( CAST( NULL AS SIGNED ) ) )
----

skipif mysql # not compatible
query I rowsort label-9261
SELECT + 12 FROM tab1 GROUP BY col0, col2 HAVING NULL IN ( + col0 + ( CAST ( NULL AS INTEGER ) ) )
----

query I rowsort
SELECT - 42 * + 33 FROM tab2 GROUP BY col2
----
-1386
-1386
-1386

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= 22 + 12
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9264
SELECT CAST( NULL AS SIGNED ) / - + col1 * col1 * + + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9264
SELECT CAST ( NULL AS INTEGER ) / - + col1 * col1 * + + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
NULL
NULL
NULL

query I rowsort
SELECT + 12 AS col0 FROM tab2 GROUP BY col1, col0
----
12
12
12

query I rowsort
SELECT + 66 FROM tab1 GROUP BY col0, col1
----
66
66
66

query I rowsort
SELECT 55 FROM tab0 GROUP BY col2, col1
----
55
55
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9268
SELECT - + col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + CAST( NULL AS SIGNED ) IS NOT NULL
----
-114
-12
-88

skipif mysql # not compatible
query I rowsort label-9268
SELECT - + col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + CAST ( NULL AS INTEGER ) IS NOT NULL
----
-114
-12
-88

query I rowsort
SELECT + 88 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL ( col0 ) * - + col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9271
SELECT - - CAST( col2 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-9271
SELECT - - CAST ( col2 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
45
71
8

query I rowsort
SELECT 12 * ( + + 17 ) FROM tab2 GROUP BY col0, col0
----
204
204
204

query I rowsort
SELECT ALL + 23 + + 81 + - + 88 FROM tab2 GROUP BY col1, col2
----
16
16
16

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col1 FROM tab2 AS cor0 WHERE ( - col2 IS NULL ) GROUP BY col2, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9275
SELECT DISTINCT - - col1 + - 1 DIV col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-9275
SELECT DISTINCT - - col1 + - 1 / col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col1 * 51 AS col0 FROM tab0 GROUP BY col0, col1 HAVING - 43 / - col0 * + 91 + - 88 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + 6 + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST( NULL AS SIGNED ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST ( NULL AS INTEGER ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT + 2 * + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 cor0 WHERE NOT 48 IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL + + ( - col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col0 + + col0 * + - 3 * 44 col1 FROM tab1 GROUP BY col0
----
-2420
-2912
-4100

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT - + col1 * - col1 + - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
1640
3422
3660

query I rowsort
SELECT ALL col0 - col0 FROM tab2 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + 5 FROM tab2 cor0 GROUP BY col2
----
5

query I rowsort
SELECT DISTINCT - + 30 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-30

query II rowsort
SELECT + ( - col2 ) + - 55 AS col0, 88 FROM tab0 AS cor0 GROUP BY col2
----
-134
88
-79
88
-93
88

query I rowsort
SELECT ALL col0 + + + 87 FROM tab0 GROUP BY col0
----
113
130
170

onlyif mysql # DIV for integer division: 
query II rowsort label-9291
SELECT ALL col2 * - col1 * - + col1, + col1 * ( - col2 ) DIV col2 AS col2 FROM tab2 GROUP BY col1, col2, col1 HAVING NOT NULL IS NOT NULL
----
274999
-59
323727
-61
97498
-41

skipif mysql # not compatible
query II rowsort label-9291
SELECT ALL col2 * - col1 * - + col1, + col1 * ( - col2 ) / col2 AS col2 FROM tab2 GROUP BY col1, col2, col1 HAVING NOT NULL IS NOT NULL
----
274999
-59
323727
-61
97498
-41

query I rowsort
SELECT DISTINCT - - col0 * - col0 + - col0 * 98 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - 61 IS NOT NULL
----

query I rowsort
SELECT - col1 * - 15 + + 4 - 57 * ( + col1 ) FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + col0 * + - col0, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-225
15
-8281
91
-8464
92

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col2, col1, col0
----
24
38
79

query I rowsort
SELECT ALL + + 87 - 12 FROM tab0 AS cor0 GROUP BY col1
----
75
75

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 9 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT 13 * - col0 <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col0, + col0 * + 49 - col0 + + ( col0 ) * - col0 + - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
480
-91
-4004
-92
-4140

query II rowsort
SELECT DISTINCT + 42, - col0 / + ( - col0 ) + - 77 AS col1 FROM tab2 GROUP BY col0, col2 HAVING + 50 - - col0 < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 7 col0 FROM tab1 cor0 GROUP BY col2
----
7
7
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 17 + col2 col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL < NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9303
SELECT ALL + 62 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT IN ( - 80 * 92 + CAST( 44 AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-9303
SELECT ALL + 62 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT IN ( - 80 * 92 + CAST ( 44 AS INTEGER ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9304
SELECT CAST( + + col1 AS SIGNED ) AS col1, col1 + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + col2 NOT BETWEEN NULL AND - col2
----

skipif mysql # not compatible
query II rowsort label-9304
SELECT CAST ( + + col1 AS INTEGER ) AS col1, col1 + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + col2 NOT BETWEEN NULL AND - col2
----

query I rowsort
SELECT DISTINCT - 98 FROM tab1 WHERE NOT - col1 IS NULL GROUP BY col2, col0
----
-98

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9306
SELECT DISTINCT + col2 + - col2 DIV CAST( - + ( - col2 ) AS SIGNED ) FROM tab1 GROUP BY col2
----
44
7
70

skipif mysql # not compatible
query I rowsort label-9306
SELECT DISTINCT + col2 + - col2 / CAST ( - + ( - col2 ) AS INTEGER ) FROM tab1 GROUP BY col2
----
44
7
70

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) <> 25
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT 38 FROM tab1 GROUP BY col0, col1, col1
----
38

query I rowsort
SELECT DISTINCT + + col0 - col0 + - + 53 FROM tab2 AS cor0 GROUP BY col0
----
-53

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9311
SELECT ALL 79 - CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col1, col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9311
SELECT ALL 79 - CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col1, col1
----
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-9312
SELECT DISTINCT col0 DIV + 52 AS col2 FROM tab0 GROUP BY col0
----
0
1

skipif mysql # not compatible
query I rowsort label-9312
SELECT DISTINCT col0 / + 52 AS col2 FROM tab0 GROUP BY col0
----
0
1

query I rowsort
SELECT + col2 + + - 3 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 46 AS col0 FROM tab0 GROUP BY col2, col0, col2
----
46

query I rowsort
SELECT 17 AS col1 FROM tab0 GROUP BY col0, col2
----
17
17
17

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 + - - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT - col1 + - col1 + 32 * col1 FROM tab2 cor0 GROUP BY col1
----
1230
1770
1830

query I rowsort
SELECT DISTINCT - 26 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-26

query I rowsort
SELECT DISTINCT - 32 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT col1 - - 32 + + - col2 * + ( - + col2 ) IS NOT NULL
----

query I rowsort
SELECT 96 - + 0 FROM tab2 GROUP BY col1 HAVING NOT - col1 = NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + 3 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 - col0 * - ( + col0 * - col0 + - col0 ) col2 FROM tab2 AS cor0 GROUP BY col0
----
-3585
-761761
-787060

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT col1 AS col0 FROM tab0 cor0 WHERE NOT ( col2 ) <> ( NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT - + col2 - + col1 + - col2 * col2 FROM tab1 cor0 GROUP BY col2, col1
----
-2127
-5156
-78

query I rowsort
SELECT ALL - 22 + + col0 FROM tab2 AS cor0 WHERE + col0 * col0 IS NOT NULL GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 * + - COALESCE ( + 48, + COALESCE ( 27, col2 ) ) + - 76 * ( - col1 + + col1 * col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-141680
-1992
-239856

query I rowsort
SELECT ALL 90 FROM tab1 AS cor0 GROUP BY col2
----
90
90
90

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0 HAVING ( - col0 ) IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT ( - ( - col0 ) ) AS col2 FROM tab0 AS cor0 WHERE + 96 IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - 10 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9333
SELECT - 11 AS col2 FROM tab2 AS cor0 WHERE NOT ( - NULLIF ( + col0, - CAST( NULL AS SIGNED ) ) + - col2 ) < - col1 - 47 GROUP BY col2, col2
----
-11

skipif mysql # not compatible
query I rowsort label-9333
SELECT - 11 AS col2 FROM tab2 AS cor0 WHERE NOT ( - NULLIF ( + col0, - CAST ( NULL AS INTEGER ) ) + - col2 ) < - col1 - 47 GROUP BY col2, col2
----
-11

query I rowsort
SELECT ALL 94 + - 8 AS col2 FROM tab1 GROUP BY col0
----
86
86
86

query I rowsort
SELECT ( - col0 ) FROM tab1 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( col0 ) GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT 72 AS col0 FROM tab0 GROUP BY col0, col0
----
72

query I rowsort
SELECT DISTINCT 82 AS col0 FROM tab1 GROUP BY col0, col1
----
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col0, col1, col0
----
41
59
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 4, + + col0 * 32 ) FROM tab2 AS cor0 GROUP BY col2
----
-4
-4
-4

query I rowsort
SELECT DISTINCT - 5 - + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-11
-49
-62

query I rowsort
SELECT ALL - col2 * - + 43 * + - col2 * col2 AS col0 FROM tab2 GROUP BY col2
----
-21200677
-28315629
-8389816

query I rowsort
SELECT DISTINCT col2 * + 35 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
1575
2485
280

query I rowsort
SELECT + col2 * col0 + 99 FROM tab2 AS cor0 WHERE col1 * 93 + + col1 + col0 * col2 < + col1 GROUP BY col2, col0, col2
----

query I rowsort
SELECT ( 76 ) * + 23 AS col2 FROM tab0 AS cor0 WHERE ( + 71 ) <= - col2 + + 31 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 12 + col0 * - col2 col1 FROM tab2 AS cor0 WHERE ( ( NOT NULL >= col0 * col1 ) ) GROUP BY col2, col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9346
SELECT CAST( NULL AS SIGNED ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST( + ( + 90 ) AS SIGNED ) >= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-9346
SELECT CAST ( NULL AS INTEGER ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST ( + ( + 90 ) AS INTEGER ) >= ( NULL )
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
----

query II rowsort
SELECT DISTINCT - col0 AS col0, col2 FROM tab1 GROUP BY col2, col0
----
-22
8
-28
45
-82
71

query I rowsort
SELECT - + col1 + + col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col2 HAVING + - 2 NOT BETWEEN NULL AND - 83 * - 99
----

query I rowsort
SELECT - 45 FROM tab0 AS cor0 GROUP BY col0, col2
----
-45
-45
-45

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9351
SELECT ALL 94 AS col0 FROM tab0 AS cor0 WHERE NOT + 47 * + 16 / - col2 / CAST( NULL AS SIGNED ) IS NOT NULL AND NOT 20 >= - col0 GROUP BY col1, col1 HAVING NULL > + col1 + - col1
----

skipif mysql # not compatible
query I rowsort label-9351
SELECT ALL 94 AS col0 FROM tab0 AS cor0 WHERE NOT + 47 * + 16 / - col2 / CAST ( NULL AS INTEGER ) IS NOT NULL AND NOT 20 >= - col0 GROUP BY col1, col1 HAVING NULL > + col1 + - col1
----

query I rowsort
SELECT ( 31 ) FROM tab2 GROUP BY col0
----
31
31
31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9353
SELECT 67 + col1 - - + CAST( + + 82 AS SIGNED ) FROM tab2 GROUP BY col1
----
190
208
210

skipif mysql # not compatible
query I rowsort label-9353
SELECT 67 + col1 - - + CAST ( + + 82 AS INTEGER ) FROM tab2 GROUP BY col1
----
190
208
210

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9354
SELECT ALL + + col2 + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9354
SELECT ALL + + col2 + CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9356
SELECT col0 - - + 61 DIV - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9356
SELECT col0 - - + 61 / - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE col2 * - col2 > col1 + + col0 GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 + col1 AS col1 FROM tab0 AS cor0 WHERE COALESCE ( col2, + col1, + + col0 ) BETWEEN NULL AND NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - 13 FROM tab1 GROUP BY col1
----
-13

query I rowsort
SELECT col1 * 41 + - ( 80 ) * col1 * + - 19 FROM tab2 GROUP BY col1
----
64001
92099
95221

query II rowsort
SELECT DISTINCT + col1 AS col2, col1 AS col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL col1 / col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL + 83 AS col2 FROM tab0 GROUP BY col1
----
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + 14 - col0 col2 FROM tab2 WHERE NULL >= ( + col2 + - col2 ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 78 col1 FROM tab1 GROUP BY col2, col0
----
-78
-78
-78

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 GROUP BY col1 HAVING NOT col1 * 86 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - NULLIF ( - col1, - 89 ) AS col2 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT 52 + 38 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL > 60
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( - col0 ) col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - 85 IS NOT NULL
----
44
57
6

query I rowsort
SELECT + 35 FROM tab1 GROUP BY col0
----
35
35
35

query I rowsort
SELECT - + 4 AS col1 FROM tab2 cor0 GROUP BY col0
----
-4
-4
-4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9373
SELECT CAST( col0 AS SIGNED ) FROM tab2 GROUP BY col0, col0, col2 HAVING NOT + CAST( NULL AS SIGNED ) IS NOT NULL
----
15
91
92

skipif mysql # not compatible
query I rowsort label-9373
SELECT CAST ( col0 AS INTEGER ) FROM tab2 GROUP BY col0, col0, col2 HAVING NOT + CAST ( NULL AS INTEGER ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col2 + + col0 FROM tab0 GROUP BY col0, col2
----
-53
19
45

query II rowsort
SELECT ALL - col2 - - col2, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0
58
0
79
0
87

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 >= NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT - + col1 IS NULL
----
-81
0

query III rowsort
SELECT + 51 * + col1 AS col0, col1, col1 FROM tab1 GROUP BY col1, col1, col1
----
9 values hashing to c89d017b3f0162bec10216c7a5261286

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9379
SELECT ALL + CAST( NULL AS SIGNED ) + col0 * + 37 - NULLIF ( - - col2, col0 ) AS col0 FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9379
SELECT ALL + CAST ( NULL AS INTEGER ) + col0 * + 37 - NULLIF ( - - col2, col0 ) AS col0 FROM tab0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + 62 * + - 92 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-5704

query I rowsort
SELECT ALL + col2 * - col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2070
-5112
-72

query I rowsort
SELECT ALL + col0 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL col0 * col0 * - 88 + + + 34 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
-162678
-59454
-606198

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query II rowsort
SELECT - + 80 AS col2, col0 FROM tab0 AS cor0 WHERE NOT - ( col1 ) IS NULL GROUP BY col0
----
-80
26
-80
43
-80
83

query I rowsort
SELECT ( + 21 ) * col2 AS col1 FROM tab2 GROUP BY col2
----
1218
1659
1827

query I rowsort
SELECT DISTINCT 65 * - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
2860
3705
390

query II rowsort
SELECT DISTINCT col0 / col0, col0 FROM tab2 AS cor0 WHERE NOT 9 * col2 NOT IN ( - col2, + NULLIF ( - - col2, col2 ), - col1 * col2 ) GROUP BY col0
----

query I rowsort
SELECT ALL col1 * 81 + - ( 75 ) AS col0 FROM tab1 GROUP BY col1
----
3489
411
4542

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9390
SELECT ALL + CAST( NULL AS SIGNED ) + 96 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9390
SELECT ALL + CAST ( NULL AS INTEGER ) + 96 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT col0 * 21 * + col0 * + 54 * + ( 33 ) * + - col0 AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT + 34 AS col1, col2 FROM tab2 GROUP BY col2
----
34
58
34
79
34
87

query II rowsort
SELECT DISTINCT 58, col2 AS col1 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
24
58
38
58
79

query I rowsort
SELECT 19 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
19
19
19

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9395
SELECT - col2 * - + ( col2 ) * + col2 + - 45 + - CAST( NULL AS SIGNED ) * + + col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif mysql # not compatible
query I rowsort label-9395
SELECT - col2 * - + ( col2 ) * + col2 + - 45 + - CAST ( NULL AS INTEGER ) * + + col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - - 88 / - col1 / + - ( + - col1 ) - col1 + + 75 + 3 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT ALL + 3 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN ( NULL ) AND + col2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-9400
SELECT ALL + col2 DIV 7 AS col0, - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
1
-8
10
-71
6
-45

skipif mysql # not compatible
query II rowsort label-9400
SELECT ALL + col2 / 7 AS col0, - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
1
-8
10
-71
6
-45

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9401
SELECT DISTINCT 97 AS col0, col0 + + + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
query II rowsort label-9401
SELECT DISTINCT 97 AS col0, col0 + + + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + COALESCE ( - 94, 31 ) col2 FROM tab0 AS cor0 GROUP BY col1
----
-94
-94

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING + 12 IS NULL
----

query I rowsort
SELECT DISTINCT + 37 FROM tab1 AS cor0 GROUP BY col2
----
37

query I rowsort
SELECT col0 * col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9407
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT CAST( NULL AS SIGNED ) - + 7 IS NOT NULL
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-9407
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT CAST ( NULL AS INTEGER ) - + 7 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL 7 + 10 + + ( - col0 ) FROM tab2 AS cor0 GROUP BY col0
----
-74
-75
2

query I rowsort
SELECT DISTINCT - 4 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-4

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9410
SELECT + CAST( - - col1 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT + NULLIF ( 38, + 52 ) <= + - 73
----
41
59
61

skipif mysql # not compatible
query I rowsort label-9410
SELECT + CAST ( - - col1 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT + NULLIF ( 38, + 52 ) <= + - 73
----
41
59
61

query I rowsort
SELECT DISTINCT - 0 * + 67 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT - 82 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
-3690
-5822
-656

onlyif mysql # DIV for integer division: 
query II rowsort label-9413
SELECT DISTINCT - col1 * + col1 * col1 DIV - - col1 + + - col1 + + col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
44
-3249
57
-36
6

skipif mysql # not compatible
query II rowsort label-9413
SELECT DISTINCT - col1 * + col1 * col1 / - - col1 + + - col1 + + col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
44
-3249
57
-36
6

query I rowsort
SELECT col2 * + - col0 AS col0 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query II rowsort
SELECT ALL + ( col1 ), - 84 * + 48 AS col2 FROM tab0 WHERE NOT NULL < NULL GROUP BY col1
----

query I rowsort
SELECT + 84 FROM tab1 GROUP BY col0
----
84
84
84

query I rowsort
SELECT - - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0, col1
----
0
0
81

query I rowsort
SELECT + 52 + 47 * + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
1180
1838
3765

query I rowsort
SELECT 95 * + 59 FROM tab2 AS cor0 GROUP BY col2, col0
----
5605
5605
5605

query II rowsort
SELECT + + 69, col2 AS col1 FROM tab2 AS cor0 WHERE 10 + - 81 - - + col0 + 40 * - col1 < + 42 GROUP BY col2 HAVING NULL >= ( - 87 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT 91 AS col1 FROM tab1 GROUP BY col1, col1
----
91

query I rowsort
SELECT ALL + 53 * col0 AS col0 FROM tab0 GROUP BY col0
----
1378
2279
4399

query I rowsort
SELECT + - NULLIF ( 85, - ( 98 ) ) * - 63 FROM tab0 AS cor0 GROUP BY col1
----
5355
5355

query II rowsort
SELECT - col0 AS col2, 7 + - + col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) = - col0
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NOT + 22 BETWEEN col2 AND ( NULL ) GROUP BY col0, col1
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 79 col1 FROM tab2 GROUP BY col0, col1, col0
----
79

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE - 66 IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT ALL + - 29 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-29
-29
-29

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 48 * - col2, col0 * + - 41 col2 FROM tab2 GROUP BY col2, col0 HAVING NOT ( ( col0 ) IS NULL )
----
-2784
-3772
-3792
-3731
-4176
-615

query II rowsort
SELECT + col1 + col1 * + col1 AS col0, col1 AS col2 FROM tab1 GROUP BY col1
----
1980
44
3306
57
42
6

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9435
SELECT ALL - CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9435
SELECT ALL - CAST ( NULL AS REAL ) FROM tab2 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + + 70 FROM tab0 cor0 GROUP BY col2
----
70
70
70

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9438
SELECT + CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9438
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0, col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col2 - - 10 AS col0 FROM tab2 GROUP BY col2
----
68
89
97

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 27 col0 FROM tab1 GROUP BY col1, col2, col1
----
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9441
SELECT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9441
SELECT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + col0 * + - 71 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1846
-3053
-5893

query I rowsort
SELECT DISTINCT - 70 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-70

query I rowsort
SELECT - col2 + + 86 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + - 96 IS NULL
----
-1
28
7

query I rowsort
SELECT ALL - - col2 FROM tab1 AS cor0 WHERE NOT + 62 * + 73 + 65 * - 9 IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col2, - col2 AS col2 FROM tab2 GROUP BY col2 HAVING ( 83 ) NOT IN ( - 75 )
----
58
-58
79
-79
87
-87

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9447
SELECT + AVG ( ALL + col2 ) * col0 FROM tab1 WHERE NOT + - col1 NOT BETWEEN CAST( - + col1 AS SIGNED ) AND + + col1 + - col0 GROUP BY col2, col0 HAVING ( NULL ) BETWEEN col0 * - 39 AND NULL
----

skipif mysql # not compatible
query I rowsort label-9447
SELECT + AVG ( ALL + col2 ) * col0 FROM tab1 WHERE NOT + - col1 NOT BETWEEN CAST ( - + col1 AS INTEGER ) AND + + col1 + - col0 GROUP BY col2, col0 HAVING ( NULL ) BETWEEN col0 * - 39 AND NULL
----

query I rowsort
SELECT col0 * 59 + - - col0 FROM tab2 AS cor0 GROUP BY col0
----
5460
5520
900

query I rowsort
SELECT ALL - - col1 + + col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT DISTINCT 31 * + col0 AS col0 FROM tab2 GROUP BY col0, col0
----
2821
2852
465

query I rowsort
SELECT ALL - col1 - - - col1 / + col1 * - col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NOT - 12 IS NULL ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col0 + - col0 AS col2 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT - col1 + + - col1 + + + col1 * + 57 FROM tab2 AS cor0 WHERE ( NULL ) IN ( + col2 ) GROUP BY col1
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9455
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL BETWEEN - + col2 AND ( + + CAST( NULL AS SIGNED ) )
----

skipif mysql # not compatible
query I rowsort label-9455
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL BETWEEN - + col2 AND ( + + CAST ( NULL AS INTEGER ) )
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 WHERE NOT NULL <> ( 78 + CASE WHEN NOT ( NULL ) IS NULL THEN + col0 ELSE NULL END ) GROUP BY col1, col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9457
SELECT CAST( col2 AS SIGNED ) AS col1 FROM tab0 GROUP BY col2, col1 HAVING ( NULL ) IN ( - 28 )
----

skipif mysql # not compatible
query I rowsort label-9457
SELECT CAST ( col2 AS INTEGER ) AS col1 FROM tab0 GROUP BY col2, col1 HAVING ( NULL ) IN ( - 28 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + + col0 col2 FROM tab0 WHERE NOT NULL <= NULL GROUP BY col2, col0 HAVING NOT ( NULL IS NULL )
----

query II rowsort
SELECT DISTINCT 45, col2 FROM tab0 GROUP BY col2, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT + 71 * + + col1 + - + col1 AS col2 FROM tab1 GROUP BY col1
----
3080
3990
420

query I rowsort
SELECT DISTINCT 12 FROM tab1 GROUP BY col0
----
12

query I rowsort
SELECT - 48 AS col1 FROM tab2 GROUP BY col0, col0
----
-48
-48
-48

query I rowsort
SELECT - 45 AS col2 FROM tab0 GROUP BY col0, col0
----
-45
-45
-45

query I rowsort
SELECT 97 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
97
97
97

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 65 + - + 61 col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-126

onlyif mysql # DIV for integer division: 
query I rowsort label-9466
SELECT ALL - 90 DIV - 46 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9466
SELECT ALL - 90 / - 46 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
1
1
1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9467
SELECT - 60 FROM tab1 GROUP BY col0, col0, col2 HAVING - 2 - - CAST( col0 AS SIGNED ) + - 18 * 54 * + col0 IS NOT NULL
----
-60
-60
-60

skipif mysql # not compatible
query I rowsort label-9467
SELECT - 60 FROM tab1 GROUP BY col0, col0, col2 HAVING - 2 - - CAST ( col0 AS INTEGER ) + - 18 * 54 * + col0 IS NOT NULL
----
-60
-60
-60

query I rowsort
SELECT + ( + 63 ) FROM tab1 cor0 GROUP BY col0
----
63
63
63

query I rowsort
SELECT - - 14 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
14
14
14

query I rowsort
SELECT + 72 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - 36 + - col0 + - ( + col0 ) FROM tab1 WHERE + 79 + - col0 < NULL GROUP BY col0
----

query I rowsort
SELECT 23 * + col2 * col1 AS col2 FROM tab2 GROUP BY col1, col2
----
107203
122061
54694

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + 47 IS NULL
----
-15
-91
-92

query I rowsort
SELECT - 89 + - 2 FROM tab1 GROUP BY col1, col1, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9475
SELECT col1 DIV 29 AS col2 FROM tab0 GROUP BY col1, col1
----
0
2

skipif mysql # not compatible
query I rowsort label-9475
SELECT col1 / 29 AS col2 FROM tab0 GROUP BY col1, col1
----
0
2

query I rowsort
SELECT + ( col1 ) + + 28 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
34
72
85

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT + col0 IS NULL GROUP BY col0, col0 HAVING + 46 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + 87 AS col0 FROM tab0 cor0 GROUP BY col2, col0
----
87

query I rowsort
SELECT DISTINCT - col1 * - col1 * - ( + - col1 ) FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * + + 29 * col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT - col0 / + 42 IS NOT NULL
----

query I rowsort
SELECT ALL 83 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - col0 <> - 32
----
83
83
83

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - 82 + 12 * - - col0 FROM tab2 cor0 WHERE NOT + col0 + col0 IS NULL GROUP BY col0
----
1010
1022
98

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT + 25 IS NULL
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-9486
SELECT ALL CAST( + + col1 AS SIGNED ) * + 87 AS col1, - col1 DIV + CAST( + 94 AS SIGNED ) FROM tab1 GROUP BY col1, col2
----
3828
0
4959
0
522
0

skipif mysql # not compatible
query II rowsort label-9486
SELECT ALL CAST ( + + col1 AS INTEGER ) * + 87 AS col1, - col1 / + CAST ( + 94 AS INTEGER ) FROM tab1 GROUP BY col1, col2
----
3828
0
4959
0
522
0

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN + 2 + + + col2 * - - ( + + col2 ) AND 7
----

query I rowsort
SELECT - col2 * + col2 FROM tab2 WHERE NOT NULL BETWEEN NULL AND + col0 + 98 GROUP BY col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9489
SELECT DISTINCT + - col1 + - 98 + + col1 * - col1 AS col2, CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-6740
NULL
-98
NULL

skipif mysql # not compatible
query II rowsort label-9489
SELECT DISTINCT + - col1 + - 98 + + col1 * - col1 AS col2, CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-6740
NULL
-98
NULL

query I rowsort
SELECT + ( col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-9491
SELECT ALL col1 AS col1, col1 DIV 91 AS col0 FROM tab1 GROUP BY col2, col1
----
44
0
57
0
6
0

skipif mysql # not compatible
query II rowsort label-9491
SELECT ALL col1 AS col1, col1 / 91 AS col0 FROM tab1 GROUP BY col2, col1
----
44
0
57
0
6
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9493
SELECT DISTINCT - 44 DIV - 10 + + + CAST( - col1 AS SIGNED ) col0 FROM tab0 GROUP BY col1
----
-77
4

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9493
SELECT DISTINCT - 44 / - 10 + + + CAST ( - col1 AS INTEGER ) col0 FROM tab0 GROUP BY col1
----
-77
4

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT 99 FROM tab1 GROUP BY col0
----
99
99
99

query I rowsort
SELECT - 49 AS col0 FROM tab2 AS cor0 WHERE NOT ( NOT ( ( + col1 * col1 IS NOT NULL ) ) ) GROUP BY col1
----
-49
-49
-49

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + 80 / 14 * - + col2 col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + + - col0 * + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
462
6642
756

query I rowsort
SELECT ( - + col1 ) FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1 HAVING col1 IS NOT NULL
----
-81
0

query I rowsort
SELECT DISTINCT 38 AS col2 FROM tab2 GROUP BY col1, col2
----
38

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT + - 66 * + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1690
-2795
-5395

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - ( + ( + col0 ) ) FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NOT NULL <> NULL )
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9507
SELECT DISTINCT 93 DIV - col2 AS col1 FROM tab0 GROUP BY col2
----
-1
-2
-3

skipif mysql # not compatible
query I rowsort label-9507
SELECT DISTINCT 93 / - col2 AS col1 FROM tab0 GROUP BY col2
----
-1
-2
-3

query I rowsort
SELECT + ( - - col2 ) AS col1 FROM tab2 WHERE NOT NULL >= + col0 + + 71 GROUP BY col2
----

query I rowsort
SELECT + + col0 + + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT 39 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col1 + + col1 AS col0, - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * + - 20 + - - col1 FROM tab1 GROUP BY col0, col1, col1
----
1197
126
924

query I rowsort
SELECT ALL 27 AS col0 FROM tab0 GROUP BY col0, col2
----
27
27
27

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 WHERE NOT + 33 IS NULL GROUP BY col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9515
SELECT ALL CAST( ( 11 ) AS SIGNED ) * - - col0 FROM tab1 AS cor0 GROUP BY col0
----
242
308
902

skipif mysql # not compatible
query I rowsort label-9515
SELECT ALL CAST ( ( 11 ) AS INTEGER ) * - - col0 FROM tab1 AS cor0 GROUP BY col0
----
242
308
902

query II rowsort
SELECT - - col1 - + col1, col1 + + col1 + - col1 * - + 68 / AVG ( - col1 ) * col1 + - NULLIF ( col2, - - 79 + 53 ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IN ( col1 )
----

query I rowsort
SELECT - + ( 4 ) FROM tab1 AS cor0 GROUP BY col2
----
-4
-4
-4

query I rowsort
SELECT DISTINCT - 75 * - + 17 AS col0 FROM tab2 GROUP BY col1
----
1275

query I rowsort
SELECT - col2 * col2 * - NULLIF ( + col2, + - 72 ) FROM tab2 AS cor0 GROUP BY col2, col2
----
195112
493039
658503

query I rowsort
SELECT + 34 * - - col0 AS col2 FROM tab0 GROUP BY col0
----
1462
2822
884

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL + 12 AS col1 FROM tab0 GROUP BY col0
----
12
12
12

query I rowsort
SELECT - 6 FROM tab0 AS cor0 GROUP BY col1
----
-6
-6

query II rowsort
SELECT + ( + + 21 ) + + - CASE - + col2 WHEN - 96 + - 14 THEN + + 50 END * col2 AS col1, + col2 FROM tab0 GROUP BY col2
----
NULL
24
NULL
38
NULL
79

query I rowsort
SELECT DISTINCT - 24 * + + col2 + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( - 66 ) BETWEEN col2 AND + - col2
----

query I rowsort
SELECT ALL - col1 * - 23 * + + col1 * - - col1 - 36 FROM tab1 GROUP BY col1, col1 HAVING ( NOT ( NULL ) IS NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9528
SELECT DISTINCT - - 26 DIV + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
0
4

skipif mysql # not compatible
query I rowsort label-9528
SELECT DISTINCT - - 26 / + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
0
4

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT + col1 FROM tab2 AS cor0 WHERE ( - col0 / col1 ) >= - col1 GROUP BY col1 HAVING - 24 + + col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + col2 + col2 * - - 1 col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT 75 * - - 17 + 80 + - - 86 * - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-1913
-5439
-709

query I rowsort
SELECT + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query II rowsort
SELECT + 43 * - + 24, + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
-1032
41
-1032
59
-1032
61

query I rowsort
SELECT ALL col2 + + - ( + 82 ) AS col0 FROM tab2 cor0 WHERE + 91 NOT IN ( col1 + col0 ) GROUP BY col2, col1
----
-24
-3
5

query I rowsort
SELECT ALL - 23 AS col1 FROM tab2 GROUP BY col0
----
-23
-23
-23

onlyif mysql # DIV for integer division: 
query I rowsort label-9537
SELECT DISTINCT - col2 DIV col2 * + 64 FROM tab1 AS cor0 GROUP BY col2
----
-64

skipif mysql # not compatible
query I rowsort label-9537
SELECT DISTINCT - col2 / col2 * + 64 FROM tab1 AS cor0 GROUP BY col2
----
-64

query I rowsort
SELECT ALL 75 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
75
75
75

query I rowsort
SELECT ALL - 1 FROM tab2 AS cor0 WHERE NOT col0 + + - 31 * col0 <> ( NULL ) GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - ( + col0 ) col2 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - - col0 + - ( + col0 ) + + - CASE WHEN ( + col0 ) < ( NULL ) THEN - col2 END + 97 / col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - col0 * + col0 )
----

query I rowsort
SELECT col1 * + col1 AS col2 FROM tab1 GROUP BY col2, col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col0, 90 + 62 + 53 + - + col0 * - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query II rowsort
SELECT ALL + col0, 43 * 77 FROM tab1 GROUP BY col0 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL + col1 + + col1 + - - ( + col1 ) FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL NOT IN ( - 68 * - 90 * 87 ) )
----

query I rowsort
SELECT col2 + - - 5 + 64 FROM tab0 GROUP BY col2
----
107
148
93

query I rowsort
SELECT - 34 + - 62 FROM tab0 WHERE - + col1 IS NOT NULL GROUP BY col2, col1
----
-96
-96
-96

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING COALESCE ( COALESCE ( + 24, col0 ), - - NULLIF ( - col1, + col2 ) * 51 + CASE + col0 - - 79 * col1 WHEN + ( - col2 ) THEN NULL ELSE - 5 * col2 END ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9551
SELECT + 0 / col2 + + + ( CAST( NULL AS SIGNED ) ) * + col2 + - col2 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9551
SELECT + 0 / col2 + + + ( CAST ( NULL AS INTEGER ) ) * + col2 + - col2 FROM tab2 cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9552
SELECT + + col1 * + 2 * + CAST( NULL AS SIGNED ) + - col2 col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9552
SELECT + + col1 * + 2 * + CAST ( NULL AS INTEGER ) + - col2 col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL + col2 * + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

onlyif mysql # DIV for integer division: 
query I rowsort label-9554
SELECT + col1 DIV - col2 - + 58 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-58
-58
-58

skipif mysql # not compatible
query I rowsort label-9554
SELECT + col1 / - col2 - + 58 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-58
-58
-58

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9555
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL

skipif mysql # not compatible
query I rowsort label-9555
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
NULL

query I rowsort
SELECT - col0 * + 80 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-1200
-7280
-7360

query II rowsort
SELECT 70 AS col1, 73 FROM tab0 GROUP BY col2
----
70
73
70
73
70
73

query I rowsort
SELECT + col1 + + col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6642

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + 5 col1 FROM tab1 AS cor0 GROUP BY col0
----
-5

query I rowsort
SELECT ALL col2 + - - col0 AS col1 FROM tab0 GROUP BY col2, col0
----
105
121
67

query I rowsort
SELECT col2 AS col1 FROM tab2 WHERE col0 * - col0 + - 5 IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL 35 - col2 FROM tab2 WHERE NOT ( + 15 + + col1 * - col1 ) IS NULL GROUP BY col2, col1 HAVING ( 60 ) IS NOT NULL
----
-23
-44
-52

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab1 AS cor0 WHERE - 42 >= ( NULL ) GROUP BY col2, col2, col1
----

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 + - col0 col1 FROM tab2 AS cor0 WHERE NOT 19 - - col0 IS NULL GROUP BY col0
----
210
8190
8372

query II rowsort
SELECT ALL ( - + col2 ), + col2 FROM tab1 GROUP BY col2 HAVING NOT 87 <> NULL
----

query I rowsort
SELECT ALL 5 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
46
64
66

query I rowsort
SELECT 6 + col0 FROM tab1 AS cor0 GROUP BY col0
----
28
34
88

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9569
SELECT DISTINCT col1 col2 FROM tab1 WHERE NOT ( - - col2 * + + 95 ) <> 37 GROUP BY col1, col2, col0 HAVING 4 * + 0 <= - CAST( col1 AS DECIMAL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9569
SELECT DISTINCT col1 col2 FROM tab1 WHERE NOT ( - - col2 * + + 95 ) <> 37 GROUP BY col1, col2, col0 HAVING 4 * + 0 <= - CAST ( col1 AS REAL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9570
SELECT ALL 2 * - col0 FROM tab1 AS cor0 WHERE CASE - col2 WHEN + + 14 THEN 19 * + 24 END IS NOT NULL GROUP BY col2, col0 HAVING CAST( 62 AS SIGNED ) + 78 IN ( 34 )
----

skipif mysql # not compatible
query I rowsort label-9570
SELECT ALL 2 * - col0 FROM tab1 AS cor0 WHERE CASE - col2 WHEN + + 14 THEN 19 * + 24 END IS NOT NULL GROUP BY col2, col0 HAVING CAST ( 62 AS INTEGER ) + 78 IN ( 34 )
----

query I rowsort
SELECT + 0 - col1 * col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( col1 ) IS NULL
----
-1681
-3481
-3721

query I rowsort
SELECT col0 + + 63 * + col2 AS col0 FROM tab2 AS cor0 WHERE NOT - 25 NOT BETWEEN ( NULL ) AND NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + 33 FROM tab2 GROUP BY col2
----
33

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9574
SELECT ALL - ( + CAST( NULL AS DECIMAL ) ) col0 FROM tab2 GROUP BY col1 HAVING NOT NULL <= + col1 / ( col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9574
SELECT ALL - ( + CAST ( NULL AS REAL ) ) col0 FROM tab2 GROUP BY col1 HAVING NOT NULL <= + col1 / ( col1 )
----

query I rowsort
SELECT DISTINCT ( - col2 ) FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query II rowsort
SELECT DISTINCT + col0, col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT 4 * + - 68 FROM tab2 GROUP BY col2
----
-272
-272
-272

query I rowsort
SELECT DISTINCT + 99 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
99

query I rowsort
SELECT + 66 FROM tab1 AS cor0 GROUP BY col2
----
66
66
66

query I rowsort
SELECT + col1 * ( col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL - + 30 + - col2 - col2 FROM tab0 AS cor0 GROUP BY col2
----
-106
-188
-78

query I rowsort
SELECT ALL - 96 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-96
-96
-96

query I rowsort
SELECT + 29 FROM tab1 AS cor0 GROUP BY col1, col2, col2 HAVING NOT - - 33 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9585
SELECT DISTINCT + col2 DIV - - col2 FROM tab1 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-9585
SELECT DISTINCT + col2 / - - col2 FROM tab1 AS cor0 GROUP BY col2
----
1

query II rowsort
SELECT - + col2 * - 76, + col2 - + - ( - - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL = col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9587
SELECT - - 17 DIV + 47 - + - col1 AS col1 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-9587
SELECT - - 17 / + 47 - + - col1 AS col1 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT 80 FROM tab1 GROUP BY col0
----
80
80
80

query I rowsort
SELECT DISTINCT - col1 - - + 86 / - col1 * + 30 * - col0 + + col0 FROM tab0 GROUP BY col0, col1 HAVING ( NOT ( NULL ) >= + 42 )
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 WHERE NOT ( - col0 ) IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT + 76 + 46 * col0 AS col1 FROM tab2 GROUP BY col0, col0
----
4262
4308
766

query I rowsort
SELECT - col2 AS col0 FROM tab2 WHERE ( 5 ) NOT IN ( - col1 * - col1 ) GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col2 + 83 AS col1 FROM tab2 GROUP BY col2 HAVING ( NULL ) < ( NULL )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col0 HAVING NOT + col0 < - col0 * col2
----
-45
-71
-8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9596
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING ( CAST( NULL AS SIGNED ) * - 44 + + 59 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-9596
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING ( CAST ( NULL AS INTEGER ) * - 44 + + 59 ) IS NOT NULL
----

query I rowsort
SELECT + col2 * - col2 FROM tab0 WHERE NOT - col2 NOT BETWEEN NULL AND ( col2 ) GROUP BY col1, col0, col2 HAVING ( + 93 ) >= - col0
----

query I rowsort
SELECT 39 FROM tab0 WHERE ( - 33 ) IS NOT NULL GROUP BY col0 HAVING col0 * - col0 IS NOT NULL
----
39
39
39

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-9599
SELECT ALL + AVG ( DISTINCT CAST( col0 AS DECIMAL ) ) / + 87 + CAST( - 39 AS SIGNED ) FROM tab0 WHERE - 70 IS NULL GROUP BY col1 HAVING NULL NOT IN ( 21 )
----

skipif mysql # not compatible
query I rowsort label-9599
SELECT ALL + AVG ( DISTINCT CAST ( col0 AS REAL ) ) / + 87 + CAST ( - 39 AS INTEGER ) FROM tab0 WHERE - 70 IS NULL GROUP BY col1 HAVING NULL NOT IN ( 21 )
----

query I rowsort
SELECT ( + 99 ) AS col2 FROM tab1 GROUP BY col2, col0, col0
----
99
99
99

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING ( col0 - + col0 ) NOT BETWEEN NULL AND - 99
----
26
43
83

query I rowsort
SELECT 80 * - col1 FROM tab1 WHERE NOT NULL <= NULL GROUP BY col0, col1 HAVING NOT NULL <> ( + col0 )
----

query I rowsort
SELECT + 95 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
95
95
95

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9604
SELECT + col2 / - + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9604
SELECT + col2 / - + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 30 FROM tab2 GROUP BY col1
----
30
30
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 * - 50 col1 FROM tab1 AS cor0 GROUP BY col1
----
2200
2850
300

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NULL
----
22
28
82

query I rowsort
SELECT ALL - 64 FROM tab0 AS cor0 GROUP BY col1, col2
----
-64
-64
-64

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col0, col2
----
58
79
87

query I rowsort
SELECT ALL - 57 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-57
-57
-57

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 GROUP BY col0, col1, col1
----
-114
-12
-88

query I rowsort
SELECT 84 AS col1 FROM tab2 GROUP BY col1, col0
----
84
84
84

query I rowsort
SELECT + col2 + + 51 FROM tab2 WHERE - col1 IS NOT NULL GROUP BY col2
----
109
130
138

query I rowsort
SELECT + 19 - col1 FROM tab2 GROUP BY col2, col1 HAVING NULL = col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9616
SELECT col0 + + + col0 DIV + col0 AS col2 FROM tab1 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-9616
SELECT col0 + + + col0 / + col0 AS col2 FROM tab1 GROUP BY col0
----
23
29
83

query I rowsort
SELECT ALL + 81 * - col0 FROM tab0 cor0 GROUP BY col0, col0
----
-2106
-3483
-6723

query I rowsort
SELECT + + col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 * - + col2 - + - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2
----
-3306
-6162
-7482

query I rowsort
SELECT ALL - 19 FROM tab2 GROUP BY col1, col1, col2
----
-19
-19
-19

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9621
SELECT ALL COALESCE ( - col2, + CAST( - ( - CAST( - 11 AS SIGNED ) ) AS SIGNED ) ) + - col1 AS col1 FROM tab2 GROUP BY col2, col1
----
-138
-148
-99

skipif mysql # not compatible
query I rowsort label-9621
SELECT ALL COALESCE ( - col2, + CAST ( - ( - CAST ( - 11 AS INTEGER ) ) AS INTEGER ) ) + - col1 AS col1 FROM tab2 GROUP BY col2, col1
----
-138
-148
-99

query I rowsort
SELECT DISTINCT col2 + + 48 FROM tab2 GROUP BY col2
----
106
127
135

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9623
SELECT ALL ( - - col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL <= + - CAST( + col1 AS SIGNED )
----

skipif mysql # not compatible
query I rowsort label-9623
SELECT ALL ( - - col1 ) AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL <= + - CAST ( + col1 AS INTEGER )
----

query I rowsort
SELECT ALL - 18 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT - 63 IS NULL
----
-18
-18
-18

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9625
SELECT DISTINCT + CAST( NULL AS SIGNED ) + + 42 AS col2, - col0 FROM tab0 WHERE NOT - 44 IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND 54
----

skipif mysql # not compatible
query II rowsort label-9625
SELECT DISTINCT + CAST ( NULL AS INTEGER ) + + 42 AS col2, - col0 FROM tab0 WHERE NOT - 44 IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND 54
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9626
SELECT ALL + col1, CAST( col1 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2, col1
----
44
44
57
57
6
6

skipif mysql # not compatible
query II rowsort label-9626
SELECT ALL + col1, CAST ( col1 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2, col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT - col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
0

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-9628
SELECT col0, + CAST( - 66 AS DECIMAL ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
query II rowsort label-9628
SELECT col0, + CAST ( - 66 AS REAL ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * - - col1 * - - col1 FROM tab0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT + 23 FROM tab0 AS cor0 GROUP BY col0
----
23
23
23

query I rowsort
SELECT + 42 * - - col1 FROM tab2 GROUP BY col1, col0
----
1722
2478
2562

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9632
SELECT + col0 AS col0 FROM tab1 AS cor0 WHERE NOT + 25 <> CAST( NULL AS SIGNED ) GROUP BY col0, col2
----

skipif mysql # not compatible
query I rowsort label-9632
SELECT + col0 AS col0 FROM tab1 AS cor0 WHERE NOT + 25 <> CAST ( NULL AS INTEGER ) GROUP BY col0, col2
----

query I rowsort
SELECT - 97 - - + col0 + + 44 * 18 * + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NOT - col0 + - - ( + - col2 ) * - + col2 > col2 * - col0 - + col1 GROUP BY col1, col0
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 WHERE 31 > + - 70 GROUP BY col1
----
41
59
61

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9636
SELECT ALL + ( + CAST( 34 AS SIGNED ) ) / - col0 * + col0 + - col0 - + col0, col0 + - - col0 FROM tab2 AS cor0 WHERE NULL <= NULL GROUP BY col0, col0
----

skipif mysql # not compatible
query II rowsort label-9636
SELECT ALL + ( + CAST ( 34 AS INTEGER ) ) / - col0 * + col0 + - col0 - + col0, col0 + - - col0 FROM tab2 AS cor0 WHERE NULL <= NULL GROUP BY col0, col0
----

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-9637
SELECT DISTINCT col0 * + 8 * col0 / - CAST( NULL AS SIGNED ) * CAST( NULL AS DECIMAL ), + 41 * - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
-1066
NULL
-1763
NULL
-3403

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-9637
SELECT DISTINCT col0 * + 8 * col0 / - CAST ( NULL AS INTEGER ) * CAST ( NULL AS REAL ), + 41 * - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
NULL
-1066
NULL
-1763
NULL
-3403

query I rowsort
SELECT ALL - 82 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL < - 79
----

query I rowsort
SELECT DISTINCT COALESCE ( - 50, - 66 + 64 ) AS col0 FROM tab2 AS cor0 WHERE + 34 * - col1 * - col1 IS NOT NULL GROUP BY col0, col1
----
-50

query II rowsort
SELECT + col0, + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
26
26
43
43
83
83

onlyif mysql # DIV for integer division: 
query I rowsort label-9641
SELECT - + col1 DIV col1 * col1 DIV - + 97 FROM tab1 cor0 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9641
SELECT - + col1 / col1 * col1 / - + 97 FROM tab1 cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col2 + 64 AS col2 FROM tab2 GROUP BY col2
----
-15
-23
6

query I rowsort
SELECT + ( + col1 ) + + col1 FROM tab2 cor0 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT - ( + - 45 ) AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
45
45
45

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
-45
-71
-8

query I rowsort
SELECT - 3 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-3
-3
-3

query I rowsort
SELECT DISTINCT - 47 AS col0 FROM tab2 GROUP BY col0
----
-47

query I rowsort
SELECT ALL + col2 + + col2 * col2 AS col2 FROM tab0 WHERE - + col2 IS NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9649
SELECT - ( + - col0 ) DIV + col0 - + 42 FROM tab2 WHERE NOT 90 > + col0 GROUP BY col0
----
-41
-41

skipif mysql # not compatible
query I rowsort label-9649
SELECT - ( + - col0 ) / + col0 - + 42 FROM tab2 WHERE NOT 90 > + col0 GROUP BY col0
----
-41
-41

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE ( + 67 + col1 / + ( + - col1 ) ) > col0 GROUP BY col0
----
-15

query II rowsort
SELECT ALL 41, col2 AS col1 FROM tab1 GROUP BY col2
----
41
45
41
71
41
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + 59 FROM tab0 WHERE NOT - + ( + + col2 ) + col0 IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + 20 AS col2 FROM tab0 GROUP BY col1
----
20

query I rowsort
SELECT DISTINCT 84 * - 10 AS col0 FROM tab2 GROUP BY col2, col2, col0
----
-840

query I rowsort
SELECT + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + 46 FROM tab0 cor0 GROUP BY col1, col2, col0 HAVING - col2 + - - col0 NOT BETWEEN - + col0 AND NULL
----
46

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( ( NULL ) > - 11 * + - col0 + + ( + col0 ) )
----

query II rowsort
SELECT col0 * + + col0 AS col1, - col1 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
1849
-38
676
26
6889
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9660
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING CAST( NULL AS SIGNED ) NOT IN ( NULLIF ( 63, - col0 ) )
----

skipif mysql # not compatible
query I rowsort label-9660
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING CAST ( NULL AS INTEGER ) NOT IN ( NULLIF ( 63, - col0 ) )
----

query I rowsort
SELECT + ( col0 ) FROM tab0 GROUP BY col0, col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-9662
SELECT DISTINCT + - col0 DIV col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-9662
SELECT DISTINCT + - col0 / col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9663
SELECT 41 + 71 - + + 40 * CAST( NULL AS DECIMAL ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9663
SELECT 41 + 71 - + + 40 * CAST ( NULL AS REAL ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 2 col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT - 46 IS NULL
----
-2
15
-2
91
-2
92

query I rowsort
SELECT 90 + + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 30 * + col1 + - + col1 AS col2 FROM tab2 GROUP BY col1
----
1189
1711
1769

query I rowsort
SELECT DISTINCT + 34 AS col0 FROM tab1 GROUP BY col0
----
34

query I rowsort
SELECT ALL - col0 * 75 AS col2 FROM tab1 WHERE NOT NULL NOT BETWEEN 78 AND NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + 50 * 50 FROM tab2 cor0 GROUP BY col2
----
2500

query I rowsort
SELECT ALL + 20 * + + col2 FROM tab0 GROUP BY col2, col1, col2
----
1580
480
760

query I rowsort
SELECT DISTINCT + col2 * NULLIF ( - 0, - col2 ) FROM tab0 GROUP BY col1, col2
----
0

query I rowsort
SELECT + 50 FROM tab1 WHERE 93 * + col0 NOT BETWEEN + col2 AND 81 GROUP BY col2, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 + - 86 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-4
-58
-64

query I rowsort
SELECT DISTINCT + col2 + + col2 + - col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT 4 FROM tab2 WHERE NOT ( + - 27 * + - CASE - 30 WHEN + 92 THEN - col2 + col2 * - col2 END * + col2 ) IN ( 94 ) GROUP BY col0
----

query I rowsort
SELECT col1 * + 43 * - col1 + col1 * col1 / - col1 * 39 FROM tab1 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT + 94 FROM tab0 GROUP BY col2
----
94
94
94

query I rowsort
SELECT + 71 * + col0 - - + 89 + col0 FROM tab2 AS cor0 GROUP BY col0
----
1169
6641
6713

query I rowsort
SELECT + + 76 + - 92 - col2 / + col2 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL <= + ( col2 )
----

query I rowsort
SELECT DISTINCT 3 FROM tab1 GROUP BY col0, col2
----
3

query I rowsort
SELECT - - col0 * 49 FROM tab1 AS cor0 GROUP BY col0
----
1078
1372
4018

query I rowsort
SELECT ALL + - 59 FROM tab0 AS cor0 GROUP BY col2
----
-59
-59
-59

query I rowsort
SELECT DISTINCT + 30 FROM tab0 AS cor0 GROUP BY col2 HAVING + - col2 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query III rowsort label-9684
SELECT col0 DIV - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST( NULL AS SIGNED ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-9684
SELECT col0 / - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

query I rowsort
SELECT + 66 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL <= - col1
----

query I rowsort
SELECT + 67 * col2 FROM tab2 GROUP BY col2
----
3886
5293
5829

query I rowsort
SELECT ALL - ( 23 ) + col1 * - col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 * col0 IN ( + 49 )
----

query I rowsort
SELECT 83 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
83
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 30 - + col2 col1 FROM tab1 GROUP BY col2, col1
----
-15
-41
22

query I rowsort
SELECT + 68 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col1, col2 HAVING AVG ( DISTINCT + col2 ) = ( + col2 )
----
68
68
68

query I rowsort
SELECT ALL col0 * col0 FROM tab2 cor0 WHERE NOT - 64 IN ( col1 + - col2 * ( - col1 ) ) GROUP BY col0 HAVING NOT - col0 NOT IN ( + col0 )
----

query I rowsort
SELECT ALL 18 FROM tab1 GROUP BY col0, col1 HAVING - col0 - + col0 IS NULL
----

query I rowsort
SELECT 50 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9694
SELECT + 86 + + ( + CAST( col2 AS SIGNED ) - col0 * col2 ) * + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-105880
-306038
-561604

skipif mysql # not compatible
query I rowsort label-9694
SELECT + 86 + + ( + CAST ( col2 AS INTEGER ) - col0 * col2 ) * + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-105880
-306038
-561604

query I rowsort
SELECT DISTINCT - 10 FROM tab2 GROUP BY col2, col1, col1 HAVING NOT ( col1 ) - - col2 / + 56 IS NOT NULL
----

query I rowsort
SELECT ALL 62 FROM tab1 GROUP BY col0
----
62
62
62

query I rowsort
SELECT + 78 AS col1 FROM tab2 WHERE NOT COALESCE ( - col0, + col1 ) IS NOT NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT 88 + + col0 AS col0 FROM tab2 GROUP BY col0
----
103
179
180

query I rowsort
SELECT ALL - col2 * - 62 AS col2 FROM tab2 GROUP BY col2 HAVING NULL NOT IN ( 42 )
----

query I rowsort
SELECT 98 * 73 FROM tab2 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE NOT col1 IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col1 * col1 + 50 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT 29 * + 70 IS NULL
----
1986
3299
86

query I rowsort
SELECT DISTINCT + 1 * col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
38
79

query I rowsort
SELECT ( + 86 ) * - col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT + 36 + - 81 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 15 FROM tab1 GROUP BY col2, col1, col2
----
15
15
15

query I rowsort
SELECT ALL 79 AS col1 FROM tab0 GROUP BY col2, col1
----
79
79
79

query I rowsort
SELECT - + col1 * col1 + col1 FROM tab0 AS cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT 43 - + - col0 FROM tab2 GROUP BY col0, col2 HAVING - NULLIF ( - col2, + - 31 ) IS NULL
----

query I rowsort
SELECT 72 + - 70 + + - col2 * ( + col2 ) AS col2 FROM tab1 GROUP BY col2, col2
----
-2023
-5039
-62

query I rowsort
SELECT + - col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 93, col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING 77 IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING - col2 + + 13 NOT BETWEEN + col2 * + ( + + col2 ) * + ( - AVG ( col2 ) ) + - + col2 AND + + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9715
SELECT - + CAST( NULL AS SIGNED ) FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9715
SELECT - + CAST ( NULL AS INTEGER ) FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + + 82 AS col0 FROM tab1 AS cor0 WHERE NOT + 42 * col2 + col2 > NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col0 + 98 AS col0 FROM tab1 GROUP BY col0
----
120
126
180

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9718
SELECT DISTINCT - + col1 * - - CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) AS col0 FROM tab2 WHERE NULL BETWEEN - + 47 AND NULL GROUP BY col1 HAVING NOT ( - col1 * - - 35 ) IS NOT NULL
----

skipif mysql # not compatible
query I rowsort label-9718
SELECT DISTINCT - + col1 * - - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) AS col0 FROM tab2 WHERE NULL BETWEEN - + 47 AND NULL GROUP BY col1 HAVING NOT ( - col1 * - - 35 ) IS NOT NULL
----

query I rowsort
SELECT - ( + - 28 ) AS col1 FROM tab1 WHERE + 85 <> - col0 + - - 79 GROUP BY col2
----
28
28
28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 48 col1 FROM tab2 AS cor0 GROUP BY col2
----
48
48
48

query I rowsort
SELECT DISTINCT col2 - col2 + + 32 AS col1 FROM tab2 GROUP BY col2
----
32

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + 45 col0 FROM tab0 cor0 GROUP BY col0
----
45

query I rowsort
SELECT - - col1 * - col1 + - 70 + + 57 + ( - CASE - col1 WHEN col1 THEN + - ( col1 ) END ) + - col1 + col1 * + + 31 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9724
SELECT + - COALESCE ( - + col1, - + CAST( NULL AS SIGNED ) ) + col1 + + 17 - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

skipif mysql # not compatible
query I rowsort label-9724
SELECT + - COALESCE ( - + col1, - + CAST ( NULL AS INTEGER ) ) + col1 + + 17 - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9725
SELECT ( - - 81 ) * + col0 * - - col0 + - 83 + + 9 * col0 DIV + ( 3 ) FROM tab1 GROUP BY col0
----
39187
544807
63505

skipif mysql # not compatible
query I rowsort label-9725
SELECT ( - - 81 ) * + col0 * - - col0 + - 83 + + 9 * col0 / + ( 3 ) FROM tab1 GROUP BY col0
----
39187
544807
63505

query I rowsort
SELECT + 4 AS col0 FROM tab1 GROUP BY col2, col1
----
4
4
4

query I rowsort
SELECT + col0 * + + col0 + - col0 + 49 FROM tab2 AS cor0 GROUP BY col0
----
259
8239
8421

query I rowsort
SELECT ALL + 60 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
60
60

query I rowsort
SELECT ALL 52 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING 73 IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( - COALESCE ( col0, - col1 + - - col0 ) ) FROM tab1 GROUP BY col0, col1 HAVING - - 72 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 * + col0 * + 98 FROM tab1 AS cor0 GROUP BY col0
----
-47432
-658952
-76832

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9733
SELECT + col2 + + col2 + - - CAST( NULL AS DECIMAL ) AS col0 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9733
SELECT + col2 + + col2 + - - CAST ( NULL AS REAL ) AS col0 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + + 10 AS col1 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL 71 * + col2 * - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
102524
40896
443111

query I rowsort
SELECT + 10 FROM tab2 GROUP BY col0
----
10
10
10

query I rowsort
SELECT ALL + 72 FROM tab2 GROUP BY col1
----
72
72
72

query II rowsort
SELECT ALL + col2 AS col2, + 66 AS col1 FROM tab2 cor0 GROUP BY col0, col2
----
58
66
79
66
87
66

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9739
SELECT ALL - - col0 / + col0 + + AVG ( ALL - col0 ) + col0 + - CAST( NULL AS SIGNED ) + - + col0 / ( + - col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9739
SELECT ALL - - col0 / + col0 + + AVG ( ALL - col0 ) + col0 + - CAST ( NULL AS INTEGER ) + - + col0 / ( + - col0 ) FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
NULL
NULL
NULL

onlyif mysql # DIV for integer division: 
query I rowsort label-9740
SELECT ALL - - 70 * col0 + 76 DIV - col0 FROM tab1 cor0 GROUP BY col1, col0
----
1537
1958
5740

skipif mysql # not compatible
query I rowsort label-9740
SELECT ALL - - 70 * col0 + 76 / - col0 FROM tab1 cor0 GROUP BY col1, col0
----
1537
1958
5740

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2 HAVING NOT 87 * - 39 IS NOT NULL
----

query I rowsort
SELECT - 15 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-615
-885
-915

query II rowsort
SELECT col0, 74 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
74
28
74
82
74

query I rowsort
SELECT 60 + col0 + + col0 * col0 * - 46 FROM tab2 GROUP BY col1, col0
----
-10275
-380775
-389192

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 col0 FROM tab1 AS cor0 WHERE 36 >= NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( - + 68 ) + 95 col0 FROM tab1 GROUP BY col1, col1
----
27

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9747
SELECT + CAST( NULL AS SIGNED ) / - col2 * 19 FROM tab1 AS cor0 WHERE NOT col1 = + 54 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9747
SELECT + CAST ( NULL AS INTEGER ) / - col2 * 19 FROM tab1 AS cor0 WHERE NOT col1 = + 54 GROUP BY col2, col2
----
NULL
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query II rowsort label-9748
SELECT + + col2 * + + col2 DIV - ( CAST( - col2 AS SIGNED ) ) + + 90, col2 FROM tab1 AS cor0 GROUP BY col2
----
135
45
161
71
98
8

skipif mysql # not compatible
query II rowsort label-9748
SELECT + + col2 * + + col2 / - ( CAST ( - col2 AS INTEGER ) ) + + 90, col2 FROM tab1 AS cor0 GROUP BY col2
----
135
45
161
71
98
8

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT NULL NOT IN ( col2 - + col2 * - col2, 48, + + 11 + + col0 * + ( - col0 ), + col1 * + + col0, - - col0 * col2 ) GROUP BY col2
----

query I rowsort
SELECT - 29 * + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
2639
2668
435

query I rowsort
SELECT DISTINCT - + col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

onlyif mysql # DIV for integer division: 
query I rowsort label-9752
SELECT + col2 DIV - col2 + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-59
-80
-88

skipif mysql # not compatible
query I rowsort label-9752
SELECT + col2 / - col2 + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-59
-80
-88

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9753
SELECT col1 FROM tab0 AS cor0 WHERE - CAST( + + col1 AS SIGNED ) * 46 * 80 * - NULLIF ( 1, + + col1 ) * - col1 * - col2 + + col0 / - - 51 IS NULL GROUP BY col1
----

skipif mysql # not compatible
query I rowsort label-9753
SELECT col1 FROM tab0 AS cor0 WHERE - CAST ( + + col1 AS INTEGER ) * 46 * 80 * - NULLIF ( 1, + + col1 ) * - col1 * - col2 + + col0 / - - 51 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL 17 + + 52 FROM tab0 GROUP BY col0
----
69
69
69

query I rowsort
SELECT NULLIF ( + col2, - 63 ) * 53 FROM tab0 GROUP BY col2, col0
----
1272
2014
4187

query II rowsort
SELECT DISTINCT ( - col2 ), col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9757
SELECT ALL + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2, col1 HAVING col2 * col1 IS NOT NULL
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9757
SELECT ALL + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2, col1 HAVING col2 * col1 IS NOT NULL
----
NULL
NULL
NULL

query I rowsort
SELECT + col2 + + + 77 FROM tab1 GROUP BY col2, col0 HAVING ( - + 3 ) IS NOT NULL
----
122
148
85

query I rowsort
SELECT ALL 28 FROM tab0 GROUP BY col1, col0 HAVING ( + 53 BETWEEN NULL AND + - 69 * - 39 )
----

query I rowsort
SELECT ALL - 15 FROM tab1 AS cor0 GROUP BY col2, col0
----
-15
-15
-15

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT 85 FROM tab2 GROUP BY col0
----
85
85
85

query I rowsort
SELECT - - col2 FROM tab2 WHERE NOT NULL > NULL GROUP BY col0, col2
----

query I rowsort
SELECT ( - + col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query II rowsort
SELECT + - 47 + + col1 + + col1 / + col1 / - + 80 + col1, col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) <= - 94
----

query I rowsort
SELECT ALL 62 FROM tab2 AS cor0 GROUP BY col2
----
62
62
62

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9767
SELECT ALL + col0 * - + ( - - CAST( NULL AS SIGNED ) ) - + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9767
SELECT ALL + col0 * - + ( - - CAST ( NULL AS INTEGER ) ) - + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
NULL
NULL
NULL

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
-26
-43
-83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9769
SELECT - + col1 + col1 AS col0 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT col2 + - col2 * CAST( NULL AS SIGNED ) + + - 68 + - + ( - + 74 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-9769
SELECT - + col1 + col1 AS col0 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT col2 + - col2 * CAST ( NULL AS INTEGER ) + + - 68 + - + ( - + 74 ) IS NULL
----

query I rowsort
SELECT 72 + + col2 * 65 * - - col2 AS col2 FROM tab2 GROUP BY col2
----
218732
405737
492057

query I rowsort
SELECT - col2 + - col2 * + 23 + - 62 AS col2 FROM tab2 GROUP BY col2, col2
----
-1454
-1958
-2150

query I rowsort
SELECT DISTINCT + 95 FROM tab0 AS cor0 GROUP BY col1
----
95

query I rowsort
SELECT - 71 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + 99 AND NULL
----

query I rowsort
SELECT - 86 AS col1 FROM tab1 AS cor0 WHERE 76 NOT BETWEEN 98 AND NULL GROUP BY col0, col0 HAVING NOT + - 62 IS NULL
----
-86
-86
-86

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9775
SELECT - col0 * - + 8 + + + col0 + + + col0 + + + 42 * col0 FROM tab0 GROUP BY col0, col0, col1 HAVING NOT 18 + - col0 IN ( + CAST( + col0 AS SIGNED ) )
----
1352
2236
4316

skipif mysql # not compatible
query I rowsort label-9775
SELECT - col0 * - + 8 + + + col0 + + + col0 + + + 42 * col0 FROM tab0 GROUP BY col0, col0, col1 HAVING NOT 18 + - col0 IN ( + CAST ( + col0 AS INTEGER ) )
----
1352
2236
4316

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 AS cor0 WHERE NULL <> ( NULL ) GROUP BY col2, col0, col0
----

query I rowsort
SELECT - 94 FROM tab1 cor0 WHERE NOT + 51 + 31 IS NULL GROUP BY col0
----
-94
-94
-94

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( + ( + col1 ) ) IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT col2 * col2 * col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
-2085136
-331776
-38950081

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9780
SELECT DISTINCT CAST( NULL AS SIGNED ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9780
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
NULL

query I rowsort
SELECT ( - - col0 ) * - + ( - col0 ) + + col0 + 52 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1944
7024
754

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col1, col0 HAVING - AVG ( - + col2 ) + + - 44 * + + col1 - col1 IS NOT NULL
----
-15
-91
-92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9784
SELECT + col0 / - 15 col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL >= + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9784
SELECT + col0 / - 15 col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL >= + CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9785
SELECT ALL CAST( NULL AS SIGNED ) + - col0 / + 90 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9785
SELECT ALL CAST ( NULL AS INTEGER ) + - col0 / + 90 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 60 + col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NOT - ( + col0 ) * - 48 + - 39 + + 45 * col1 = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9787
SELECT DISTINCT AVG ( + - CAST( NULL AS SIGNED ) ) FROM tab0 GROUP BY col0, col1 HAVING + col1 > ( - col1 )
----
NULL

skipif mysql # not compatible
query I rowsort label-9787
SELECT DISTINCT AVG ( + - CAST ( NULL AS INTEGER ) ) FROM tab0 GROUP BY col0, col1 HAVING + col1 > ( - col1 )
----
NULL

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9788
SELECT - - CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-9788
SELECT - - CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0, col0 col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + 35 FROM tab1 GROUP BY col2 HAVING NOT NULL <= - 97
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9791
SELECT DISTINCT - 39 * 49 * - - 31 * CAST( NULL AS SIGNED ) - col0 AS col1 FROM tab2 WHERE NOT - col0 * - - col1 NOT IN ( + + col2 ) GROUP BY col2, col0
----

skipif mysql # not compatible
query I rowsort label-9791
SELECT DISTINCT - 39 * 49 * - - 31 * CAST ( NULL AS INTEGER ) - col0 AS col1 FROM tab2 WHERE NOT - col0 * - - col1 NOT IN ( + + col2 ) GROUP BY col2, col0
----

query I rowsort
SELECT ALL - 92 FROM tab2 AS cor0 GROUP BY col1
----
-92
-92
-92

query I rowsort
SELECT ALL ( 32 ) * + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL <> - col0 )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL > + 24
----

query I rowsort
SELECT + 21 / col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL <= AVG ( ALL - col1 )
----

query I rowsort
SELECT ALL 69 * + 51 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IN ( 48 )
----

query I rowsort
SELECT col2 * - 2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-142
-16
-90

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9798
SELECT + + col0 + + - CAST( - col0 AS SIGNED ) col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
182
184
30

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9798
SELECT + + col0 + + - CAST ( - col0 AS INTEGER ) col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
182
184
30

query I rowsort
SELECT DISTINCT + - 51 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-51

query I rowsort
SELECT ALL 39 FROM tab0 GROUP BY col0, col2, col0
----
39
39
39

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 WHERE 89 + - - 59 IS NULL GROUP BY col2 HAVING col2 + - + 28 NOT BETWEEN NULL AND - col2 + + col2
----

query I rowsort
SELECT ALL - 50 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9804
SELECT DISTINCT + CAST( NULL AS SIGNED ) * + - 10 AS col1 FROM tab2 cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
query I rowsort label-9804
SELECT DISTINCT + CAST ( NULL AS INTEGER ) * + - 10 AS col1 FROM tab2 cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT + 22 + - 54 FROM tab0 AS cor0 GROUP BY col1, col2
----
-32
-32
-32

query II rowsort
SELECT ( - - col0 ) - col0, - col0 + + col0 FROM tab0 GROUP BY col0
----
0
0
0
0
0
0

query I rowsort
SELECT + - AVG ( ALL + col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT 14 - + 26 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9808
SELECT ALL + 30 AS col0 FROM tab0 WHERE NOT CAST( NULL AS SIGNED ) - + 82 <> + col2 AND NOT ( NULL ) <> - - 31 * col1 GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-9808
SELECT ALL + 30 AS col0 FROM tab0 WHERE NOT CAST ( NULL AS INTEGER ) - + 82 <> + col2 AND NOT ( NULL ) <> - - 31 * col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col0, col1 HAVING NOT + ( + - 72 ) IS NULL
----
22
28
82

query I rowsort
SELECT col0 * + 57 * - - 56 FROM tab2 GROUP BY col0, col0
----
290472
293664
47880

query I rowsort
SELECT DISTINCT + 85 - - 61 AS col0 FROM tab2 cor0 GROUP BY col1
----
146

onlyif mysql # DIV for integer division: 
query I rowsort label-9812
SELECT DISTINCT - 36 DIV + + 40 - + - col1 + + + ( - col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
0

skipif mysql # not compatible
query I rowsort label-9812
SELECT DISTINCT - 36 / + + 40 - + - col1 + + + ( - col1 ) AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
0

query I rowsort
SELECT - + col0 FROM tab0 cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL AND NULL IS NULL
----

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING ( 64 ) IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 - 75 + + col2 - - ( - 54 ) * + - col2 col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL 4 * + + col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
324

query I rowsort
SELECT DISTINCT - col2 / - 21 * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 GROUP BY col1, col0
----
15
91
92

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9819
SELECT + col1 * - - 27 * ( + + CAST( NULL AS SIGNED ) ) * CAST( col0 AS SIGNED ) * col0 / - col2 / - col1 FROM tab2 GROUP BY col2, col0, col1 HAVING ( 75 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-9819
SELECT + col1 * - - 27 * ( + + CAST ( NULL AS INTEGER ) ) * CAST ( col0 AS INTEGER ) * col0 / - col2 / - col1 FROM tab2 GROUP BY col2, col0, col1 HAVING ( 75 ) IS NULL
----

query II rowsort
SELECT + col1, col1 AS col1 FROM tab0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT col2 FROM tab0 WHERE NOT + col0 + + COALESCE ( + 19, col0 * - 8, + col1 ) + col0 IN ( + col0 ) GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col1 - + 11 + - col0 * - - 24 + + col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 * - 16, col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
1328
83
416
26
688
43

query I rowsort
SELECT + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1 HAVING ( NOT 30 IS NULL )
----
-166
-52
-86

query I rowsort
SELECT 87 FROM tab0 AS cor0 GROUP BY col0, col2
----
87
87
87

onlyif mysql # DIV for integer division: 
query I rowsort label-9827
SELECT ALL - col1 DIV + + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9827
SELECT ALL - col1 / + + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-1
-1
-1

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NOT - col1 > + col0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL 28 * - 55 * - 42 - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
64601
64642
64656

query I rowsort
SELECT ALL col0 * col0 - + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
476
6653
739

query I rowsort
SELECT 44 FROM tab1 GROUP BY col2, col0 HAVING - 26 BETWEEN NULL AND - 52 * 81
----

query I rowsort
SELECT + 78 FROM tab0 GROUP BY col2
----
78
78
78

query I rowsort
SELECT 59 AS col2 FROM tab1 GROUP BY col1, col2, col2
----
59
59
59

query I rowsort
SELECT DISTINCT - - col0 - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
0

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( - + ( + 78 ) ) IS NULL
----

query II rowsort
SELECT + col2, 32 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
32
71
32
8
32

query I rowsort
SELECT ALL + + col1 * + col1 + + + 41 * - - col1 + + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
9801

query I rowsort
SELECT ALL NULLIF ( 46, - ( + - 24 ) - + col1 ) * col1 + col0 AS col1 FROM tab0 GROUP BY col0, col1
----
26
3769
83

query I rowsort
SELECT DISTINCT + - col2 * 10 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 * + + 45 + + + 31 * - - col2 IS NULL
----
-240
-380
-790

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * - 9 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-135
-819
-828

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL <> ( - 52 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT - col2 * + 83 FROM tab1 GROUP BY col2
----
-3735
-5893
-664

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL NOT IN ( + - 36 )
----

query I rowsort
SELECT col0 - + col2 AS col2 FROM tab1 GROUP BY col2, col2, col0
----
-17
11
14

query I rowsort
SELECT DISTINCT ( - col2 ) FROM tab0 GROUP BY col1, col2 HAVING + + col1 IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( - col0 IS NULL )
----

query I rowsort
SELECT + - 72 AS col0 FROM tab1 WHERE NOT - 50 <= + col0 GROUP BY col2
----

query I rowsort
SELECT 82 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
82
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL ( + 63 ) AS col2, + col1 + - 72 col0 FROM tab2 AS cor0 WHERE NOT 43 + - + 2 / - col0 IS NULL GROUP BY col1
----
63
-11
63
-13
63
-31

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9851
SELECT + 82 + + CAST( + + 99 AS SIGNED ) FROM tab1 AS cor0 GROUP BY col2
----
181
181
181

skipif mysql # not compatible
query I rowsort label-9851
SELECT + 82 + + CAST ( + + 99 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col2
----
181
181
181

query I rowsort
SELECT DISTINCT col0 + - 25 + + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 9 col2, col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) >= NULL
----

query I rowsort
SELECT - 46 * + col1 FROM tab2 GROUP BY col1
----
-1886
-2714
-2806

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL col2 * - 24 + 33 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-1047
-159
-1671

query I rowsort
SELECT - 57 AS col0 FROM tab2 GROUP BY col1
----
-57
-57
-57

query I rowsort
SELECT + ( + col1 ) FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + 99 FROM tab2 GROUP BY col1
----
99
99
99

query II rowsort
SELECT - col2 AS col1, + 56 FROM tab2 AS cor0 GROUP BY col2
----
-58
56
-79
56
-87
56

query I rowsort
SELECT DISTINCT - ( + ( - col1 ) ) FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - AVG ( DISTINCT 81 ) AS col2 FROM tab2 cor0 WHERE NOT - col2 * col2 <= + 17 GROUP BY col1 HAVING NOT - ( col1 ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - ( ( + - col2 ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT + col1 <> NULL
----

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NULL = + col0 GROUP BY col1
----

query I rowsort
SELECT col1 + - 82 AS col0 FROM tab0 GROUP BY col1
----
-1
-82

query I rowsort
SELECT DISTINCT col1 * + col0 + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
154
1624
3690

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT DISTINCT col1, col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * col0 FROM tab0 cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col0 + - + 42 + col0 AS col1 FROM tab2 GROUP BY col0
----
-12
140
142

query I rowsort
SELECT ALL + + col0 + + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL <> - col0
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 - + ( - 61 ) FROM tab0 GROUP BY col2
----
140
85
99

query I rowsort
SELECT ALL 17 AS col2 FROM tab0 GROUP BY col1, col0 HAVING + + ( col0 ) IS NULL
----

query I rowsort
SELECT + - ( + 58 ) AS col1 FROM tab2 AS cor0 WHERE ( NOT NULL IS NOT NULL ) GROUP BY col2, col0
----
-58
-58
-58

query I rowsort
SELECT - 30 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-30
-30
-30

query II rowsort
SELECT ALL + col1, - 5 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 * + - col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query II rowsort
SELECT - col1 AS col2, ( + col1 ) AS col2 FROM tab1 GROUP BY col1
----
-44
44
-57
57
-6
6

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9883
SELECT DISTINCT CAST( - - 33 AS SIGNED ) + col0 AS col2, + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
124
91
125
92
48
15

skipif mysql # not compatible
query II rowsort label-9883
SELECT DISTINCT CAST ( - - 33 AS INTEGER ) + col0 AS col2, + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
124
91
125
92
48
15

query I rowsort
SELECT ALL 40 FROM tab2 AS cor0 WHERE NOT + 2 / + col2 IS NULL AND NOT NULL > + 36 / col1 GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 * - 45 AS col2 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
-1260
-3690
-990

query I rowsort
SELECT DISTINCT 36 * + col1 FROM tab2 GROUP BY col1
----
1476
2124
2196

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9887
SELECT DISTINCT - col2 * + col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING ( - ( - CAST( 36 AS DECIMAL ) ) * + + col1 + + - col2 ) IS NULL
----

skipif mysql # not compatible
query I rowsort label-9887
SELECT DISTINCT - col2 * + col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING ( - ( - CAST ( 36 AS REAL ) ) * + + col1 + + - col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT 25 * col2 FROM tab1 GROUP BY col1, col2
----
1125
1775
200

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col1, col2, col1
----
58
79
87

query I rowsort
SELECT 80 + col2 + - col2 AS col1 FROM tab2 GROUP BY col2, col0
----
80
80
80

query I rowsort
SELECT ALL + col2 * + col2 FROM tab2 GROUP BY col1, col2
----
3364
6241
7569

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT 97 + 85 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 45 / - - ( - col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT 32 AS col2 FROM tab1 GROUP BY col1
----
32
32
32

query I rowsort
SELECT DISTINCT + 71 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - 72 * col0 col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
-1846
-3053
-5893

query I rowsort
SELECT + - 51 * 79 + + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-3947
-4001
-4007

query I rowsort
SELECT DISTINCT + + 0 * + + col1 + - col1 * - col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT + 41 BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT COALESCE ( 15, - col1 ) * + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - 92 + col1 * 16 IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9903
SELECT ALL + col2, CAST( NULL AS SIGNED ) * - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
NULL
79
NULL
87
NULL

skipif mysql # not compatible
query II rowsort label-9903
SELECT ALL + col2, CAST ( NULL AS INTEGER ) * - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
NULL
79
NULL
87
NULL

query I rowsort
SELECT ALL 25 AS col1 FROM tab2 GROUP BY col0, col1 HAVING - col0 IS NULL
----

query I rowsort
SELECT DISTINCT col1 - + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 4 + - 60 * - col0 col2 FROM tab0 AS cor0 WHERE NOT ( NOT - - col1 IS NOT NULL ) GROUP BY col0
----
1564
2584
4984

query I rowsort
SELECT ALL - - 16 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - 45 - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-126
-45

query I rowsort
SELECT ( - 56 ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-56
-56
-56

query I rowsort
SELECT + col0 * + 20 AS col0 FROM tab2 GROUP BY col0, col0
----
1820
1840
300

query I rowsort
SELECT DISTINCT + col1 - ( - col1 ) FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88

query I rowsort
SELECT ALL col1 + col2 FROM tab0 GROUP BY col1, col2, col2 HAVING NOT - col1 BETWEEN col1 AND NULL
----
105

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 68 col2 FROM tab1 GROUP BY col0 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT 57 * 4 + - 59 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
169
169
169

query I rowsort
SELECT + col1 + - 40 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1599
-2301
-2379

query I rowsort
SELECT DISTINCT 22 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( + col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9918
SELECT DISTINCT - COALESCE ( 74, + CAST( NULL AS SIGNED ) ) * 94 FROM tab1 GROUP BY col1, col0
----
-6956

skipif mysql # not compatible
query I rowsort label-9918
SELECT DISTINCT - COALESCE ( 74, + CAST ( NULL AS INTEGER ) ) * 94 FROM tab1 GROUP BY col1, col0
----
-6956

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT col1 IN ( 25 )
----
-81
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9920
SELECT + col2 * + CAST( NULL AS SIGNED ) FROM tab2 GROUP BY col2, col1 HAVING ( NULL ) < - ( col1 )
----

skipif mysql # not compatible
query I rowsort label-9920
SELECT + col2 * + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1 HAVING ( NULL ) < - ( col1 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9921
SELECT DISTINCT CAST( - 78 AS SIGNED ) FROM tab1 GROUP BY col0, col0
----
-78

skipif mysql # not compatible
query I rowsort label-9921
SELECT DISTINCT CAST ( - 78 AS INTEGER ) FROM tab1 GROUP BY col0, col0
----
-78

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT NULL > 70
----

query I rowsort
SELECT ALL col2 + 52 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - 31 AS col0 FROM tab2 WHERE NOT col1 / col1 IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9925
SELECT + 45 * + CAST( 44 AS SIGNED ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9925
SELECT + 45 * + CAST ( 44 AS INTEGER ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 + + col1 * + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
14
1854
3221

query I rowsort
SELECT ALL 70 AS col1 FROM tab2 GROUP BY col0, col2
----
70
70
70

query I rowsort
SELECT DISTINCT + - col1 * + 86 + 17 FROM tab2 AS cor0 GROUP BY col0, col1
----
-3509
-5057
-5229

query I rowsort
SELECT - 63 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-63
-63
-63

query I rowsort
SELECT ALL - col2 - + 67 FROM tab1 AS cor0 GROUP BY col2
----
-112
-138
-75

query I rowsort
SELECT - ( - col0 ) - col0 FROM tab1 GROUP BY col1, col1, col0
----
0
0
0

query I rowsort
SELECT ALL - - 54 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
54
54
54

query I rowsort
SELECT - ( + - 68 ) AS col1 FROM tab2 GROUP BY col2
----
68
68
68

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( - 60 ) IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 95 FROM tab2 AS cor0 GROUP BY col1, col1
----
95
95
95

query I rowsort
SELECT - ( - + col1 ) + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
138
148
99

query I rowsort
SELECT - - ( col2 ) FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9939
SELECT 13 AS col2, CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
13
NULL
13
NULL
13
NULL

skipif mysql # not compatible
query II rowsort label-9939
SELECT 13 AS col2, CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
13
NULL
13
NULL
13
NULL

query I rowsort
SELECT + 61 AS col1 FROM tab0 GROUP BY col2, col0
----
61
61
61

onlyif mysql # DIV for integer division: 
query I rowsort label-9941
SELECT + 56 DIV col0 + + + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT + 92 IS NULL
----
18
91
92

skipif mysql # not compatible
query I rowsort label-9941
SELECT + 56 / col0 + + + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT + 92 IS NULL
----
18
91
92

query I rowsort
SELECT ALL + ( + col1 ) AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <> - col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1, + col1 + 43 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL BETWEEN ( col0 ) AND - + 68 * + + 41 - - 84 + + - col1
----

query I rowsort
SELECT DISTINCT 24 AS col0 FROM tab0 GROUP BY col0
----
24

query I rowsort
SELECT 18 - + ( + ( - 90 ) ) FROM tab1 AS cor0 GROUP BY col1, col0
----
108
108
108

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query II rowsort
SELECT col2 AS col0, col2 + col2 FROM tab0 GROUP BY col2
----
24
48
38
76
79
158

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col0 HAVING NOT + - col2 < col2
----

query II rowsort
SELECT col1, 65 AS col0 FROM tab0 GROUP BY col1
----
0
65
81
65

query I rowsort
SELECT DISTINCT 70 * + col0 + + 46 FROM tab2 cor0 GROUP BY col0
----
1096
6416
6486

onlyif mysql # DIV for integer division: 
query I rowsort label-9951
SELECT + ( - 37 ) DIV - 64 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

skipif mysql # not compatible
query I rowsort label-9951
SELECT + ( - 37 ) / - 64 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL col1 + + col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT + 37 AS col1 FROM tab0 GROUP BY col2, col2
----
37
37
37

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 + + ( + col0 ) AS col0 FROM tab1 AS cor0 WHERE ( NULL ) <> col2 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 - col0 col2 FROM tab1 AS cor0 WHERE NOT - col2 BETWEEN NULL AND + col0 GROUP BY col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9957
SELECT col1, + col1 * + CAST( NULL AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
NULL
81
NULL

skipif mysql # not compatible
query II rowsort label-9957
SELECT col1, + col1 * + CAST ( NULL AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
NULL
81
NULL

query I rowsort
SELECT ALL + col1 + - - col1 + 59 FROM tab2 GROUP BY col1
----
141
177
181

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 * + col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING - - col1 + - + col2 <> NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9961
SELECT + CAST( + + col1 AS SIGNED ) FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1, col1
----

skipif mysql # not compatible
query I rowsort label-9961
SELECT + CAST ( + + col1 AS INTEGER ) FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1, col1
----

query I rowsort
SELECT ALL - 21 FROM tab2 AS cor0 WHERE col1 IS NULL GROUP BY col2
----

query I rowsort
SELECT - col0 + - 89 * col0 FROM tab0 cor0 GROUP BY col2, col0
----
-2340
-3870
-7470

query I rowsort
SELECT ALL - ( - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING + COALESCE ( col0, + 50 ) > + - col0
----
15
91
92

query I rowsort
SELECT DISTINCT 37 AS col1 FROM tab1 GROUP BY col0
----
37

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9966
SELECT + col2 col0 FROM tab0 GROUP BY col2 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-9966
SELECT + col2 col0 FROM tab0 GROUP BY col2 HAVING + CAST ( NULL AS INTEGER ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT ( + col2 ) FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - 81 FROM tab1 AS cor0 GROUP BY col2, col1
----
-81

query I rowsort
SELECT 59 + - + col1 + - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
59
59

query I rowsort
SELECT ALL col1 + col1 + 31 AS col2 FROM tab2 cor0 GROUP BY col1, col0, col0
----
113
149
153

query I rowsort
SELECT ALL - col0 * + 11 * col0 FROM tab0 AS cor0 GROUP BY col0
----
-20339
-7436
-75779

query II rowsort
SELECT ALL col2 + + + col2 AS col1, + col2 + + - 37 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NULL
----
142
34
16
-29
90
8

query II rowsort
SELECT 59, col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
59
44
59
57
59
6

query I rowsort
SELECT col1 + - col1 AS col0 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT + + 78 FROM tab1 AS cor0 WHERE 40 / NULLIF ( + col0, - 86 ) NOT BETWEEN - col0 AND + COALESCE ( ( - 94 ), + col1 * + col2 ) GROUP BY col1, col2, col0
----
78

query I rowsort
SELECT - - COALESCE ( 77, col2 ) + col0 FROM tab2 WHERE NOT + + 24 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 WHERE NULL IN ( 21, + col1 * + 51 * - col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
0

query I rowsort
SELECT col1 * - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-2378
-4661
-5307

query II rowsort
SELECT + - col1 * - col1, col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 + - col0 AS col0 FROM tab0 GROUP BY col0
----
-1892
-6972
-702

query I rowsort
SELECT DISTINCT - + ( 12 ) FROM tab0 AS cor0 GROUP BY col1 HAVING + - col1 IS NOT NULL
----
-12

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * col1 col0 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
6561

query I rowsort
SELECT ALL + + 90 + + - 80 AS col1 FROM tab0 WHERE - col1 BETWEEN - col1 * col1 - + col1 AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 + 39 FROM tab0 AS cor0 GROUP BY col2
----
118
63
77

query I rowsort
SELECT ALL NULLIF ( COALESCE ( + col1, col1 ), 18 ) FROM tab2 GROUP BY col1, col0
----
41
59
61

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-9988
SELECT col0 FROM tab1 WHERE NOT ( NULL ) BETWEEN NULL AND NULL AND NOT ( - - col2 ) * + col1 * CAST( - - col1 AS DECIMAL ) + - 57 IS NULL GROUP BY col0
----

skipif mysql # not compatible
query I rowsort label-9988
SELECT col0 FROM tab1 WHERE NOT ( NULL ) BETWEEN NULL AND NULL AND NOT ( - - col2 ) * + col1 * CAST ( - - col1 AS REAL ) + - 57 IS NULL GROUP BY col0
----

query I rowsort
SELECT - - 50 FROM tab2 AS cor0 GROUP BY col0
----
50
50
50

query I rowsort
SELECT + - 98 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-98
-98
-98

query I rowsort
SELECT + 80 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + ( + + col0 ) col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT + 4 / - col2 + - 33 IS NOT NULL )
----
-158
-48
-76

query I rowsort
SELECT - 61 * + ( - col1 ) * 28 AS col2 FROM tab0 GROUP BY col1, col1
----
0
138348

query II rowsort
SELECT ALL 56 + + + col1, + ( + col0 ) FROM tab0 GROUP BY col0, col1
----
137
43
56
26
56
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, 96 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( col0 ) NOT BETWEEN - 73 AND NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col0, col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9999
SELECT + CAST( + col0 AS SIGNED ) AS col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-9999
SELECT + CAST ( + col0 AS INTEGER ) AS col2 FROM tab0 GROUP BY col0
----
26
43
83