sqllogictest
Artifact Content
Not logged in

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

qu