sqllogictest
Artifact Content
Not logged in

Artifact d2a073c56555efb5f93d5d0f9eb2b7342e21e55c:


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 - + col1 * - + col1 FROM tab2 cor0 GROUP BY col1
----
1681
3481
3721

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

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

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

query I rowsort
SELECT DISTINCT - col2 - col2 AS col0 FROM tab1 AS 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 col1 + + col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NULL
----
0
162

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 + col2 AS col0 FROM tab2 GROUP BY col0, col2
----
58
79
87

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT - col2 - - - col2 AS col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

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

query I rowsort
SELECT DISTINCT col0 * - - col0 * col0 FROM tab0 GROUP BY col0
----
17576
571787
79507

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 * col1 * - col2 + - col1 + - col1 AS col2 FROM tab2 GROUP BY col2, col1
----
-138006
-368337
-461831

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

onlyif mysql # DIV for integer division: 
query I rowsort label-38
SELECT ALL col2 * + col2 DIV + col2 FROM tab2 GROUP BY col2
----
58
79
87

skipif mysql # not compatible
query I rowsort label-38
SELECT ALL col2 * + col2 / + col2 FROM tab2 GROUP BY col2
----
58
79
87

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

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

query I rowsort
SELECT ALL - AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

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

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 BETWEEN + col2 AND AVG ( ALL col1 ) + - col1
----

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

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

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

query I rowsort
SELECT ALL col0 * + col0 AS 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 + - col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

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

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-57
SELECT col0 DIV col0 * col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-57
SELECT col0 / col0 * col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

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

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

query I rowsort
SELECT col1 AS col0 FROM tab2 WHERE - col0 <> NULL GROUP BY col1
----

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

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

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

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 WHERE NOT NULL = NULL GROUP BY col0
----

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

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

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL - col1 - + col1 FROM tab0 AS cor0 WHERE col2 * col1 BETWEEN NULL AND - col0 * + col2 GROUP BY col1
----

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

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

query I rowsort
SELECT DISTINCT - col1 + + + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
-12
2
27

onlyif mysql # DIV for integer division: 
query I rowsort label-81
SELECT ALL col0 * + col0 + - col0 + col1 DIV - - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
211
8191
8373

skipif mysql # not compatible
query I rowsort label-81
SELECT ALL col0 * + col0 + - col0 + col1 / - - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
211
8191
8373

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + - col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1936
-3249
-36

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL col2 * + col0 * + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
1408
413362
56700

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col1 * col0 + - col1 - - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-116
-1625
-3570

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + + + col1 col1 FROM tab2 GROUP BY col1, col1, col0
----
133
150
76

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

query I rowsort
SELECT + col0 * - col0 AS col0 FROM tab2 GROUP BY col0 HAVING AVG ( ALL col2 ) NOT BETWEEN NULL AND ( NULL )
----

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

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 I rowsort
SELECT ALL - col1 col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

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

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

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

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

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

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

query I rowsort
SELECT ALL col1 + + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88

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

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

query I rowsort
SELECT DISTINCT AVG ( ALL - col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

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

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

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

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

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

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <> ( NULL ) GROUP BY col0
----

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

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

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

query II rowsort
SELECT + col2, - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL = ( NULL )
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN + - col0 AND NULL
----

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 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + col0 col2 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + - col0 * + + col0 * + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-17576
-571787
-79507

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

query I rowsort
SELECT 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 * + col0 col2 FROM tab0 cor0 GROUP BY col0, col0, col2
----
1849
676
6889

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

query I rowsort
SELECT DISTINCT - col2 * col2 + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-3456
-6332
-7584

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 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 + col2 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

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

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

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) < - col2
----

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

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

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

query I rowsort
SELECT ALL col0 / col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL <> NULL
----

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

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

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

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

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

query II rowsort
SELECT col2, + col2 FROM tab1 GROUP BY col2, col0
----
45
45
71
71
8
8

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-255
SELECT ALL col1 * col1 DIV col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

skipif mysql # not compatible
query I rowsort label-255
SELECT ALL col1 * col1 / col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

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

query I rowsort
SELECT + + col0 AS 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 ALL col1 col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT + + 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 ALL - col0 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

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

query I rowsort
SELECT + col2 * - col1 FROM tab2 GROUP BY col1, col2
----
-2378
-4661
-5307

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

query II rowsort
SELECT DISTINCT + col0, + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
26
43
43
83
83

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0 HAVING NOT AVG ( - col0 ) < NULL
----

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

query I rowsort
SELECT ALL - - col0 * col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL <= NULL
----

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

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

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

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

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

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

query I rowsort
SELECT col1 AS col0 FROM tab0 WHERE + - col2 <= col0 GROUP BY col1
----
0
81

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

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

query I rowsort
SELECT col2 * + col2 + + col2 + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1520
624
6399

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

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

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

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

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

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

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

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-292
SELECT col1 / - col1 col2 FROM tab2 GROUP BY col2, col1
----
-1
-1
-1

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

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

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

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

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

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

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

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

query I rowsort
SELECT + col0 + + col2 FROM tab2 GROUP BY col2, col2, col0
----
102
150
170

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

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

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

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

query I rowsort
SELECT - col0 FROM tab2 cor0 WHERE NULL > col0 GROUP BY col0, col0
----

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

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

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

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

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

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

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

query I rowsort
SELECT ALL col0 + + col0 AS col1 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
182
184
30

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

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

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

query I rowsort
SELECT ALL + - col1 * - col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
0
6561

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT DISTINCT + col1, - col1 FROM tab0 WHERE NOT ( + col0 ) IS NOT NULL GROUP BY col1, col1
----

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

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

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 + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

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

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

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

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

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

skipif mysql # not compatible
query I rowsort label-358
SELECT - + col0 / + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1
-2
0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col1 col0, col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

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

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

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

query I rowsort
SELECT ALL - - col2 + col2 * + col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

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

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

query I rowsort
SELECT - col1 * + col1 - - col1 FROM tab2 GROUP BY col1, col1
----
-1640
-3422
-3660

query I rowsort
SELECT + - col2 + col1 FROM tab1 cor0 GROUP BY col1, col2
----
-2
-27
12

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col0 * col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-484
-6724
-784

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - - col0 * - - col0 + - + col0 FROM tab2 AS cor0 GROUP BY col0
----
210
8190
8372

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col1 - - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
118
122
82

query I rowsort
SELECT col1 * + col1 FROM tab1 WHERE + col0 IS NOT NULL GROUP BY col1
----
1936
3249
36

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

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

query I rowsort
SELECT - col2 - + col2 AS col1 FROM tab0 AS cor0 WHERE NULL > - col2 GROUP BY col2
----

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

query I rowsort
SELECT DISTINCT - AVG ( - col0 ) FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IN ( - col1 )
----

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

query I rowsort
SELECT ALL - col0 * + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1806
-650
-6806

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-452
SELECT col2 DIV + col2 col2 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-452
SELECT col2 / + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1
1
1

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

query I rowsort
SELECT ALL - col0 FROM tab1 WHERE NOT ( NULL ) NOT IN ( col1 * col0 ) GROUP BY col0
----

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

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

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

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

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

query I rowsort
SELECT col2 - - col2 FROM tab2 GROUP BY col2 HAVING + col2 < - col2
----

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

query I rowsort
SELECT DISTINCT + - col0 AS col1 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-463
SELECT DISTINCT + col0 DIV col0 - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-463
SELECT DISTINCT + col0 / col0 - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-21
-27
-81

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 + col2 + - - col2 FROM tab2 GROUP BY col2
----
174
237
261

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

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NOT + col1 + col1 < + + col1 * - col1 AND NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

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

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

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

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

query II rowsort
SELECT ALL - col0, col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
79
-43
24
-83
38

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) BETWEEN NULL AND ( NULL ) GROUP BY col2
----

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

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

query I rowsort
SELECT - col0 - col0 AS col2 FROM tab2 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT col2 - - col2 FROM tab2 GROUP BY col2
----
116
158
174

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

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

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

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

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

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

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

query I rowsort
SELECT + col0 * col0 AS col2 FROM tab1 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 GROUP BY col2
----
-24
-38
-79

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

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

query I rowsort
SELECT ALL - col1 FROM tab2 WHERE ( + col0 ) IS NOT NULL GROUP BY col1
----
-41
-59
-61

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

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

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) < ( NULL ) GROUP BY col1
----

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

query I rowsort
SELECT ALL col1 * + col1 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
1936
3249
36

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

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

query II rowsort
SELECT ALL AVG ( - - col0 ) AS col2, col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT col0, col0 - - col0 AS col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL <> NULL
----

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 + + col2 col2, col2 FROM tab2 AS cor0 GROUP BY col2
----
116
58
158
79
174
87

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

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

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

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

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

query I rowsort
SELECT DISTINCT col2 * - - col2 * - col2 * col2 AS col0 FROM tab1 GROUP BY col2, col2
----
-25411681
-4096
-4100625

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 * - col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
3364
6241
7569

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

query I rowsort
SELECT col1 + - + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-32
-51
46

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

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-536
SELECT - col1 / col1 col0 FROM tab2 GROUP BY col1
----
-1
-1
-1

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

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 WHERE NULL >= NULL GROUP BY col0, col2
----

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL > NULL
----

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN - col0 AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NULL < - col1 * - col1 GROUP BY col1
----

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + col0 * + col1 + + - col0 FROM tab0 GROUP BY col1, col0
----
-26
-83
3440

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

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

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

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

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

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

query I rowsort
SELECT - + col2 - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-116
-158
-174

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

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 WHERE ( - col0 ) < - col1 GROUP BY col2, col0
----
-71
-8

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

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

query I rowsort
SELECT ALL - - col2 + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

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

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

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

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 WHERE NOT NULL >= col1 GROUP BY col1
----

query II rowsort
SELECT + - col2 + col2, - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) <= NULL
----

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

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

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

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

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 WHERE ( + col1 / col0 ) = + col0 GROUP BY col2, col2
----

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

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

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

query I rowsort
SELECT - col2 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL OR NULL NOT IN ( col2, - col0 ) GROUP BY col2
----
-45
-71
-8

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + col2 - - col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + 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 + col0 * + col0 col0 FROM tab2 AS cor0 WHERE NOT ( col0 ) NOT IN ( col1 ) GROUP BY col0, col0
----

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 + col1 col2, col1 * AVG ( ALL + col1 ) FROM tab1 GROUP BY col1, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

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

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

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NULL < ( + - col0 )
----

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col2 * + col2 FROM tab2 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 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1, 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
----
24
38
79

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-680
SELECT ALL col2 DIV col0 FROM tab0 GROUP BY col2, col0
----
0
0
3

skipif mysql # not compatible
query I rowsort label-680
SELECT ALL col2 / col0 FROM tab0 GROUP BY col2, col0
----
0
0
3

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

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

query I rowsort
SELECT DISTINCT col2 + + + col0 * col2 FROM tab1 GROUP BY col2, col0
----
1305
184
5893

onlyif mysql # DIV for integer division: 
query I rowsort label-684
SELECT ALL - - col2 + + col2 DIV + col1 FROM tab2 cor0 GROUP BY col1, col1, col2
----
59
80
88

skipif mysql # not compatible
query I rowsort label-684
SELECT ALL - - col2 + + col2 / + col1 FROM tab2 cor0 GROUP BY col1, col1, col2
----
59
80
88

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

query I rowsort
SELECT - + col2 + + - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-102
-150
-170

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

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

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

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

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

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

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

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

query I rowsort
SELECT - + AVG ( + col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

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

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

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

query I rowsort
SELECT - col2 + - col2 * col2 FROM tab1 GROUP BY col2
----
-2070
-5112
-72

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

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

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

query II rowsort
SELECT DISTINCT col2, col2 FROM tab0 AS cor0 WHERE col0 * col1 IS NULL GROUP BY col2
----

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

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

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

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

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

query I rowsort
SELECT DISTINCT AVG ( + col2 ) / - + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL < + col2
----

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 ALL col2 * + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
2025
5041
64

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

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

query I rowsort
SELECT col0 + + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
164
44
56

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

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

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

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 I rowsort
SELECT col2 - col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

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

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

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

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 + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT col2 AS col0, + col2 + + + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
45
2070
71
5112
8
72

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

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

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

query I rowsort
SELECT DISTINCT - col0 - - col1 AS col0 FROM tab2 cor0 GROUP BY col0, col1, col1
----
-32
-51
46

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT col0 * col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
3772
5369
915

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * + col0 col0 FROM tab1 GROUP BY col0
----
484
6724
784

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col2 * col1 - - col2 * col2 FROM tab1 GROUP BY col2, col2, col1
----
112
4590
8165

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 * - col2 AS col1 FROM tab0 WHERE NOT + col1 > - col1 GROUP BY col2
----
-1444
-6241

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

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col0, col2 HAVING AVG ( ALL col0 ) + - col2 <> ( NULL )
----

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT ALL col0 AS col2, col2 + + col2 FROM tab0 GROUP BY col0, col2, col2 HAVING - AVG ( + col0 ) IS NOT NULL
----
26
158
43
48
83
76

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT - AVG ( DISTINCT + + 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 + col1 col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
44
57
6

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL - col2 + + col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-890
SELECT - col1 DIV col1 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-890
SELECT - col1 / col1 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

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

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

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 GROUP BY 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 col1 FROM tab0 cor0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col1 - - col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
133
150
76

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT ALL + col1 AS col0, - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

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

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

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-937
SELECT + col2 + - - col2 DIV col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
59
80
88

skipif mysql # not compatible
query I rowsort label-937
SELECT + col2 + - - col2 / col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
59
80
88

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

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

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

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL + AVG ( ALL - + col1 ) FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 - col0 AS col2 FROM tab1 WHERE NULL BETWEEN + col2 AND NULL GROUP BY col0, col2, col0
----

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - col0 + + col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
0
0
0

query II rowsort
SELECT col2, - col0 AS col0 FROM tab0 GROUP BY col0, col2, col0
----
24
-43
38
-83
79
-26

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE NULL > ( NULL ) GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-81
0

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING ( - col0 ) IS NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col0 - col0 FROM tab1 GROUP BY col0, col2
----
-164
-44
-56

query I rowsort
SELECT ALL + col2 * col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT ALL col1 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-958
SELECT + - col1 DIV - + col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-958
SELECT + - col1 / - + col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

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

query I rowsort
SELECT + col0 + - col0 + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT + + col2 + + - AVG ( DISTINCT col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col1 - - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2 HAVING + col0 IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING NOT - col0 IS NULL
----
15
91
92

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - + col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-15
-91
-92

query I rowsort
SELECT col1 - + col1 AS col2 FROM tab0 GROUP BY col1, col0, col1, col1
----
0
0
0

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL - col1 + - + col1 - + col1 FROM tab0 GROUP BY col1
----
-243
0

query I rowsort
SELECT DISTINCT + col2 + - - col2 * + col2 FROM tab2 GROUP BY col2, col2, col1
----
3422
6320
7656

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT + + col2 - col2 IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 / - col2 FROM tab0 GROUP BY col1, col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col0, col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 * + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT AVG ( DISTINCT col0 ) + + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 AS col0, col2 - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
72
91
-12
92
-34

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE NOT ( NOT NULL >= + col0 ) GROUP BY col1
----

query II rowsort
SELECT - col1, col1 * col1 + - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
1892
-57
3192
-6
30

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - + AVG ( DISTINCT col2 ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - col1 + col1 AS col0 FROM tab2 GROUP BY col1
----
0

query I rowsort
SELECT col2 * + - col0 FROM tab1 GROUP BY col2, col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col2 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1, col0
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL - col0 * + + col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT ALL col0 + col0 AS col0 FROM tab2 GROUP BY col0
----
182
184
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query II rowsort
SELECT ALL + col0, col2 * col0 FROM tab2 GROUP BY col2, col2, col0
----
15
1305
91
7189
92
5336

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1, col2, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT col0 - col0 AS col1 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
26
43
83

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query II rowsort
SELECT DISTINCT + col2 - + col0 AS col1, - col2 FROM tab1 GROUP BY col2, col0
----
-11
-71
-14
-8
17
-45

query I rowsort
SELECT - - col1 AS col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT col0 + - col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) = NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col0 + + col2 AS col2 FROM tab1 GROUP BY col0, col2
----
153
30
73

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) <> NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 + col0 AS col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT ALL col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT col2 * + + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT - - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
44
57
6

query I rowsort
SELECT col0 AS col0 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 tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col2 - - col2 + - col1 FROM tab1 GROUP BY col2, col1
----
10
33
98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col0 HAVING NOT NULL BETWEEN NULL AND + col0 - col1
----

query I rowsort
SELECT + col2 * + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT + + col2 IS NULL
----
2025
5041
64

query I rowsort
SELECT + col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 + col2 col0 FROM tab1 GROUP BY col2
----
142
16
90

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 DISTINCT col0 col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT - + col0 + - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-32
-51
46

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT - + col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col0 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col2 * + col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
357911
512
91125

query I rowsort
SELECT + + col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT - col0 AS col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + + AVG ( DISTINCT col2 ) <= + + col2
----
58
79
87

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - - col2 FROM tab1 cor0 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING NULL = - col1
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + col0 col1 FROM tab1 GROUP BY col1, col0, col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT + col2 FROM tab2 WHERE - col0 / col1 IS NULL GROUP BY col2, col2
----

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 - col0 AS col1 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT - col2 - + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-116
-158
-174

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col0 AS col1, col0 * col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
484
28
784
82
6724

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT - col0 < NULL
----

query I rowsort
SELECT + col1 * + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - + col1 + - col1 * - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT ALL + col0 + - col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 cor0 WHERE ( NULL ) IS NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col2, col1, col1
----
0
0
81

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col0 HAVING NOT - - col0 IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 WHERE NOT + col2 IS NULL GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col0 * - col0 FROM tab0 GROUP BY col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1 HAVING ( NOT ( + col2 IS NOT NULL ) )
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col1, col2 HAVING NULL < col2
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 WHERE NOT - col2 IS NOT NULL GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

query II rowsort
SELECT DISTINCT col0 AS col1, col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT + col1 * - col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1849
-676
-6889

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1107
SELECT DISTINCT col1 DIV + col1 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-1107
SELECT DISTINCT col1 / + col1 FROM tab1 GROUP BY col1
----
1

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col2 col1 FROM tab2 GROUP BY col2, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col0, + col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT - col2 * - col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col1 * col1 AS col0 FROM tab0 WHERE - col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col1 AS col2 FROM tab1 WHERE NULL <> ( NULL ) GROUP BY col2, col1
----

query II rowsort
SELECT ALL - col2 AS col1, col2 AS col2 FROM tab1 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col2, col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
22
0
28
0
82
0

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + + col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0
----
58
79
87

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT ALL - col0 * col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query II rowsort
SELECT col2 AS col2, col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 WHERE NOT col1 IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

onlyif mysql # DIV for integer division: 
query I rowsort label-1125
SELECT ALL + col1 * - col1 DIV + col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

skipif mysql # not compatible
query I rowsort label-1125
SELECT ALL + col1 * - col1 / + col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - col0 + - - col0 FROM tab2 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
24
38
79

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + col1 + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 * col1 - - col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * - + col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
-26
-43
-83

query I rowsort
SELECT - - AVG ( ALL - col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT - col1 + - col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL >= col0
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT - col1 FROM tab1 WHERE NOT NULL = - col0 GROUP BY col1, col2
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1145
SELECT col0 DIV col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1145
SELECT col0 / col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT ALL - col1 * - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL col1 + + col1 AS col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab1 GROUP BY col0, col1
----
484
6724
784

query I rowsort
SELECT ALL - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 - col0 + col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 + + col1 AS col2 FROM tab0 GROUP BY col0, col1
----
-26
-83
38

query I rowsort
SELECT + col2 * - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + col1 * - - col2 col1 FROM tab0 GROUP BY col2, col2, col1
----
1968
38
79

query I rowsort
SELECT DISTINCT - col0 + - col0 * + col0 AS col1 FROM tab2 GROUP BY col0
----
-240
-8372
-8556

query I rowsort
SELECT - + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col1 * col1 FROM tab1 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
-1936
-3249
-36

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col0, col1
----
41
59
61

query II rowsort
SELECT DISTINCT col0, col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + col1 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT - col1 * + - col1 + + col1 FROM tab2 GROUP BY col1
----
1722
3540
3782

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2 HAVING + col1 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col1 HAVING NOT ( NOT col1 IS NOT NULL )
----
-44
-57
-6

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0 HAVING NOT + col1 IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-1178
SELECT - col1 DIV col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-1178
SELECT - col1 / col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
43
5
56

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 col1, - col2 FROM tab0 AS cor0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NOT ( NULL >= + col2 ) ) )
----

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
0
81

query II rowsort
SELECT DISTINCT col0 AS col0, + col1 AS col2 FROM tab2 GROUP BY col0, col0, col1
----
15
61
91
59
92
41

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NULL IS NULL )
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 GROUP BY col0, col0, col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-1188
SELECT ALL + col0 DIV col0 - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-1188
SELECT ALL + col0 / col0 - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
23
29
83

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
126
28
85

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2, col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT col0 * + - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab1 GROUP BY col0, col2
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col1 + - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col1, col0, col1
----
-15
-91
-92

query I rowsort
SELECT + col1 * - col1 AS col2 FROM tab0 GROUP BY col2, col0, col1 HAVING + - col0 / - AVG ( ALL + col2 ) - - - AVG ( DISTINCT + col0 ) + col0 IS NULL
----

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 * col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-205379
-226981
-68921

query II rowsort
SELECT ALL - + col2, col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
-24
81
-38
0
-79
0

query I rowsort
SELECT col1 * col1 AS col0 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col2 AS col1, col2 * col2 FROM tab2 AS cor0 GROUP BY col2
----
58
3364
79
6241
87
7569

query II rowsort
SELECT - col1, + col1 FROM tab1 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT ALL - + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT col1 FROM tab0 GROUP BY col2, col1 HAVING + col1 * - - col2 IS NULL
----

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT + col0 + - col0 FROM tab1 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col2 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 + - col0 col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE - col2 * col0 IS NULL GROUP BY col1
----

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 FROM tab1 GROUP BY col1 HAVING NOT ( NOT NULL IS NULL )
----
44
57
6

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT ALL + col0 * + + col0 AS col2 FROM tab0 GROUP BY col0, col2
----
1849
676
6889

query I rowsort
SELECT - col1 * col1 * col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
-205320
-226920
-68880

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query II rowsort
SELECT DISTINCT col2, col2 + + col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
48
38
76
79
158

query II rowsort
SELECT - col2, + col2 AS col0 FROM tab2 GROUP BY col1, col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col1 + + col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING - col1 <= NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
15
91
92

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col1 - + + col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + + col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 + + col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col2 - - + col2 FROM tab0 GROUP BY col2, col0
----
158
48
76

query II rowsort
SELECT ALL col0, + col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 GROUP BY col2, col0, col2
----
24
38
79

query I rowsort
SELECT ALL - - col2 FROM tab0 cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT ( - col2 / - col0 ) IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col2, col2
----
44
57
6

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + col2 * - + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col0 + - col0 * - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 * - - col2 AS col0 FROM tab0 GROUP BY col1, col2, col0 HAVING - col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - + col1 * col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col0, col1, col0
----
41
59
61

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-1265
SELECT - - col0 DIV col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1265
SELECT - - col0 / col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT ALL - col0 + + + col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col2, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IN ( + col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING ( NULL ) IS NULL
----
22
28
82

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 DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT col1 + + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
102
115
14

query I rowsort
SELECT + AVG ( + col1 ) FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

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 col2, col1
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING ( NOT NULL IS NOT NULL )
----
0
0
81

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 GROUP BY col2 HAVING + col2 NOT BETWEEN NULL AND - col2
----
-24
-38
-79

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1284
SELECT col0 * - col0 DIV col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-1284
SELECT col0 * - col0 / col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 * + - col1 FROM tab1 GROUP BY col1, col0
----
1936
3249
36

query I rowsort
SELECT + - col1 * + col1 FROM tab1 cor0 GROUP BY col0, col1
----
-1936
-3249
-36

query I rowsort
SELECT + col1 AS col1 FROM tab0 WHERE col2 IS NULL GROUP BY col1, col1, col1
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col2, col2, col1
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col0, col1
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - + AVG ( + col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query II rowsort
SELECT col1 AS col0, + col1 FROM tab1 cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query II rowsort
SELECT ALL + col2 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col0 col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT - col0 < - AVG ( + col0 )
----
22
28
82

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 GROUP BY col1, col2, col1
----
41
59
61

query II rowsort
SELECT - col1 * - + col2 AS col1, + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
45
3124
71
48
8

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col0 + - col0 * - - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-1307
SELECT - - col1 DIV + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1307
SELECT - - col1 / + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col0, col2 FROM tab1 GROUP BY col1, col2
----
44
71
57
45
6
8

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 + + col1 FROM tab2 GROUP BY col2, col1
----
-17
-20
-26

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL - - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
118
122
82

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT AVG ( - col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT ( + + col1 ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL - col1 - col2 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
-138
-148
-99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT - col0, - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 col2, col2 AS col0 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT DISTINCT - + col2 * col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT + col1 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) = ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 WHERE NOT ( - col2 ) IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT + col2 * + col2 AS col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT - + col0 * col0 + + col0 - + col0 * + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query II rowsort
SELECT ALL col0 AS col1, - col0 * + col0 AS col0 FROM tab2 GROUP BY col0
----
15
-225
91
-8281
92
-8464

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT col2 + col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col2, col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT - + col0 * - + col0 * + - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 - - + col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 - - col2 + col2 AS col2 FROM tab0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * col2 col0 FROM tab2 cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col2, col2, col0
----
45
71
8

query I rowsort
SELECT col1 * - col1 + - col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 * + - col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT ALL 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 col0 col1 FROM tab2 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL BETWEEN + col1 AND + - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL - col0 + + col0 FROM tab1 GROUP BY col0 HAVING NOT - + col0 IS NULL
----
0
0
0

query II rowsort
SELECT DISTINCT - col2, - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-24
-38
-38
-79
-79

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query II rowsort
SELECT DISTINCT + col0, + col0 AS col1 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col0, col1 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-22
-28
-82

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 II rowsort
SELECT + col1 AS col2, - col1 AS col2 FROM tab0 AS cor0 WHERE col0 IS NOT NULL GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-118
-122
-82

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col2 * - col2 AS col2 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT AVG ( col1 ) - + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-44
-57
-6

query I rowsort
SELECT + col1 * + col2 FROM tab2 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col0, col0, col1
----
-41
-59
-61

query I rowsort
SELECT + col0 * - + col2 AS col1 FROM tab1 cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT - col0 - + + col0 - + col2 AS col0 FROM tab1 GROUP BY col2, col0
----
-101
-235
-52

query I rowsort
SELECT col2 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-44
-57
-6

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col2 col1, col2 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT + col1 AS col1 FROM tab0 cor0 WHERE ( NOT NULL <> NULL ) OR ( NULL ) > NULL GROUP BY col1, col0 HAVING NOT ( - col1 ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING + - col0 < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + 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 DISTINCT + + col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - col1 * - col1 FROM tab0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
0
0
6561

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 + - col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 * - - col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT col1 FROM tab0 WHERE NOT - col2 BETWEEN - col0 * col0 AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col2, col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab0 GROUP BY col2, col1, col2
----
0
81

query I rowsort
SELECT + + col1 - + col1 * - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 * col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT col0 * col0 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT + col2 + - + col0 AS col2 FROM tab2 GROUP BY col0, col2
----
-12
-34
72

query I rowsort
SELECT + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query II rowsort
SELECT DISTINCT - + col2 AS col0, + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT + col2 * - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col2 + + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----
105
38
79

query I rowsort
SELECT - col1 AS col0 FROM tab2 WHERE NOT - col0 IS NOT NULL GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING + col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 * - col1 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IN ( col0 )
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT col1 * - col2 + - col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IN ( + col1 )
----

query I rowsort
SELECT - col1 * + + col1 + + col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
-6480
0

query I rowsort
SELECT col1 FROM tab1 GROUP BY col0, col2, col1
----
44
57
6

query II rowsort
SELECT DISTINCT - col1 AS col1, + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT + col0 + col0 FROM tab2 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL = NULL OR NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col0, col0
----
26
43
83

query II rowsort
SELECT ALL AVG ( - - col2 ), - col2 * col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
22
28
82

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT ALL + col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + + col2 - - col0 * - col0 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) > NULL GROUP BY col0, col2, col0
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + - 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 DISTINCT - col0 col0 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT + col0 + + col0 AS col2 FROM tab2 AS cor0 WHERE + col0 + + - col1 IS NOT NULL GROUP BY col0
----
182
184
30

query I rowsort
SELECT ALL AVG ( col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( ( NOT ( NULL ) IS NOT NULL ) )
----

query I rowsort
SELECT - col0 + - - col2 FROM tab0 GROUP BY col2, col0
----
-19
-45
53

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 WHERE NULL <> NULL GROUP BY col2
----

query I rowsort
SELECT + col0 * + col0 AS col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1 HAVING NOT ( NOT + col2 NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2 HAVING - col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col2 * col2 AS col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col1 col2 FROM tab0 GROUP BY col2, col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
6561

query I rowsort
SELECT + col0 FROM tab2 WHERE NULL >= NULL GROUP BY col0 HAVING + col0 < NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

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 ALL col1 * - col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT - + col1 IS NULL
----
-1681
-3481
-3721

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT ALL + col1 * - + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col0, + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
45
71
71
8
8

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 - col0 * - - col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT DISTINCT + col0 - + col0 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - col1 + - col1 AS col2 FROM tab0 GROUP BY col1, col1
----
-162
0

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT col2 + + col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col2, col0 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + AVG ( + col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col0, col0, col1
----
-81
0
0

query I rowsort
SELECT ALL - + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT ALL col0 + col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col2, col1, col0
----
26
43
83

query I rowsort
SELECT ALL - AVG ( + col2 ) FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2 HAVING NULL BETWEEN - col2 AND + AVG ( - col0 )
----

query II rowsort
SELECT - col0 AS col1, col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1476
SELECT ALL + col1 DIV + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1476
SELECT ALL + col1 / + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT - col2 + - col1 AS col2 FROM tab2 GROUP BY col2, col1
----
-138
-148
-99

query I rowsort
SELECT DISTINCT + col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT col0 AS col0, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL + col0 + + col0 AS col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + col1 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col0, col2, col2
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-1488
SELECT ALL col2 DIV + col2 FROM tab2 GROUP BY col2, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1488
SELECT ALL col2 / + col2 FROM tab2 GROUP BY col2, col0
----
1
1
1

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col1 * - + col1 AS col0 FROM tab2 GROUP BY col1
----
1681
3481
3721

query II rowsort
SELECT DISTINCT + - col0 AS col2, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
15
-91
91
-92
92

query II rowsort
SELECT + - col0 AS col0, col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - col0 FROM tab1 cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT + col1 + col2 + + + col1 AS col1 FROM tab1 GROUP BY col1, col2
----
159
159
20

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query II rowsort
SELECT + col2 AS col2, + col2 + - + col2 * + col2 AS col0 FROM tab0 GROUP BY col2
----
24
-552
38
-1406
79
-6162

query I rowsort
SELECT col0 * + col0 FROM tab1 GROUP BY col2, col0
----
484
6724
784

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
45
71
8

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + - - col1 col0 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT + col0 * + - col0 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
3375
753571
778688

query II rowsort
SELECT AVG ( col2 ) AS col0, - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
24
-81
38
0
79
0

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0, col1 HAVING NOT AVG ( DISTINCT col1 ) NOT BETWEEN + - col1 AND NULL
----

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 - col1 + + col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col1 * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL col2 + + - col2 AS col1 FROM tab2 WHERE NOT ( + col0 * - - col0 <= - col0 * col2 + - + col1 + + col1 ) GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE col1 IS NULL GROUP BY col2
----

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 WHERE NULL < NULL GROUP BY col1, col2
----

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE col2 * - col1 > NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col0, col0, col1
----

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT + col1 * - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col1, col1, col2
----
-44
-57
-6

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING + - col1 IS NOT NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 FROM tab1 WHERE + + col2 - - col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1, col0, col0 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 WHERE NOT col0 IS NULL GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 WHERE NOT NULL = NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * col2 col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL - col1 * + col1 AS col1 FROM tab1 GROUP BY col1, col2
----
-1936
-3249
-36

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL <> + col0
----

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col2, col1 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 cor0 GROUP BY col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT - col2 - + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-153
-30
-73

query I rowsort
SELECT - col1 * + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( col1 ) IS NULL
----

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 I rowsort
SELECT ALL col1 col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL col1 * + col1 FROM tab2 GROUP BY col1, col2
----
1681
3481
3721

query I rowsort
SELECT col0 + + - col0 FROM tab0 cor0 GROUP BY col0, col0 HAVING NOT col0 IS NULL
----
0
0
0

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NULL <= NULL GROUP BY col0
----

query I rowsort
SELECT - AVG ( col1 ) FROM tab1 GROUP BY col1, col1 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - col2 FROM tab0 cor0 GROUP BY col0, col2, col2
----
-24
-38
-79

query II rowsort
SELECT DISTINCT - col0, col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL BETWEEN NULL AND - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT - + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL >= NULL )
----

query I rowsort
SELECT ALL col0 * col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col1, col0 HAVING col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT + + col1 * + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
0
0
6561

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col1, col0, col2
----
-24
-38
-79

query I rowsort
SELECT - col1 * - col1 FROM tab0 GROUP BY col1 HAVING NOT - AVG ( ALL - + col1 ) IS NULL
----
0
6561

query I rowsort
SELECT ALL - col2 / col2 - + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT + col0 IS NULL
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-1584
SELECT DISTINCT + col2 DIV col2 FROM tab0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-1584
SELECT DISTINCT + col2 / col2 FROM tab0 GROUP BY col2
----
1

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT + col1 * - col1 + + + col1 FROM tab0 AS cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <> ( NULL )
----

query II rowsort
SELECT ALL col2, col2 AS col1 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = - col0
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL col1 + col1 AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
162

query I rowsort
SELECT DISTINCT - AVG ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 WHERE + col0 IS NOT NULL 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 col2, col2, col0
----
-15
-91
-92

query I rowsort
SELECT - + col2 + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL + col1 * - col2 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
-2565
-3124
-48

query I rowsort
SELECT ALL AVG ( + col0 ) + - col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col2 * - col2 AS col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT col0 * + - col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col1 + col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
1444
6241
657

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT - col1 + col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + - col0 * - - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT - col1 * + + col1 AS col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 > NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col2 * col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
45
71
8

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2, col2, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 * + col1 + - col1 FROM tab2 GROUP BY col1
----
1640
3422
3660

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 tab2 cor0 GROUP BY col2
----
-58
-79
-87

query II rowsort
SELECT DISTINCT - - col2 AS col2, - col2 FROM tab1 AS cor0 GROUP BY col2
----
45
-45
71
-71
8
-8

query I rowsort
SELECT DISTINCT - col0 - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
41
59
61

query I rowsort
SELECT - - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col0 * + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab2 AS cor0 WHERE NOT col1 IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col1 FROM tab2 AS cor0 WHERE ( ( NOT - col2 <> - - col2 ) ) GROUP BY col0, col1
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT col2 * + col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col0, col1, col0 HAVING - col0 + col1 = + col0
----

query II rowsort
SELECT - col1 AS col2, - 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 DISTINCT col1 col2 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col0, col2 HAVING NULL IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + + - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-105
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
15
91
92

query II rowsort
SELECT + col2 AS col0, - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

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 col2 + - + col2 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 AS col1 FROM tab1 WHERE NULL > + col0 * col1 + col1 GROUP BY col0, col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + col2 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT - col1 * + col1 * - col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col1, col2, col1, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT + col1 IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col1, col1, col0
----
26
43
83

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * + - col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-1669
SELECT DISTINCT col1 DIV col1 col1 FROM tab2 GROUP BY col1, col1
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1669
SELECT DISTINCT col1 / col1 col1 FROM tab2 GROUP BY col1, col1
----
1

query I rowsort
SELECT ALL - col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING ( NULL ) < NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING col1 + - col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 GROUP BY col2 HAVING AVG ( DISTINCT col2 ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
15
91
92

query I rowsort
SELECT col1 - col0 AS col0 FROM tab2 GROUP BY col1, col0
----
-32
-51
46

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NULL > + col1
----

query I rowsort
SELECT col2 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
138
148
99

query I rowsort
SELECT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL BETWEEN - col0 AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col2 + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
0

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING - + col2 IS NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 AS col1, col0 col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2, col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT - col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL + 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 ALL col1 col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - - col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
22
28
82

query I rowsort
SELECT + col0 * + - col0 AS col2 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col0, col0 HAVING NOT + col0 IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab2 WHERE NOT NULL >= + col2 GROUP BY col1, col0 HAVING NOT - col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col1 col2 FROM tab0 cor0 GROUP BY col2, col1, col2
----
-57
38
79

query I rowsort
SELECT - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
24
38
79

query I rowsort
SELECT col2 + - col2 FROM tab2 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT + col1 AS col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE NOT NULL BETWEEN ( NULL ) AND NULL GROUP BY col2, col2
----

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + - col2 <> NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT AVG ( DISTINCT - col2 ) IS NULL
----
26
43
83

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT + + col0 * + col0 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col0, col0, col2
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) >= ( NULL )
----

query I rowsort
SELECT ALL - col2 * + col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT col0 * + col2 FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query II rowsort
SELECT - col0 AS col2, col0 - - col0 AS col2 FROM tab1 GROUP BY col0
----
-22
44
-28
56
-82
164

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * + - col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT ALL - - col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT + col2 - col2 FROM tab1 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 * col1 col2 FROM tab0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT ALL - + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + + col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query II rowsort
SELECT col0 AS col0, + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col2, col1, col1
----
0
81

query II rowsort
SELECT DISTINCT + - col0 AS col2, - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col1 HAVING NOT ( ( NULL IS NOT NULL ) )
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT col0 * - + col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

onlyif mysql # DIV for integer division: 
query I rowsort label-1742
SELECT ALL col0 DIV + - col0 + - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
-27
-44
-84

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1742
SELECT ALL col0 / + - col0 + - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
-27
-44
-84

query I rowsort
SELECT col1 + + + col0 AS col0 FROM tab1 GROUP BY col1, col0
----
126
28
85

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 IS NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT - col1 * col1 FROM tab0 GROUP BY col1, col1, col0
----
-6561
0
0

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0, col0 col0 FROM tab1 GROUP BY col0 HAVING AVG ( col0 ) IS NOT NULL
----
22
22
28
28
82
82

query I rowsort
SELECT + col0 * + - col2 / - - col0 AS col2 FROM tab0 cor0 GROUP BY col2, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 - col1 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-2025
-5041
-64

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT - col2 + + col2 FROM tab2 WHERE NOT col0 IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING NOT ( - col1 ) <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 * - col0 + col0 FROM tab1 GROUP BY col0, col0
----
506
6806
812

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab2 cor0 WHERE col1 IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 + - col0 FROM tab2 GROUP BY col0, col1
----
-133
-150
-76

query I rowsort
SELECT col0 + + + col0 FROM tab0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2, col1
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN ( NULL ) AND + col1 OR NOT NULL IS NOT NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 AS col2, - col2 col2 FROM tab2 GROUP BY col2 HAVING NOT AVG ( col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab1 WHERE NOT NULL <> NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1, col2, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col1 * col2 FROM tab1 GROUP BY col1, col2 HAVING - col1 IS NOT NULL
----
2565
3124
48

query I rowsort
SELECT DISTINCT + col0 * + - col0 AS col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + - col2 * - col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * col1 col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + - col1 + - col1 IS NOT NULL
----
1681
3481
3721

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col0, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL - col1 + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-1791
SELECT ALL + col1 DIV - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-1791
SELECT ALL + col1 / - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
0
0
0

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 - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab2 GROUP BY col1, col1 HAVING col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING + col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING AVG ( col2 ) IS NULL
----

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
41
59
61

query I rowsort
SELECT AVG ( - col0 ) FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1805
SELECT - col0 DIV + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1805
SELECT - col0 / + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-1
-1
-1

query II rowsort
SELECT + col0 AS col0, + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
0
43
81
83
0

query II rowsort
SELECT DISTINCT - col0 AS col1, - col0 FROM tab2 GROUP BY col1, col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col0, col0, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
22
28
82

query I rowsort
SELECT + col2 AS col2 FROM tab2 cor0 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
45
71
8

query II rowsort
SELECT DISTINCT + col2, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL col0 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT col0 * - col0 + col0 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 tab1 WHERE - col1 IS NOT NULL GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col2, col0
----
45
71
8

query I rowsort
SELECT col2 * + col2 AS col1 FROM tab2 GROUP BY col0, col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query II rowsort
SELECT DISTINCT col1, col1 FROM tab1 GROUP BY col1, col1
----
44
44
57
57
6
6

query I rowsort
SELECT + col0 * + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
1849
676
6889

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - - col0 * - col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
-484
-6724
-784

query II rowsort
SELECT ALL col1 AS col1, + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 + - col0 col0 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 * - col2 IS NULL
----
58
79
87

query I rowsort
SELECT - col2 * col2 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

onlyif mysql # DIV for integer division: 
query I rowsort label-1834
SELECT ALL + col1 DIV - col1 + - col1 AS col2 FROM tab2 GROUP BY col1
----
-42
-60
-62

skipif mysql # not compatible
query I rowsort label-1834
SELECT ALL + col1 / - col1 + - col1 AS col2 FROM tab2 GROUP BY col1
----
-42
-60
-62

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE + + col1 NOT IN ( + col2 ) GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 * + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
41
59
61

query I rowsort
SELECT + + col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 FROM tab2 cor0 WHERE col0 IS NULL GROUP BY col2, col0 HAVING NOT - col0 < ( NULL )
----

query I rowsort
SELECT ALL - col0 / - + col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT + col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col2 AS col1 FROM tab2 WHERE - + col1 IS NOT NULL GROUP BY col2 HAVING ( NULL ) <> col1
----

query II rowsort
SELECT col0 AS col1, col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
15
15
91
91
92
92

query I rowsort
SELECT + col2 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
114
12
88

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1852
SELECT + - col2 DIV col0 + - col0 * col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-1261
-176
-5822

skipif mysql # not compatible
query I rowsort label-1852
SELECT + - col2 / col0 + - col0 * col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-1261
-176
-5822

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL col1 - + col1 FROM tab1 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT col1 IS NULL
----
0
0
81

query I rowsort
SELECT col2 * + col2 AS col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL - col1 - - - col0 FROM tab1 GROUP BY col0, col1, col1
----
-126
-28
-85

query I rowsort
SELECT + col0 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query II rowsort
SELECT + col1, col1 - - + col1 + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
243

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL < - + col1
----

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col1, col2, col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-1864
SELECT DISTINCT col1 DIV - col1 FROM tab1 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-1864
SELECT DISTINCT col1 / - col1 FROM tab1 GROUP BY col1
----
-1

query II rowsort
SELECT ALL - col0, col0 AS col0 FROM tab1 GROUP BY col1, col0
----
-22
22
-28
28
-82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL - col2, col0 FROM tab1 cor0 GROUP BY col2, col0
----
-45
28
-71
82
-8
22

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT col2 - - col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
116
158
174

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( col2 ) IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) <= ( NULL )
----

query I rowsort
SELECT + col1 * + col0 * - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * - col0 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NULL
----
506
6806
812

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL >= - - col1 * + - col0 - - + col0
----

query I rowsort
SELECT col2 * + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + - AVG ( - col0 ) FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
15
91
92

query II rowsort
SELECT ALL + col0, col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-1888
SELECT DISTINCT col0 DIV - - col0 AS col1 FROM tab1 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-1888
SELECT DISTINCT col0 / - - col0 AS col1 FROM tab1 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

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 ALL col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * col1 col2 FROM tab1 GROUP BY col1, col0
----
132
1596
3608

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 WHERE NOT NULL = + col2 GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 - col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col2, col0
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-1898
SELECT - col1 DIV + col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1898
SELECT - col1 / + col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

query II rowsort
SELECT ALL + col0, col0 AS col2 FROM tab1 cor0 GROUP BY col2, col0, col0
----
22
22
28
28
82
82

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NULL = ( NULL )
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 * col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
26
43
83

query I rowsort
SELECT col1 + col1 AS col0 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col1 / col2 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col2 + + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
105
38
79

query I rowsort
SELECT ALL + - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT ALL col1 * col2 FROM tab2 GROUP BY col2, col1
----
2378
4661
5307

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab2 WHERE NOT + col2 IS NOT NULL GROUP BY col2 HAVING col2 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + col0 * + col0 * - col0, col0 FROM tab0 AS cor0 WHERE NULL = ( NULL ) GROUP BY col0, col0, col0
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL + col2 * + - col0 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - col2 * - col0 FROM tab1 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query II rowsort
SELECT col2 AS col2, col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE col1 <= col1 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT ( NOT NULL NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT ALL - - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-484
-6724
-784

onlyif mysql # DIV for integer division: 
query I rowsort label-1928
SELECT col1 DIV + col1 FROM tab2 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1928
SELECT col1 / + col1 FROM tab2 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT + + col1 IS NULL
----
44
57
6

query I rowsort
SELECT - col0 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT + col2 AS col1 FROM tab2 cor0 WHERE col0 + - col0 <= NULL GROUP BY col1, col2, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 cor0 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 col0 / + + col0 + - col1 col2 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
41
59
61

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT ALL col1 + col1 * - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-3731
-5310
-854

query I rowsort
SELECT ALL col0 * col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col0 * - + col0 FROM tab1 GROUP BY col0, col0
----
-484
-6724
-784

query I rowsort
SELECT col0 AS col0 FROM tab1 WHERE + col1 IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING - AVG ( DISTINCT + col0 ) IS NULL
----

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
-15
-91
-92

query II rowsort
SELECT ALL col1, - col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-6561

query I rowsort
SELECT col1 * + col1 + + col1 + + col1 FROM tab0 GROUP BY col1
----
0
6723

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col2 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING ( NULL IS NULL )
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query II rowsort
SELECT + col0, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1, col0 HAVING ( NULL ) IS NULL
----
22
28
82

query II rowsort
SELECT DISTINCT - col1 + - col2 AS col2, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-105
-81
-38
0
-79
0

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 * + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT col1 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - + col0 + + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
0

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 * col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-3772
-5369
-915

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col2 + - + col2 AS col2 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) < ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1970
SELECT col1 DIV + col1 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1970
SELECT col1 / + col1 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NOT col1 IS NULL
----
44
57
6

query I rowsort
SELECT - col0 FROM tab1 WHERE + - col0 IS NOT NULL GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 / + + col0 FROM tab1 WHERE ( NULL IS NOT NULL ) GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT + col2 + col2 FROM tab0 GROUP BY col1, col1, col2
----
158
48
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT - col1 IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * - col2 - + - col2 AS col0 FROM tab1 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL = NULL
----

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, col0 FROM tab2 GROUP BY col0, col2, col1
----
41
92
59
91
61
15

query I rowsort
SELECT DISTINCT + col2 - + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
0

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * col1 + + col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col1 < NULL
----

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + col0 * - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING AVG ( ALL - col1 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 - - + col2 AS col0 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL AVG ( DISTINCT + + col0 ) * - col0 FROM tab0 GROUP BY col0 HAVING + - col0 IS NULL
----

query II rowsort
SELECT - col0, col2 FROM tab1 GROUP BY col2, col0, col0
----
-22
8
-28
45
-82
71

query II rowsort
SELECT ALL - + col1, + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT DISTINCT + + col0 * col0 + - + col0 * + col0 FROM tab0 cor0 GROUP BY col0
----
0

query I rowsort
SELECT + col0 AS col0 FROM tab1 WHERE NULL NOT BETWEEN col2 AND ( NULL ) GROUP BY col0 HAVING NOT col0 / - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col0 HAVING AVG ( ALL col2 ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL - col2 + col2 FROM tab2 GROUP BY col2, col0 HAVING ( + col0 ) NOT BETWEEN + col0 AND ( NULL )
----

query I rowsort
SELECT col1 + + col1 AS col2 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT - - col1 * + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT + col0 * + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL = col1 / + + col1
----

query II rowsort
SELECT col0, - col0 FROM tab1 GROUP BY col1, col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2 HAVING NOT + col2 >= ( NULL )
----

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( + - col1 ) > + col1
----

query I rowsort
SELECT - - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT - - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col0 * + col0 FROM tab1 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col2 < NULL
----

query I rowsort
SELECT col2 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT + - col2 * - - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-2378
-4661
-5307

query I rowsort
SELECT col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col0, + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col0, - col0 FROM tab2 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT ALL col2 FROM tab1 WHERE NULL <> col0 AND ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-22
-28
-82

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 / - + col0 FROM tab1 cor0 GROUP BY col0, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 - + col2 + col2 * col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - col1 AS col2 FROM tab1 cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 * + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
-41
-59
-61

query II rowsort
SELECT ALL col0, col0 AS col2 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT + col1 * + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
1944

query I rowsort
SELECT ALL + col0 + + col0 FROM tab2 GROUP BY col2, col0
----
182
184
30

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT + col1 * + col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT + col0 FROM tab0 WHERE NOT + col1 * - col2 IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col2, col1
----
-81
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2046
SELECT - col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2046
SELECT - col0 / col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col2 * - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT + col1 - + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT + col0 FROM tab1 WHERE NOT NULL = ( + col1 ) GROUP BY col0
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT ( ( NULL ) BETWEEN ( NULL ) AND + col2 )
----

query I rowsort
SELECT ALL + - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col0 * col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
41
59
61

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 + + - col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col2 + col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL AVG ( + col1 ) FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - - col0 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 DISTINCT col0 * col0 col0 FROM tab0 GROUP BY col0
----
1849
676
6889

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( ( NOT NULL <> + col1 ) )
----

query I rowsort
SELECT ALL + col0 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
182
184
30

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - AVG ( + + col2 ) FROM tab1 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL - - col1 * - + col1 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
531441

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT col2 * col2 * + + col2 FROM tab0 GROUP BY col2, col2, col1 HAVING NULL IS NULL
----
13824
493039
54872

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col2, col2, 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 - col0 FROM tab0 cor0 GROUP BY col2, col0 HAVING col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL = + col2
----

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 DISTINCT + col0 col0 FROM tab2 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 + - AVG ( - col0 ) AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 * + col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL + + col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - col2 - + col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL >= - col0
----

query I rowsort
SELECT col0 AS col0 FROM tab1 cor0 WHERE NOT NULL <= ( NULL ) GROUP BY col0
----

query I rowsort
SELECT col1 + - col0 FROM tab0 GROUP BY col0, col1
----
-26
-83
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT col2 * - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col1 FROM tab0 cor0 GROUP BY col1, col2
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT + col2 + - AVG ( ALL - + col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1, col1
----
-41
-59
-61

query I rowsort
SELECT + col0 * col0 FROM tab2 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col2, col0
----
-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 col1 col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col2, col0 HAVING NOT + + col0 / col2 IS NOT NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
45
71
8

query I rowsort
SELECT - col2 * + col2 + - + col2 AS col2 FROM tab1 GROUP BY col2, col2, col1
----
-2070
-5112
-72

query I rowsort
SELECT + col0 + col0 FROM tab2 cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT DISTINCT - col2 + - - col2 AS col2 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT ALL - + col0 * col0 + + - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-240
-8372
-8556

query I rowsort
SELECT ALL col1 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 + + + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
273
276
45

query I rowsort
SELECT DISTINCT col1 * col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
22
28
82

query I rowsort
SELECT - col2 * - col2 FROM tab1 GROUP BY col1, col2
----
2025
5041
64

query I rowsort
SELECT col1 AS col1 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - AVG ( col0 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT col1 * - col1 * col1 FROM tab0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT - col0 * + col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 - + col2 * - col2 col0 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) NOT IN ( col0 )
----

query II rowsort
SELECT DISTINCT col1, col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT - AVG ( ALL col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL <> + AVG ( ALL + + col0 ) / col0
----

query I rowsort
SELECT + col1 * col1 AS col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL - + col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
-484
-6724
-784

query I rowsort
SELECT col1 + - + col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col2, col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 GROUP BY col2 HAVING col1 = NULL
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col1 AS col0, + col1 AS col2 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab1 GROUP BY col0, col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col0 FROM tab0 WHERE ( + col0 ) <= ( NULL ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + - col2 AS col1 FROM tab1 WHERE NOT - col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col1 * - col1 AS col2 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 + - col0 col1 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT + col2 + - col2 - + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-2156
SELECT DISTINCT col0 DIV + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1

skipif mysql # not compatible
query I rowsort label-2156
SELECT DISTINCT col0 / + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1

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 + col1 FROM tab2 AS cor0 WHERE NOT - col0 / col1 = NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 WHERE NOT col0 NOT BETWEEN - col2 + col0 AND NULL GROUP BY col2
----

query II rowsort
SELECT ALL - col0, - col0 FROM tab1 cor0 GROUP BY col1, col0
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL - col0 * + - col2 FROM tab2 GROUP BY col2, col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL col2 + col1 FROM tab0 GROUP BY col2, col1
----
105
38
79

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 WHERE NOT ( NOT NULL > NULL ) GROUP BY col1, col2
----

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT col1 * - + col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col2 * + + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL >= AVG ( ALL + + col0 )
----

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING ( NOT NULL NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT + col2 * - + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 - + col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 + - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT - + col2 AS col0 FROM tab2 cor0 GROUP BY col1, col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + + col2 * col2 + + - col2 AS col1 FROM tab2 cor0 GROUP BY col2, col2 HAVING NOT NULL = col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-81
0
0

query I rowsort
SELECT ALL AVG ( ALL - col2 ) FROM tab1 WHERE ( col1 ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 WHERE NOT col1 - - col2 <> NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL <> - col0
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query II rowsort
SELECT col2, - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING col2 IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0 HAVING - AVG ( + - col2 ) IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 WHERE col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 * + col0 * + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
13725
347024
488579

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT + col1 IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col2, col0, col1
----
-44
-57
-6

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
-22
-28
-82

query I rowsort
SELECT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL + AVG ( - + col1 ) AS col0 FROM tab0 WHERE NOT NULL BETWEEN + col1 * - - col1 + col2 AND + + col0 * - col1 * + col2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT ALL + col0 / + AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING ( NULL ) <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL col0 + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col1 - + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab2 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col0 + col1 AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NOT - + col1 IS NOT NULL
----

query I rowsort
SELECT - col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING - col1 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-2221
SELECT + col0 DIV col0 FROM tab0 GROUP BY col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2221
SELECT + col0 / col0 FROM tab0 GROUP BY col0, col1
----
1
1
1

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING - col0 <> NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NOT col0 BETWEEN NULL AND NULL )
----

query I rowsort
SELECT col0 * + col0 FROM tab2 GROUP BY col0, col2, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL <= NULL
----

query I rowsort
SELECT + col0 - - col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab2 AS cor0 WHERE col1 < NULL GROUP BY col2 HAVING NULL > - col0
----

query I rowsort
SELECT col0 - + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 + col1 AS col0 FROM tab1 GROUP BY col1
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + - col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col0 FROM tab1 WHERE - + col1 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
1681
3481
3721

query I rowsort
SELECT + col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
26
43
83

query II rowsort
SELECT DISTINCT col1, - col1 FROM tab2 GROUP BY col1
----
41
-41
59
-59
61
-61

query II rowsort
SELECT - col0 AS col0, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query II rowsort
SELECT + col0, col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
61
91
59
92
41

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 cor0 GROUP BY col0, col1, col2
----
15
91
92

query I rowsort
SELECT - col1 + - col1 / + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + col1 <> NULL
----

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 * col2 * col2 FROM tab2 cor0 GROUP BY col2, col2
----
195112
493039
658503

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT ALL + col2 * - + col0 * + - col2 AS col2 FROM tab1 GROUP BY col0, col2
----
1408
413362
56700

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0 HAVING + - col2 - - - col0 + col0 IS NULL
----

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT + + col0 = NULL
----

query I rowsort
SELECT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-58
-79
-87

onlyif mysql # DIV for integer division: 
query I rowsort label-2263
SELECT + col2 DIV - + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2263
SELECT + col2 / - + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-1
-1
-1

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT col1 + - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT + col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col2 * - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col2 * col2 * - - col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----
13824
493039
54872

query I rowsort
SELECT + + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING ( col2 ) <> col2
----

query I rowsort
SELECT DISTINCT - + col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 WHERE NOT - col1 IS NULL GROUP BY col0, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col0, col1, col1 HAVING NOT NULL BETWEEN - col1 AND NULL
----

query I rowsort
SELECT - col0 * - col2 FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col2 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING col1 IS NOT NULL
----
44
57
6

query II rowsort
SELECT ALL + - col2, + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL + col1 * col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + col1 AS col1, col1 AS col2 FROM tab1 GROUP BY col1 HAVING ( NULL ) = col2
----

query I rowsort
SELECT DISTINCT - + col2 * - col2 + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
-26
-43
-83

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1, col0 HAVING ( - col1 ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL < ( NULL )
----

query I rowsort
SELECT + col0 * - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col1 * col2 FROM tab0 AS cor0 WHERE NOT NULL IN ( col2 / + col2 ) GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL AVG ( ALL + col1 ) FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT + col2 + + col0 FROM tab2 GROUP BY col0, col2 HAVING + col2 + + col0 IS NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 WHERE ( NULL ) NOT BETWEEN NULL AND NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 + - + col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
0
81

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query II rowsort
SELECT + col2 AS col2, col2 FROM tab1 cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
44
57
6

query I rowsort
SELECT col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT col2 * + - col2 FROM tab1 GROUP BY col2, col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT col2 * col2 AS col0 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL col1 * col1 AS col0 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT col2 FROM tab1 WHERE + col1 IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query II rowsort
SELECT - col0 - - col1, + col0 * + col0 AS col1 FROM tab2 GROUP BY col1, col0
----
-32
8281
-51
8464
46
225

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 WHERE - - col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT + col1 * - - col1 AS col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL - col0 + - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-182
-184
-30

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col0 * - - col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + + col1 col2 FROM tab1 GROUP BY col1
----
114
12
88

query II rowsort
SELECT - col1 AS col2, - col1 * col1 * + - col1 FROM tab1 GROUP BY col1, col1
----
-44
85184
-57
185193
-6
216

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col0 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
1032
2054
3154

onlyif mysql # DIV for integer division: 
query I rowsort label-2344
SELECT + col0 DIV col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-2344
SELECT + col0 / col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

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 + - col2 + col2 * col2 FROM tab0 cor0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 GROUP BY col0, col0, col1
----
15
91
92

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col2 * + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col1, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT col2 + + + col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2, col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-2357
SELECT ALL + col2 DIV col2 + + + col2 FROM tab0 GROUP BY col2
----
25
39
80

skipif mysql # not compatible
query I rowsort label-2357
SELECT ALL + col2 / col2 + + + col2 FROM tab0 GROUP BY col2
----
25
39
80

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 + - col0 AS col2 FROM tab1 GROUP BY col0
----
-164
-44
-56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT ( ( NULL ) IS NULL )
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL - + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL - + AVG ( ALL - col1 ) FROM tab1 AS cor0 GROUP BY col1, col0 HAVING col0 IS NULL
----

query II rowsort
SELECT ALL col2 * col2 AS col0, col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
2025
28
5041
82
64
22

query I rowsort
SELECT + col1 * - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING NOT - col0 IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col1 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col0, col2, col2, col0
----
24
38
79

query I rowsort
SELECT col0 / + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL BETWEEN - col1 AND NULL
----

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT col2 + - - col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING ( NOT - col2 IS NULL )
----
45
71
8

query I rowsort
SELECT + AVG ( + col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col2
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
-26
-43
-83

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 - col1 FROM tab0 GROUP BY col1, col1, col0
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * - + col0 col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - col2 AS col1, col2 + col2 AS col1 FROM tab1 GROUP BY col2
----
-45
90
-71
142
-8
16

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL = NULL GROUP BY col0, col2
----

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0 HAVING + col0 <= + + col0
----
22
28
82

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2, col2
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2 HAVING - col2 IS NULL
----

query II rowsort
SELECT - col0 AS col1, - col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT - + col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING - col0 = NULL
----

query I rowsort
SELECT ALL + col1 * + col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88

query I rowsort
SELECT ALL col2 * - col2 AS col1 FROM tab1 GROUP BY col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT - col0 * col0 * - - col0 AS col1 FROM tab2 GROUP BY col0
----
-3375
-753571
-778688

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - + col1 IS NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col1, col1, col0
----
15
91
92

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col1 * + - col1 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NOT NULL = col2 - col0 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT + col1 * + col0 IS NOT NULL
----

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL IS NOT NULL ) GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT + - col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col2 + + - col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0, col2
----
-158
-48
-76

query I rowsort
SELECT ALL - col1 * + - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
1681
3481
3721

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT col1 * - col1 AS col0 FROM tab2 GROUP BY col1, col2
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + col1 * + col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT ALL col0 + + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col0 + + - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 * + col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 + - + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-2439
SELECT + - col2 DIV + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2439
SELECT + - col2 / + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL AVG ( ALL - col0 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL BETWEEN col1 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col0 - - col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT col1 + - - col0 AS col0 FROM tab2 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT col2 + col2 FROM tab1 GROUP BY col2 HAVING col2 IS NOT NULL
----
142
16
90

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 / + AVG ( ALL col1 ) * + col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query II rowsort
SELECT DISTINCT - + col1, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT DISTINCT col0 + col0 AS col2 FROM tab2 GROUP BY col0
----
182
184
30

query II rowsort
SELECT col2, col2 * + col2 FROM tab2 GROUP BY col2
----
58
3364
79
6241
87
7569

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT - - col2 * + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col1 * - + col2 AS col2 FROM tab1 GROUP BY col2, col2, col1
----
-2565
-3124
-48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col1 FROM tab1 cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 FROM tab0 cor0 GROUP BY col2, col1, col2
----
-81
0

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 WHERE NULL < NULL GROUP BY col0
----

query I rowsort
SELECT col0 + col0 FROM tab1 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - AVG ( - col1 ) col0 FROM tab2 cor0 GROUP BY col1 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 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 HAVING NOT ( AVG ( - col0 ) ) IS NULL
----
22
28
82

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 ALL + col1 * + col1 * + col1 AS col1 FROM tab0 GROUP BY col1, col1
----
0
531441

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING - - col2 / col2 IS NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1, col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-2482
SELECT - col1 DIV col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2482
SELECT - col1 / col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT col1 * + col2 FROM tab1 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT ALL - col0 * col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col2 + + col0 FROM tab2 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - - col2 * col2 * - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-357911
-512
-91125

query I rowsort
SELECT DISTINCT + col2 * - - col0 AS col0 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT ALL - col0 * + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
3375
753571
778688

query II rowsort
SELECT ALL col0, - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 col2, col2 col1 FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * + col0 + col0 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-462
-6642
-756

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col2 / col2 + + AVG ( - col2 ) FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col2, - col2 FROM tab2 GROUP BY col1, col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT - col2 + col2 AS col1 FROM tab2 GROUP BY col2
----
0
0
0

query II rowsort
SELECT col2 AS col2, - col2 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + + col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL AVG ( ALL + + col1 ) FROM tab1 AS cor0 WHERE NULL <= + col1 + - col0 GROUP BY col1
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-2509
SELECT col2 DIV - col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-2509
SELECT col2 / - col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
-1
0
0

query I rowsort
SELECT col1 + col1 + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
0
243

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col2 HAVING col2 IS NULL
----

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab1 GROUP BY col1, col0
----
164
44
56

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
41
59
61

query I rowsort
SELECT + AVG ( DISTINCT + col2 ) / + - col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN NULL AND + - col2
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NOT NULL NOT BETWEEN - AVG ( DISTINCT + col1 ) AND col2 )
----

query II rowsort
SELECT - + col2, col2 FROM tab1 cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT col2 - + col2 + col2 FROM tab1 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 + + - col2 - - col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0 HAVING col2 IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT col0 * + col0 AS col0 FROM tab1 GROUP BY col0, col1
----
484
6724
784

onlyif mysql # DIV for integer division: 
query I rowsort label-2525
SELECT ALL + col0 DIV + col1 AS col1 FROM tab2 GROUP BY col1, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-2525
SELECT ALL + col0 / + col1 AS col1 FROM tab2 GROUP BY col1, col0
----
0
1
2

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0, col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT AVG ( ALL + - col0 ) FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT - col0 + + col0 AS col1 FROM tab2 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col0 + - col0 * col0 FROM tab2 GROUP BY col0
----
-210
-8190
-8372

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab2 WHERE NOT + col1 IS NOT NULL GROUP BY col2 HAVING NOT ( NOT NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 cor0 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT col0 * - col1 FROM tab0 GROUP BY col1, col0
----
-3483
0
0

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2, col1 HAVING - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col2 + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
-44
-57
-6

query II rowsort
SELECT col2, + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT AVG ( DISTINCT col0 ) FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - AVG ( + col0 ) AS col2 FROM tab2 WHERE NOT NULL < col1 GROUP BY col0
----

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col1, col2, col1
----
58
79
87

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col2 * col0 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 * col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-1936
-3249
-36

query II rowsort
SELECT DISTINCT + - col2 - + col2, + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
-142
71
-16
8
-90
45

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col2, col0, col0
----
-15
-91
-92

query II rowsort
SELECT ALL - col2 AS col0, + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col2, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - + col1 * col0 - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - col1 IS NULL
----
-138
-1653
-3652

query I rowsort
SELECT - col1 FROM tab1 WHERE + col1 IS NOT NULL GROUP BY col1, col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-2577
SELECT ALL col2 DIV + col2 AS col0 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2577
SELECT ALL col2 / + col2 AS col0 FROM tab0 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 * + - col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query II rowsort
SELECT ALL AVG ( + + col0 ), + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col2 + col0 AS col1 FROM tab2 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT col1 * col1 AS col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col1 + - AVG ( ALL col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NOT 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

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + + col0 IS NULL
----
15
91
92

query I rowsort
SELECT ALL + + col1 FROM tab2 AS cor0 WHERE col2 <= NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL col0 - + col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col0 FROM tab2 WHERE - col1 IS NOT NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 WHERE NULL NOT IN ( + col2 ) GROUP BY col1, col2
----

query I rowsort
SELECT col2 + - col0 AS col1 FROM tab1 GROUP BY col0, col2
----
-11
-14
17

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col2, col0
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 - col0 col1 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col2 * + col0 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col2, col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col0, col0, col1 HAVING + - col1 IS NOT NULL
----
44
57
6

query I rowsort
SELECT + col1 + - col1 + + col1 AS col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 + col1 FROM tab0 GROUP BY col1, col1
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col0 col1 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 WHERE col2 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT - AVG ( col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-2620
SELECT col2 * col1 DIV + + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

skipif mysql # not compatible
query I rowsort label-2620
SELECT col2 * col1 / + + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2, col2, 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 - - col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query II rowsort
SELECT + col0, - col0 - - col0 FROM tab0 GROUP BY col0
----
26
0
43
0
83
0

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + + col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1, - col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
0
81
-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 - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - - col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - col0 - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-166
-52
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + + col0 col2 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + AVG ( - col1 ) * + col1 col2 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col2, col0, col1 HAVING NULL IS NULL
----
-81
0
0

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 WHERE NOT ( NOT ( + col1 ) IS NOT NULL ) GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL col1 - + - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
118
122
82

query II rowsort
SELECT ALL col0 * + col0 AS col1, + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1849
24
676
79
6889
38

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1, col0, col0
----
-81
0
0

query II rowsort
SELECT + - col1, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
41
-59
59
-61
61

query II rowsort
SELECT ALL + col1 * + col1, - col1 AS col2 FROM tab1 GROUP BY col1
----
1936
-44
3249
-57
36
-6

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col1, col2
----

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 * + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
225
8281
8464

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
15
91
92

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col2 - - col2 FROM tab0 cor0 GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( col1 ) IS NULL
----

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 - + col1 * - col1 + col1 col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
1980
3306
42

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + + col1 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT col2 - - + col0 + + - col2 AS col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL >= col1
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

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 I rowsort
SELECT DISTINCT - + col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT + col2 * - - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
1444
576
6241

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL < - - col1
----

query II rowsort
SELECT DISTINCT col2 AS col2, - col2 FROM tab2 GROUP BY col2, col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NOT - col2 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 GROUP BY col0, col1, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT col0 + + - col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col0, col2 HAVING NOT col0 <> NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + + col1 NOT IN ( - col1 + col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT col0 + col0 AS col2 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1 HAVING NULL < ( NULL )
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT - col2 * + col2 * - + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
1408
413362
56700

query I rowsort
SELECT + col0 * - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

onlyif mysql # DIV for integer division: 
query I rowsort label-2695
SELECT ALL - col0 DIV col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2695
SELECT ALL - col0 / col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + + col0 * - - col0 FROM tab0 cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL >= - col0
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - AVG ( ALL + col0 ) FROM tab2 AS cor0 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 tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT col1 * + col2 IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT col1 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col1 + col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1, col1, col2, col2
----
0
0
81

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING NOT + col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query II rowsort
SELECT + col0 + - col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
0
22
0
28
0
82

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 cor0 GROUP BY col2, col1
----
-45
-71
-8

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 - col1 col2 FROM tab1 WHERE ( NOT NULL IS NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 GROUP BY col2, col1, col1 HAVING + AVG ( col1 ) IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col0 + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-19
-45
53

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col0 * - - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col0 * col0 * + col0 FROM tab2 GROUP BY col0
----
3375
753571
778688

query I rowsort
SELECT DISTINCT + col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT col1 * - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1936
-3249
-36

query I rowsort
SELECT ALL col1 * + col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
44
57
6

query I rowsort
SELECT - col2 * - - AVG ( ALL - col2 ) AS col1 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2740
SELECT ALL + col2 DIV - col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2740
SELECT ALL + col2 / - col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL + col1 * - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-1936
-3249
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - col2 col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
45
71
8

query I rowsort
SELECT - col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col1 + - col1 FROM tab2 cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL - col1 + - + col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 WHERE NOT col1 IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2755
SELECT + col2 DIV + col2 + + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
25
39
80

skipif mysql # not compatible
query I rowsort label-2755
SELECT + col2 / + col2 + + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
25
39
80

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING - col0 <= NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col2 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col1 - + col1 AS col2 FROM tab1 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query II rowsort
SELECT DISTINCT - col2 AS col2, - col2 * - col2 + - col2 - + col2 FROM tab0 GROUP BY col2
----
-24
528
-38
1368
-79
6083

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 I rowsort
SELECT col2 * + col2 + - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
1980
4970
56

query I rowsort
SELECT col2 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col2, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - - col1 + col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
243

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 + + col1 FROM tab0 GROUP BY col1, col0
----
0
0
162

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
58
79
87

query II rowsort
SELECT col2 AS col1, + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT col2 * - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-2775
SELECT DISTINCT col0 DIV col0 + - col0 FROM tab0 cor0 GROUP BY col0
----
-25
-42
-82

skipif mysql # not compatible
query I rowsort label-2775
SELECT DISTINCT col0 / col0 + - col0 FROM tab0 cor0 GROUP BY col0
----
-25
-42
-82

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT + AVG ( col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - + col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT + col2 * + col2 AS col1 FROM tab0 GROUP BY col2, col0
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col2 + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + col1 * + col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-2789
SELECT + + col1 DIV - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2789
SELECT + + col1 / - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col2, col0 HAVING + col2 * - + AVG ( DISTINCT + col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT + AVG ( + col2 ) + - col2 FROM tab0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT + col0 + + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE + col1 IS NOT NULL GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 WHERE ( NULL ) < NULL GROUP BY col1
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - col2 + - + col2 + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT + col2 <= NULL )
----

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL IS NOT NULL )
----
45
71
8

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0, col1
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 WHERE NOT - col0 IS NOT NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab1 GROUP BY col1, col1, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 WHERE NOT NULL <> col2 GROUP BY col2, col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * + + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col1, col2
----
22
28
82

query I rowsort
SELECT - col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL + col1 * col1 FROM tab0 GROUP BY col2, col1, col2, col1
----
0
0
6561

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 WHERE ( - col0 ) IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + col0 + - col2 AS col0 FROM tab2 GROUP BY col2, col2, col0 HAVING NULL < col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

query I rowsort
SELECT ALL col1 * - - col1 FROM tab2 GROUP BY col1, col1 HAVING - AVG ( ALL - col1 ) IS NULL
----

query II rowsort
SELECT - col0, col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT col0 + + + col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab0 GROUP BY col0 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col0 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT col1 FROM tab1 GROUP BY col2, col1 HAVING NOT - col2 + col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL < ( - col0 )
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT + col2 - - col2 FROM tab2 cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + AVG ( col0 ) col1 FROM tab0 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT col2 + + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 * + - col1 * + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-185193
-216
-85184

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT col2 + - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL col1 + - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col1 * + + col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT ALL + col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col1 * - - col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL < + - col0
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col1 AS col0, col2 FROM tab0 GROUP BY col2, col1
----
-81
24
0
38
0
79

query I rowsort
SELECT DISTINCT + - col2 - - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 cor0 WHERE col2 IS NOT NULL GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NOT NULL IS NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 + - - col0 col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT + + col0 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * col0 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT - + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT col1 + - col1 - - col1 FROM tab2 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

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 DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2, col1 HAVING NOT + - col2 IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
44
57
6

query I rowsort
SELECT - col1 - + col2 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT + - 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 - - col0 col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col2 * col2 AS col2 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col2 HAVING NOT col1 IS NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-2873
SELECT DISTINCT - col2 DIV col2 col0 FROM tab0 GROUP BY col2, col0
----
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2873
SELECT DISTINCT - col2 / col2 col0 FROM tab0 GROUP BY col2, col0
----
-1

query I rowsort
SELECT col1 + + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0

query I rowsort
SELECT col2 * + col0 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT DISTINCT + col2 + + col2 * - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-1406
-552
-6162

query I rowsort
SELECT DISTINCT - col1 + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col1 * - col1 AS col0 FROM tab0 WHERE ( NULL IS NULL ) GROUP BY col2, col1, col2
----
-6561
0

query I rowsort
SELECT col2 + + col2 * col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
2070
5112
72

query I rowsort
SELECT ALL - col0 * - col0 AS col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2 HAVING + + col1 + + col1 IS NOT NULL
----
41
59
61

query II rowsort
SELECT DISTINCT - col0 + + - col0, + col0 FROM tab1 cor0 GROUP BY col1, col0
----
-164
82
-44
22
-56
28

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 * + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-2378
-4661
-5307

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
22
28
82

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - col2 + - col2 AS col0 FROM tab2 GROUP BY col2, col2, col2
----
-116
-158
-174

query I rowsort
SELECT DISTINCT - col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE + col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab2 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col2, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-2903
SELECT ALL + col1 DIV col2 FROM tab0 GROUP BY col2, col1
----
0
0
3

skipif mysql # not compatible
query I rowsort label-2903
SELECT ALL + col1 / col2 FROM tab0 GROUP BY col2, col1
----
0
0
3

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 + + col0 + + - col0 FROM tab0 cor0 GROUP BY col0 HAVING col0 IS NULL
----

query I rowsort
SELECT + AVG ( ALL + + col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL <> NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-2907
SELECT + col1 DIV + col0 AS col0, col1 DIV - col0 AS col0 FROM tab1 GROUP BY col1, col0
----
0
0
0
0
2
-2

skipif mysql # not compatible
query II rowsort label-2907
SELECT + col1 / + col0 AS col0, col1 / - col0 AS col0 FROM tab1 GROUP BY col1, col0
----
0
0
0
0
2
-2

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING col0 IS NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

query II rowsort
SELECT DISTINCT col0, + col0 FROM tab1 GROUP BY col0, col0
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 WHERE + col0 <> + col2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1, col0 HAVING NOT - col0 IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + AVG ( DISTINCT + - col2 ) AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - - col2 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 * - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT - col2 - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-142
-16
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT col2 + - col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col0 * + col0 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
492
6795
829

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT + col2 + col0 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
105
121
67

query I rowsort
SELECT DISTINCT - col2 * + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

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 ALL - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 + + + col0 * - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 GROUP BY col1, col0
----
41
59
61

query II rowsort
SELECT + col2 AS col2, col2 AS col0 FROM tab1 GROUP BY col1, col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 AS col0, AVG ( ALL + col2 ) col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 - - col0 * col0 col0 FROM tab2 GROUP BY col0, col0
----
240
8372
8556

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 + + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-38
-79
57

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 WHERE + col1 + + - col1 > NULL GROUP BY col0, col1
----

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 ALL - col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) <> NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query II rowsort
SELECT + col2, col2 FROM tab0 GROUP BY col1, col1, col2
----
24
24
38
38
79
79

query I rowsort
SELECT - col0 - + col0 AS col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

query II rowsort
SELECT DISTINCT col2 AS col2, + col2 + + col2 FROM tab0 cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
48
38
76
79
158

query I rowsort
SELECT DISTINCT col2 * + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col2 HAVING ( NULL ) >= ( NULL )
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT AVG ( ALL - col0 ) <= NULL
----

query I rowsort
SELECT ALL + col1 + - + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 AS col0, col2 col2 FROM tab2 cor0 GROUP BY col0, col2
----
15
87
91
79
92
58

query I rowsort
SELECT ALL + col1 + - col1 - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - - col2 + + col2 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query II rowsort
SELECT + col2, + col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT - col1 * - - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT + col0 * - col0 * + + col0 * + col0 FROM tab0 GROUP BY col0
----
-3418801
-456976
-47458321

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT col2 + - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 AS col2, - col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING col0 IS NOT NULL
----
26
-26
43
-43
83
-83

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL - col0 * - col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col0 - - + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-11
-14
17

query I rowsort
SELECT ALL - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 * - col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col0 * - col1 + + col1 FROM tab1 GROUP BY col0, col0, col1
----
-126
-1539
-3564

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 + col0 FROM tab1 cor0 GROUP BY col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0, col0 col2 FROM tab1 GROUP BY col0, col0
----
22
22
28
28
82
82

query I rowsort
SELECT - + AVG ( DISTINCT + col0 ) FROM tab1 AS cor0 WHERE ( NULL ) = NULL GROUP BY col0
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col1, col2, col2
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-2999
SELECT DISTINCT col0 DIV col0 AS col1 FROM tab0 GROUP BY col2, col0
----
1

skipif mysql # not compatible
query I rowsort label-2999
SELECT DISTINCT col0 / col0 AS col1 FROM tab0 GROUP BY col2, col0
----
1

query I rowsort
SELECT + - col0 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col1, col2
----
0
0
81

query I rowsort
SELECT ALL col1 * + col0 AS col0 FROM tab0 WHERE NOT + col1 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL + - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col0 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
38
79

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 WHERE NOT NULL <> col1 GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3010
SELECT DISTINCT + col1 DIV - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
0

skipif mysql # not compatible
query I rowsort label-3010
SELECT DISTINCT + col1 / - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col2 < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col1 * - + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query II rowsort
SELECT DISTINCT + col2, + col0 FROM tab0 GROUP BY col2, col0
----
24
43
38
83
79
26

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT DISTINCT + col1 - - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
118
122
82

query I rowsort
SELECT DISTINCT + col0 * + col0 FROM tab1 GROUP BY col0
----
484
6724
784

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

onlyif mysql # DIV for integer division: 
query I rowsort label-3020
SELECT DISTINCT col0 DIV + col2 FROM tab0 GROUP BY col2, col0 HAVING NOT + col2 DIV + + col0 IS NULL
----
0
1
2

skipif mysql # not compatible
query I rowsort label-3020
SELECT DISTINCT col0 / + col2 FROM tab0 GROUP BY col2, col0 HAVING NOT + col2 / + + col0 IS NULL
----
0
1
2

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col2, col1, col2
----
41
59
61

query I rowsort
SELECT ALL col0 / col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col1 * col2 FROM tab2 GROUP BY col0, col1, col2
----
2378
4661
5307

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL 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 col0, col1
----
22
28
82

query II rowsort
SELECT - col1 AS col2, col1 FROM tab1 WHERE NOT col1 > NULL GROUP BY col0, col1
----

query I rowsort
SELECT col2 * + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) = NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3030
SELECT ALL col0 DIV col0 AS col1 FROM tab0 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3030
SELECT ALL col0 / col0 AS col1 FROM tab0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col1, col0 HAVING NULL < ( - col1 )
----

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT - 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 I rowsort
SELECT - col1 col0 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
0

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 AS col1, col0 * + col0 col2 FROM tab0 GROUP BY col2, col0
----
26
676
43
1849
83
6889

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT ALL + - col1, - col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-81
-81
0
0

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col2, col0
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col1, + col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2
----
44
71
57
45
6
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 WHERE NOT NULL >= col1 GROUP BY col1
----

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + - col0 + col0 FROM tab0 cor0 GROUP BY col0
----
0

query II rowsort
SELECT ALL - + col1, - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-44
-57
-57
-6
-6

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NOT NULL <= ( NULL ) )
----

query I rowsort
SELECT + - col1 + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT - - AVG ( - col2 ) FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab1 cor0 GROUP BY col0, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 AS col0 FROM tab0 cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT AVG ( - + col2 ) AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3057
SELECT + col0 DIV - col0 AS col0 FROM tab1 cor0 GROUP BY col2, col0, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3057
SELECT + col0 / - col0 AS col0 FROM tab1 cor0 GROUP BY col2, col0, col1
----
-1
-1
-1

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING col2 IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - + col2 FROM tab1 cor0 GROUP BY col2, col1, col0
----
-45
-71
-8

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT col2 + - - col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col0 + col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col1 + - col0 FROM tab0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 * col1 * + col1 AS col1 FROM tab0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

query I rowsort
SELECT ALL - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( + col2 <= NULL )
----

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col0, col0, col1
----
41
59
61

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query II rowsort
SELECT ALL col0 + - col2, - col0 * + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING NOT NULL IS NOT NULL
----
-72
-1305
12
-7189
34
-5336

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query II rowsort
SELECT - col0, + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT ALL - col2 * col2 - col2 AS col0 FROM tab2 GROUP BY col2
----
-3422
-6320
-7656

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT col1 * col1 + - col1 AS col1 FROM tab1 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1, col2 HAVING NULL IS NULL AND NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
44
57
6

query I rowsort
SELECT - col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL > - - col2
----

query I rowsort
SELECT ALL col0 * + col2 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT - col2 * + - col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col0 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 - + - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-53
19
45

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-3102
SELECT col2 DIV - - col2 FROM tab0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3102
SELECT col2 / - - col2 FROM tab0 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT col1 * - AVG ( col1 ) FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + AVG ( DISTINCT + - col0 ) AS col2 FROM tab1 WHERE NOT NULL <> NULL GROUP BY col0
----

query I rowsort
SELECT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL > + col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - + col0 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1, col1
----
58
79
87

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT col1 FROM tab0 GROUP BY col0, col1, col1
----
0
0
81

query II rowsort
SELECT DISTINCT col0, + col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
15
91
91
92
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col0 * col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-1849
-676
-6889

query II rowsort
SELECT ALL col1 + - + col2 AS col0, + col1 FROM tab2 GROUP BY col1, col2
----
-17
41
-20
59
-26
61

query I rowsort
SELECT - - col0 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0, col2, col1
----
22
28
82

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col1 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT - col2 IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + - col2 col1 FROM tab2 WHERE NOT + - col1 IS NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col0, col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 + + col0 AS col2 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-3138
SELECT + col1 DIV + col2 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
3

skipif mysql # not compatible
query I rowsort label-3138
SELECT + col1 / + col2 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
3

query I rowsort
SELECT DISTINCT col2 + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 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 col2 * col2 col1 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 GROUP BY col1, col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING - col1 + - col1 IS NOT NULL
----
22
28
82

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col1 * col1 + - col1 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

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 + col0 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - - col1 * + + col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - 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 col2 col0 FROM tab1 GROUP BY col2, col1 HAVING NULL > NULL
----

query I rowsort
SELECT col1 FROM tab2 WHERE col2 NOT BETWEEN NULL AND col2 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col1 FROM tab1 GROUP BY col1
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 + + - col2 + + + col0 AS col2 FROM tab2 AS cor0 WHERE ( NULL ) <> + - col2 GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING + col1 * + col0 IS NULL
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

onlyif mysql # DIV for integer division: 
query I rowsort label-3163
SELECT ALL - col0 DIV col0 AS col2 FROM tab1 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3163
SELECT ALL - col0 / col0 AS col2 FROM tab1 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col2, col0
----

query I rowsort
SELECT ALL - col2 + + col2 FROM tab1 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT ALL col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-45
-71
-8

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL >= NULL
----

query II rowsort
SELECT - col0, col0 AS col0 FROM tab2 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT ALL - 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 tab1 AS cor0 WHERE NULL <> NULL GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query II rowsort
SELECT - col0 AS col0, + col2 FROM tab2 GROUP BY col2, col0
----
-15
87
-91
79
-92
58

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 * - + col1 col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col0 + + col0 FROM tab2 GROUP BY col0
----
182
184
30

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 IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 FROM tab1 WHERE NULL = NULL GROUP BY col2
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT + col1 + - + col1 FROM tab0 GROUP BY col1, col1
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 WHERE col0 IS NOT NULL GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL >= + + col2
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 * - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1032
-2054
-3154

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT - col0 FROM tab2 WHERE NOT ( NULL IS NOT NULL ) GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT - - col2 + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query II rowsort
SELECT ALL + col0, + col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - col1 + - col1 AS col2 FROM tab2 GROUP BY col1, col1
----
-118
-122
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT col2 + + col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <= + col1 GROUP BY col0, col2, col2
----

query I rowsort
SELECT ALL - col1 * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-1936
-3249
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query II rowsort
SELECT - + col1, col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT - col0 + + - col0 + col0 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + col2 * + col0 AS col2 FROM tab1 WHERE NOT NULL = NULL GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 * - + col0 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-492
-6795
-829

query I rowsort
SELECT DISTINCT + col2 * - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-45
-71
-8

query I rowsort
SELECT col0 * - col2 AS col0 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col0, col1, col2 HAVING NULL = NULL
----

query II rowsort
SELECT ALL + + col1, col1 * - - col1 FROM tab0 WHERE NOT + - col1 IS NULL GROUP BY col1
----
0
0
81
6561

query I rowsort
SELECT + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query II rowsort
SELECT col2 AS col0, col2 - - col2 AS col1 FROM tab1 cor0 GROUP BY col2, col2
----
45
90
71
142
8
16

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 WHERE NOT ( NULL >= NULL ) GROUP BY col1, col2, col0
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col2, col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col2 * - + col0 FROM tab1 GROUP BY col0, col2, col2 HAVING ( NULL IS NULL )
----
-1260
-176
-5822

query I rowsort
SELECT + - col0 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col1, col2, col1
----
-58
-79
-87

query II rowsort
SELECT DISTINCT col1 AS col1, col1 FROM tab1 GROUP BY col1, col2
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + - col2 * + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
45
71
8

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT - col2 + col2 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IN ( - col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-44
-57
-6

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-41
-59
-61

query II rowsort
SELECT col0 AS col0, + col0 AS col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0, col0
----
105
38
79

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE col0 IS NOT NULL GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - col1 ) FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL >= NULL GROUP BY col0, col2 HAVING NOT ( - col2 ) IS NULL
----

query I rowsort
SELECT - col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * + + col2 - col2 col0 FROM tab1 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT + col2 * col2 AS col1 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

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 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 * - col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL - col0 + col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-32
-51
46

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
24
38
79

query I rowsort
SELECT col1 + + col1 AS col1 FROM tab2 AS cor0 WHERE NULL < NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
162

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 WHERE ( NULL ) BETWEEN NULL AND NULL GROUP BY col2 HAVING ( NULL IS NULL )
----

query I rowsort
SELECT col0 + + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( ( NOT NULL IS NULL ) )
----
164
44
56

query I rowsort
SELECT DISTINCT col2 - + col2 FROM tab0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) <= - col1
----

query I rowsort
SELECT DISTINCT - col2 * col2 - col2 AS col0 FROM tab0 GROUP BY col2
----
-1482
-600
-6320

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NOT NULL IS NULL ) )
----

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab1 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + + col1 * - col1 - + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab0 GROUP BY col1, col2 HAVING NOT + + col2 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT - col2 * + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-1944
0
0

query I rowsort
SELECT ALL col2 * + col2 FROM tab2 GROUP BY col2, col2, col2
----
3364
6241
7569

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT + col1 * - - col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - - col1 + + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
38
79

query I rowsort
SELECT - col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1444
-576
-6241

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT col0 + + col0 IS NULL
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-3282
SELECT + + col0 DIV + col0 + col2 * col2 FROM tab1 cor0 GROUP BY col0, col2
----
2026
5042
65

skipif mysql # not compatible
query I rowsort label-3282
SELECT + + col0 / + col0 + col2 * col2 FROM tab1 cor0 GROUP BY col0, col2
----
2026
5042
65

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 GROUP BY col1, col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - col1 > NULL
----

query II rowsort
SELECT col2, col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-225
-8281
-8464

query I rowsort
SELECT ALL - col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + - col0 * col0 + - col0 FROM tab0 cor0 GROUP BY col0
----
-1892
-6972
-702

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 + - + col0 col2 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT col0 * col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - col0 + - + col0 FROM tab1 cor0 GROUP BY col0, col2, col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT col1 IS NULL
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query II rowsort
SELECT ALL - + col2 AS col2, + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
-24
24
-38
38
-79
79

query II rowsort
SELECT - col2, - col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT - col0 + + + col0 AS col1 FROM tab2 GROUP BY col0, col1, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 - col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT - col2 * + - col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query II rowsort
SELECT - + col1 AS col1, + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT col0, col0 * col0 FROM tab2 GROUP BY col0
----
15
225
91
8281
92
8464

query II rowsort
SELECT + col2 AS col2, col2 AS col0 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col1, col0 HAVING NULL IS NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 + + col0 col1 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col2, col0 HAVING col2 > ( NULL )
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 * + - col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NULL NOT BETWEEN col0 AND - col0
----

query I rowsort
SELECT + - col1 - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-133
-150
-76

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col2 col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col2 + col1 FROM tab2 GROUP BY col2, col1
----
138
148
99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + + col2 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3338
SELECT DISTINCT col2 DIV - col2 AS col0 FROM tab2 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-3338
SELECT DISTINCT col2 / - col2 AS col0 FROM tab2 GROUP BY col2
----
-1

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 ALL - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
81

query II rowsort
SELECT - - col0, col0 * - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 AS cor0 WHERE NOT ( NOT ( ( NULL IS NULL ) ) ) GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT ALL + col1 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-3772
-5369
-915

onlyif mysql # DIV for integer division: 
query I rowsort label-3349
SELECT - col0 * col0 DIV + col0 + col0 col2 FROM tab0 GROUP BY col0
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3349
SELECT - col0 * col0 / + col0 + col0 col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 WHERE NOT ( NOT NULL <> + col2 ) GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col1 HAVING NOT col1 <= NULL
----

query I rowsort
SELECT DISTINCT + col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 WHERE NOT col0 / - col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col1 + + - col1 AS col1 FROM tab2 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT ALL col0 * col0 + - col0 FROM tab0 GROUP BY col0
----
1806
650
6806

query I rowsort
SELECT DISTINCT AVG ( ALL col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab2 GROUP BY col0, col1
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0 HAVING NOT ( NULL = NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col2, col1, col0
----
15
91
92

query I rowsort
SELECT ALL + + col2 + - col2 * col2 + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1368
-528
-6083

query I rowsort
SELECT col2 * - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

onlyif mysql # DIV for integer division: 
query I rowsort label-3366
SELECT DISTINCT col1 - + col1 DIV col1 AS col1 FROM tab2 GROUP BY col1
----
40
58
60

skipif mysql # not compatible
query I rowsort label-3366
SELECT DISTINCT col1 - + col1 / col1 AS col1 FROM tab2 GROUP BY col1
----
40
58
60

query I rowsort
SELECT - + col1 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1936
-3249
-36

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col1 HAVING NULL >= col0
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL BETWEEN NULL AND - + col0
----

query I rowsort
SELECT - - AVG ( col0 ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING - col0 IS NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT 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 - col0 col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( NOT NULL IS NOT NULL )
----
-15
-91
-92

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT ALL - col1 - + col1 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT + + col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 * + col2 FROM tab2 GROUP BY col2, col2, col0
----
3364
6241
7569

query I rowsort
SELECT + col2 - col1 FROM tab2 GROUP BY col2, col1 HAVING NOT ( col1 ) IS NULL
----
17
20
26

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col1, col2, col0
----
45
71
8

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 * - + col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL col1 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT ALL - + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-3389
SELECT ALL + col1 DIV col1 AS col0 FROM tab2 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3389
SELECT ALL + col1 / col1 AS col0 FROM tab2 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE ( NULL > ( - + col1 ) ) GROUP BY col1, col2
----

query I rowsort
SELECT ALL - col2 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT - col1 * + col1 * - + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
531441

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 WHERE NULL = ( - col1 * + col0 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 * col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col2 * + col2 + col0 FROM tab0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
1527
619
6267

query I rowsort
SELECT col2 * col2 + - col2 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
3306
6162
7482

query I rowsort
SELECT ALL - col2 FROM tab2 WHERE NOT col1 IS NOT NULL GROUP BY col2, col1, col2, col1
----

query I rowsort
SELECT + - col2 FROM tab2 cor0 GROUP BY col2, col1, col1
----
-58
-79
-87

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 * - col0 FROM tab2 GROUP BY col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT ALL - col0 - - col0 * - - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
2028
3071
989

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col1, col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col0, col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col1 - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + + + col1 col2 FROM tab2 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT DISTINCT col0 + col0 FROM tab0 cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col2 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col2, col1
----
15
91
92

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE NULL <> + col1 GROUP BY col2, col0
----

query II rowsort
SELECT - col1, col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
-81
81
0
0

query I rowsort
SELECT DISTINCT - - 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 - + col0 col0 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-3430
SELECT ALL col2 DIV - col2 + + - col2 FROM tab0 GROUP BY col2, col2
----
-25
-39
-80

skipif mysql # not compatible
query I rowsort label-3430
SELECT ALL col2 / - col2 + + - col2 FROM tab0 GROUP BY col2, col2
----
-25
-39
-80

query I rowsort
SELECT ALL - col1 + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-126
-28
-85

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING ( NOT NULL IS NOT NULL )
----
45
71
8

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col0 * col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( ( NOT - + col1 IS NULL ) )
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
44
57
6

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY col1, col0, col0
----
-44
-57
-6

query I rowsort
SELECT col1 + + col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 + + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
114
12
88

query I rowsort
SELECT + col1 * - - col1 FROM tab1 cor0 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col0 * + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1849
676
6889

query I rowsort
SELECT col1 / - col2 FROM tab1 GROUP BY col1, col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 * + col1 * + - col1 FROM tab2 GROUP BY col1
----
-205379
-226981
-68921

query I rowsort
SELECT col2 * col2 + + col0 FROM tab1 GROUP BY col0, col0, col2
----
2053
5123
86

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0, col1
----
15
91
92

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 ALL - - col1 AS col2 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 DISTINCT col2 col1 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 * col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT col0 AS col1, col2 FROM tab2 GROUP BY col0, col2, col2
----
15
87
91
79
92
58

query I rowsort
SELECT - col0 * - + col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col2, col1 HAVING NOT ( + + col0 ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT + col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + - col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab0 GROUP BY col2, col1
----
158
48
76

query I rowsort
SELECT DISTINCT AVG ( DISTINCT + + col2 ) FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 cor0 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-1305
-5336
-7189

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN col0 * col0 AND NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-225
-8281
-8464

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING + col2 NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT AVG ( + col2 ) FROM tab0 GROUP BY col1, col1, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL + + col1 / col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col2, col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-3480
SELECT + col1 DIV - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3480
SELECT + col1 / - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 WHERE NULL = NULL GROUP BY col2
----

query I rowsort
SELECT col1 * - col2 + - col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 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 col2 FROM tab2 GROUP BY col1, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col0 * - col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) >= ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col2, col1, col0
----
41
59
61

query I rowsort
SELECT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col0 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query II rowsort
SELECT ALL col0 AS col2, col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL + - col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING ( NULL <> NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
0
0
0

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 ALL - + col2 + col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - - col0 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 + + col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-12
-34
72

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 WHERE ( NOT ( NULL ) IS NOT NULL ) GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col1 * - - col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1, col0 HAVING NOT - col0 <= col0
----

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
-24
-38
-79

query II rowsort
SELECT DISTINCT - + col1, + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT DISTINCT - col1 * col1 FROM tab1 GROUP BY col0, col1, col2 HAVING NULL >= + - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE col1 + - col1 IS NOT NULL GROUP BY col0 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING - AVG ( - col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 + + + col0 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
45
71
8

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 HAVING + col0 = NULL
----

query I rowsort
SELECT - col0 * + + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 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 - + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-81
0

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING col2 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3537
SELECT ALL + col0 DIV - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3537
SELECT ALL + col0 / - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-1
-1
-1

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

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 DISTINCT + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab1 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 + col2 col1 FROM tab2 GROUP BY col1, col1, col2
----
138
148
99

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 WHERE + col0 IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 + - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-182
-184
-30

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1, col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query II rowsort
SELECT DISTINCT - col2, + col2 FROM tab0 GROUP BY col0, col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 cor0 GROUP BY col2, col0, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col0 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query II rowsort
SELECT ALL - col0 AS col1, col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0, col1
----
41
59
61

query I rowsort
SELECT - col1 * col1 AS col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT col2 FROM tab1 WHERE NOT + col2 IS NULL GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-3574
SELECT col0 DIV + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3574
SELECT col0 / + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT + col2 * + col2 FROM tab1 cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 * + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 cor0 GROUP BY col0 HAVING ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 GROUP BY col1, col2, col1
----
-81
0

query I rowsort
SELECT col0 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col1 AS col1, - col1 FROM tab1 cor0 GROUP BY col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) <= NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col0 - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 <> NULL
----

query I rowsort
SELECT + col1 + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE - col2 IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT - col2 + - col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE NOT NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT - col0 - - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-19
-45
53

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT + col1 - + col1 AS col0 FROM tab2 GROUP BY col1, col1, col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
0
0
0

query I rowsort
SELECT + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE - col0 <> ( - + col1 ) GROUP BY col0
----
26
43
83

query II rowsort
SELECT - col1, + col1 FROM tab0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
41
59
61

query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT - col0 IS NULL
----
-116
-158
-174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col0 + - - col0 col2, - col0 FROM tab0 AS cor0 GROUP BY col0
----
166
-83
52
-26
86
-43

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT - col1 + + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <= - col1
----

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 + col0 AS col1 FROM tab2 GROUP BY col0
----
182
184
30

query II rowsort
SELECT DISTINCT - - AVG ( - col1 ) AS col0, col1 AS col1 FROM tab2 WHERE NOT NULL > - col0 * + col2 GROUP BY col1
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT - col1 + + col1 - - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1 * - + col1, + col1 FROM tab2 GROUP BY col1, col1
----
1681
41
3481
59
3721
61

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT - col0 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - - col2 * - col2 * - + col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-25411681
-4096
-4100625

query I rowsort
SELECT + col2 * - + col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1482
-600
-6320

query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + 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 ALL col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query II rowsort
SELECT col0, col0 * - col0 FROM tab1 GROUP BY col0
----
22
-484
28
-784
82
-6724

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT col0 * + + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
-10648
-21952
-551368

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
22
28
82

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT + col0 <= NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT col0 + + col1 + + col0 FROM tab2 WHERE NOT + col1 IS NULL GROUP BY col0, col1
----
225
241
91

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + - 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 + col0 col0 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN + col1 AND NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - - col0 + + AVG ( ALL - + col0 ) + - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING + col0 * + col1 - - col0 IS NULL
----

query I rowsort
SELECT - - col1 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col2 AS col1 FROM tab1 WHERE NULL > NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT col0 AS col1 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col0, col2, col2
----
22
28
82

query I rowsort
SELECT + col1 - - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
114
12
88

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col1, col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-3659
SELECT ALL col1 DIV - col1 - + col1 FROM tab2 GROUP BY col1
----
-42
-60
-62

skipif mysql # not compatible
query I rowsort label-3659
SELECT ALL col1 / - col1 - + col1 FROM tab2 GROUP BY col1
----
-42
-60
-62

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2, col1, col2
----
-24
-38
-79

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 WHERE NOT - col1 BETWEEN ( - col0 ) AND NULL GROUP BY col1
----
57

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL + col2 * + col0 FROM tab1 GROUP BY col2, col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col2 + - col2 + col2 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT col2 + + col2 * col2 IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL <> - col2
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col1, col2
----
24
38
79

query II rowsort
SELECT + - col0 AS col2, col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query II rowsort
SELECT ALL - col2 AS col1, + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT - col1 * - col1 + col1 + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6723

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
-26
-43
-83

query II rowsort
SELECT ALL - - col2, - col2 AS col0 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 col1 col2 FROM tab2 GROUP BY col2, col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT col1 * + col1 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL <> + col0
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab0 WHERE NOT ( NULL < NULL ) GROUP BY col2, col2
----

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 - col2 - + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-142
-16
-90

query I rowsort
SELECT - col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0 HAVING - col0 = NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NULL < NULL
----

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 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2 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 col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT DISTINCT - - col2 + - col2 * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1056
2133
3192

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NOT NULL > - col2 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col2, col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 * col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 - col2 * col0 FROM tab0 cor0 GROUP BY col0, col0, col2
----
-1075
-2080
-3237

onlyif mysql # DIV for integer division: 
query I rowsort label-3713
SELECT - col2 DIV + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3713
SELECT - col2 / + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1
-1
-1

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT - col0 * - - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT + + col1 + + - col2 + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col0 - + col0 FROM tab0 GROUP BY col0, col0
----
0

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col0 HAVING - col1 IS NOT NULL
----
0
81

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING NOT NULL > AVG ( + col0 )
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col2 AS col0, col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING - - AVG ( ALL - col1 ) IS NULL
----

query I rowsort
SELECT col2 * - col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( col2 IS NULL )
----
-24
-38
-79

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
-81
0

query I rowsort
SELECT - col0 * - - col2 AS col1 FROM tab0 GROUP BY col0, col2, col0
----
-1032
-2054
-3154

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT col1 * col1 FROM tab0 GROUP BY col1 HAVING NOT NULL >= - col1
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 WHERE col1 * - col0 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2 HAVING ( + AVG ( - col2 ) ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT - + col0 AS col1 FROM tab2 AS cor0 WHERE NOT - col1 + col1 IS NULL GROUP BY col0, col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING + - col0 NOT BETWEEN NULL AND - col1
----
-81

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col0, col0 HAVING - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
22
28
82

query I rowsort
SELECT col2 + + col2 + - col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

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 col1 * - col1 col0 FROM tab1 GROUP BY col1, col1, col0
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT - col1 + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-162
0

query I rowsort
SELECT - col1 + - AVG ( DISTINCT col1 ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-81
0

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 * - col2 FROM tab1 GROUP BY col2, col2 HAVING NOT + col2 IS NULL
----
-2025
-5041
-64

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL + AVG ( - col0 ) FROM tab2 GROUP BY col0 HAVING NOT NULL IN ( - col0 + + col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 - + col2 col1 FROM tab1 GROUP BY col2, col0, col2
----
0

query I rowsort
SELECT ALL - col1 * - col2 FROM tab0 GROUP BY col1, col2
----
0
0
1944

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT + col0 * + col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + AVG ( DISTINCT col1 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL 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 ALL - col2 * col2 - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-3422
-6320
-7656

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
1444
576
6241

query I rowsort
SELECT - + col0 FROM tab1 WHERE NOT col0 + + col0 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL - col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 * + col0 AS col1 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
1849
676
6889

query I rowsort
SELECT col2 * col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col2, col0 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT AVG ( + col1 ) FROM tab1 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT - col1 * col1 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL - col1 * col1 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT col1 * col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col2, col1 HAVING ( col1 < - col1 )
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1 HAVING - - col1 IS NOT NULL
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-3804
SELECT + + col1 DIV - + col1 col0 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-3804
SELECT + + col1 / - + col1 col0 FROM tab2 cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT ALL + col2 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-12
-34
72

query I rowsort
SELECT col0 + - - col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) = ( - col1 )
----

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE NOT - col0 IS NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT AVG ( col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL + + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT + col2 * col2 AS col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL col1 * col1 FROM tab0 cor0 WHERE ( NULL ) > col1 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 * + col2 * col2 AS col1 FROM tab0 AS cor0 WHERE NOT NULL >= NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, + col0 AS col0 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab0 WHERE ( NOT ( NOT + col0 IS NULL ) ) GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
58
79
87

query I rowsort
SELECT ALL + col1 + - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
114
12
88

query I rowsort
SELECT - + col0 + + - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-166
-52
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0 HAVING + + AVG ( ALL col2 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3832
SELECT ALL col0 DIV + col0 AS col1 FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3832
SELECT ALL col0 / + col0 AS col1 FROM tab1 GROUP BY col0
----
1
1
1

query II rowsort
SELECT DISTINCT col0 * - col0 AS col2, + col0 AS col2 FROM tab0 GROUP BY col0
----
-1849
43
-676
26
-6889
83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + AVG ( - col2 ) FROM tab2 AS cor0 WHERE col0 - + col0 * + col0 < + + col2 GROUP BY col2, col0 HAVING NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT col1 col0, col1 AS col1, + col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
0
81
81
81

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) IN ( AVG ( + - col0 ) )
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 - + + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING + + AVG ( ALL - + col2 ) IS NOT NULL
----
-162
0

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2, col0
----

query I rowsort
SELECT DISTINCT - - col1 + - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
-38
-79
57

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * - col2 * + + col2 - - col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - + col1 < NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NULL = - col0
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT AVG ( col0 ) < NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL BETWEEN ( - + col0 ) AND + col1
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT + col0 + col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT + col2 AS col2 FROM tab0 WHERE NULL NOT BETWEEN col0 AND NULL GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 * - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - AVG ( ALL - - col0 ) FROM tab0 GROUP BY col2, col0, col0 HAVING NOT col0 <= NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT - + col2 IS NULL
----
24
38
79

query I rowsort
SELECT + col2 + + col2 * - col2 AS col0 FROM tab1 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT col2 IS NULL
----
-81
0
0

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NOT NULL = NULL GROUP BY col2
----

query I rowsort
SELECT - col1 + + col1 FROM tab1 GROUP BY col1, col2
----
0
0
0

query II rowsort
SELECT DISTINCT - col1, - col1 FROM tab0 WHERE NOT ( NULL ) NOT BETWEEN ( NULL ) AND NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 / - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
15
91
92

query I rowsort
SELECT + AVG ( DISTINCT - - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 * col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

query II rowsort
SELECT ALL - col0, col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT DISTINCT + col0 * col1 * + col0 AS col2 FROM tab1 GROUP BY col0, col1
----
2904
295856
44688

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL + + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query II rowsort
SELECT ALL + AVG ( DISTINCT col2 ), - AVG ( ALL + col0 ) + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1 AS col2, col1 AS col1 FROM tab0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 * + col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL - + col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 * col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( col2 ) IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT ALL col1 + col1 AS col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col0, col2, col2 HAVING NOT - col2 IS NULL
----
58
79
87

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * - col0 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NOT col1 IS NULL
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + - col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, 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

onlyif mysql # DIV for integer division: 
query I rowsort label-3897
SELECT - col1 * - col1 DIV col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-3897
SELECT - col1 * - col1 / col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - - col0 + - AVG ( col1 ) FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING col1 = NULL
----

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 * col1 FROM tab1 cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND ( col2 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL < col2 + col0
----

query I rowsort
SELECT ALL + col1 + + col1 FROM tab2 GROUP BY col0, col1
----
118
122
82

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 * - col2 * col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
-357911
-512
-91125

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 * - col1 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1640
-3422
-3660

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT + col1 FROM tab1 WHERE NOT ( + col1 ) IS NULL GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col0 / - + col0 FROM tab2 cor0 WHERE NOT NULL = NULL GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab1 GROUP BY col2, col1, col1
----
45
71
8

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 * - + col0 FROM tab1 GROUP BY col0, col0
----
484
6724
784

query I rowsort
SELECT - + col2 + - - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-118
-122
-82

query I rowsort
SELECT - col0 + + + col0 AS col2 FROM tab2 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 + - col1 AS col0 FROM tab0 GROUP BY col1
----
0

query I rowsort
SELECT ALL col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE col0 <> NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 FROM tab0 cor0 GROUP BY col1 HAVING + - col1 IS NULL
----

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT - - AVG ( - col2 ) AS col1 FROM tab2 cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING NOT - col2 < ( NULL )
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE NOT NULL = ( NULL ) GROUP BY col2, col2 HAVING NULL IS NULL
----

query II rowsort
SELECT DISTINCT - col1 AS col0, - col1 AS col0 FROM tab1 GROUP BY col1, col1
----
-44
-44
-57
-57
-6
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-3939
SELECT DISTINCT col1 * - col1 DIV col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-3939
SELECT DISTINCT col1 * - col1 / col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-3940
SELECT ALL col0 DIV col1 FROM tab1 GROUP BY col0, col1, col1
----
0
1
3

skipif mysql # not compatible
query I rowsort label-3940
SELECT ALL col0 / col1 FROM tab1 GROUP BY col0, col1, col1
----
0
1
3

onlyif mysql # DIV for integer division: 
query I rowsort label-3941
SELECT ALL - col1 DIV col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3941
SELECT ALL - col1 / col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
-1
-1
-1

query I rowsort
SELECT + col2 * + col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col2, col1 HAVING NOT ( NULL IS NOT NULL ) OR NULL IS NULL
----
41
59
61

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 - - col0 FROM tab1 GROUP BY col0, col2
----
164
44
56

query I rowsort
SELECT col2 * col2 * - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT col0 - + - col2 FROM tab2 GROUP BY col0, col2, col2
----
102
150
170

query I rowsort
SELECT col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query II rowsort
SELECT - col0 AS col1, col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 AS col1, - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT DISTINCT col2 * - - col2 * + col2 FROM tab0 GROUP BY col2
----
13824
493039
54872

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) = + col0 GROUP BY col0, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * col1 AS col2 FROM tab0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
24
38
79

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query II rowsort
SELECT col1, + col1 AS col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT ALL + col0 + + col0 FROM tab1 GROUP BY col0
----
164
44
56

query II rowsort
SELECT ALL + + col1, + col0 AS col0 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
41
59
61

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col1 + col1 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT ALL - col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 WHERE NULL > NULL GROUP BY col1, col0 HAVING NOT NULL > - AVG ( - col0 ) * - col0 * + col0
----

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
0
0
81

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 AS cor0 WHERE + col1 IS NOT NULL GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + + - col2 col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT AVG ( + col2 ) IS NULL
----
-158
-48
-76

query I rowsort
SELECT - col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT + AVG ( DISTINCT + col0 ) * col0 AS col2 FROM tab0 cor0 WHERE ( + col2 ) < ( col0 / col2 ) GROUP BY col0, col0
----

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT AVG ( col2 ) AS col1 FROM tab0 AS cor0 WHERE NOT col1 <= ( NULL ) GROUP BY col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL <= - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - col2 * + col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-1444
-576
-6241

query II rowsort
SELECT DISTINCT - col0 AS col0, - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT + col2 * col0 AS col1 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 col2, - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN + - col1 AND NULL
----

query II rowsort
SELECT - col0, + col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT + col0 + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
182
184
30

query I rowsort
SELECT ALL - 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 ALL + col2 col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 * + col0 FROM tab0 GROUP BY col2, col0
----
-1032
-2054
-3154

query I rowsort
SELECT col1 + - col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 * + col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
79
87

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 cor0 WHERE - col0 * - col2 IS NULL GROUP BY col1, col1, col0
----

query I rowsort
SELECT + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - AVG ( col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col1 + col1 AS col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col0 FROM tab0 cor0 WHERE ( NULL ) <> NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

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 col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab2 AS cor0 WHERE col2 IS NOT NULL GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT + col0 - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <= - col0
----

query I rowsort
SELECT DISTINCT col1 * + col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + - col1 FROM tab1 cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + + 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 - - col2 + + col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2, col1
----
-58
-79
-87

query I rowsort
SELECT col2 + + col0 FROM tab0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL > NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT col1 * + col1 * - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-185193
-216
-85184

query I rowsort
SELECT - col0 AS col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + - col1 <= ( NULL )
----

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4038
SELECT ALL + col0 DIV - col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4038
SELECT ALL + col0 / - col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT col0 * col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + + col0 - + col0 FROM tab2 cor0 GROUP BY col1, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + AVG ( - col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING - col2 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT - col2 + + + col2 AS col0 FROM tab0 GROUP BY col2, col2
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-4050
SELECT DISTINCT + col1 DIV - col1 - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-4050
SELECT DISTINCT + col1 / - col1 - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
43
5
56

query I rowsort
SELECT + col0 * col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL NOT IN ( col1, col1 - - col1 )
----

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col0, col1, col2
----
41
59
61

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL + col2 * + col2 - col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * + col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 * col1 AS col1 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

onlyif mysql # DIV for integer division: 
query I rowsort label-4062
SELECT DISTINCT - col1 DIV - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1

skipif mysql # not compatible
query I rowsort label-4062
SELECT DISTINCT - col1 / - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1

query II rowsort
SELECT ALL + col1 AS col0, - col1 AS col1 FROM tab0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT DISTINCT - + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE ( NULL NOT BETWEEN ( NULL ) AND NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + - 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 ALL + - col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING col2 NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT - + col0 * col2 AS col0, - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-1305
-87
-5336
-58
-7189
-79

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col2, col0 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 - - + col2 FROM tab2 GROUP BY col2, col2, col2
----
116
158
174

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0 HAVING + + AVG ( ALL - col0 ) IS NOT NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) >= NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
-41
-59
-61

query I rowsort
SELECT - col1 * col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query II rowsort
SELECT + col0 AS col2, col0 AS col1 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT - col0 AS col2 FROM tab0 WHERE - + col2 BETWEEN NULL AND + + col1 GROUP BY col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 GROUP BY col0, col2, col1
----
41
59
61

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 + - col0 AS col2 FROM tab0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT - col0 FROM tab1 WHERE ( NULL ) <= - col2 GROUP BY col1, col0
----

query I rowsort
SELECT - col2 * + + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2, col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4096
SELECT col2 DIV col2 + col2 AS col0 FROM tab0 GROUP BY col2
----
25
39
80

skipif mysql # not compatible
query I rowsort label-4096
SELECT col2 / col2 + col2 AS col0 FROM tab0 GROUP BY col2
----
25
39
80

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
-81
0
0

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT col2 * + - col2 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL + - col2 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 col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT + - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT + AVG ( + col2 ) IS NOT NULL
----

query I rowsort
SELECT - col0 + - col0 * col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT + col2 + col0 AS col0 FROM tab0 GROUP BY col2, col0
----
105
121
67

query I rowsort
SELECT DISTINCT - col0 + col0 AS col1 FROM tab0 GROUP BY col1, col0
----
0

query II rowsort
SELECT ALL - col2, col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
45
-71
71
-8
8

query II rowsort
SELECT - col1, col1 * + - col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
-81
-6642
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab1 GROUP BY col0, col1, col0 HAVING ( ( NOT NULL = NULL ) )
----

query I rowsort
SELECT AVG ( DISTINCT + col1 ) FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT ( NOT ( NULL ) IS NULL )
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT + col0 / + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 * - col2 FROM tab1 GROUP BY col1, col2
----
-2565
-3124
-48

query I rowsort
SELECT - - col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col0 * - col0 * - col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT NULL > col2 GROUP BY col2
----

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-3364
-6241
-7569

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0
81

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col1 * + col1 AS col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE ( NULL ) >= + col1 GROUP BY col2, col0
----

query I rowsort
SELECT + AVG ( + - col1 ) FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * + col2 FROM tab0 GROUP BY col2, col0, col0
----
-1032
-2054
-3154

query I rowsort
SELECT col1 + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
118
122
82

query I rowsort
SELECT - + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT + col0 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col1 * + col1 + col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

onlyif mysql # DIV for integer division: 
query I rowsort label-4147
SELECT col2 DIV - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4147
SELECT col2 / - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT + col1 - - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT ALL col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

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 col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col1 * + col2 AS col0, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
38
0
79
1944
24

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col0, col0
----
44
57
6

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2, col0
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL AVG ( DISTINCT - + col0 ) FROM tab0 GROUP BY col0 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 DISTINCT + col2 AS col1 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <> col0 GROUP BY col0, col0
----

query I rowsort
SELECT ALL col2 * + + col0 AS col2 FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col1, col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT - + col2 * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
-2378
-4661
-5307

query I rowsort
SELECT + + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query II rowsort
SELECT DISTINCT col1, + col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - + col0 * - + col0 FROM tab1 AS cor0 WHERE NOT col1 / - col0 IS NULL GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2, col0 HAVING NOT - - col1 * + col0 IS NULL
----
26
43
83

query I rowsort
SELECT + col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL = NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col0, col1, col0 HAVING NOT NULL NOT BETWEEN col0 * - col1 AND NULL
----

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT col2 * - col2 + - - col2 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

query I rowsort
SELECT ALL col1 + + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab2 cor0 GROUP BY col0, col2, col2
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col0, - col0 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4196
SELECT ALL + col1 DIV - + col1 col0 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4196
SELECT ALL + col1 / - + col1 col0 FROM tab2 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL col0 + - - col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT + col0 * col0 FROM tab2 GROUP BY col0 HAVING NOT ( NOT col0 IS NULL )
----

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col0 + col1 AS col2 FROM tab0 GROUP BY col1, col0
----
124
26
83

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
-81
0

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col2 + + col2 + + col2 * col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
3480
6399
7743

query I rowsort
SELECT - + col0 FROM tab2 cor0 GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 WHERE NULL >= NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL AND NOT NULL IS NOT 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 col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING + - AVG ( + + col0 ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col1 * - col2 AS col0 FROM tab2 GROUP BY col2, col1
----
-2378
-4661
-5307

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 FROM tab1 cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT - 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 - + col1 + col2 col1 FROM tab2 cor0 GROUP BY col2, col1
----
17
20
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
26
43
83

query I rowsort
SELECT + AVG ( + col1 ) AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col0 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 + - col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT col0 - + col0 AS col2 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col0, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + col0 FROM tab1 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query III rowsort
SELECT DISTINCT col0 AS col1, col0, col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
9 values hashing to 559da8f454c4e5599b87319641a4f49a

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col0 * + col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col2 + + col0 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
105
121
67

query I rowsort
SELECT - col0 + col0 * - - col0 FROM tab1 GROUP BY col0
----
462
6642
756

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL + col0 - + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col0, col1 HAVING ( NULL >= ( NULL ) )
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col0, col1
----
-15
-91
-92

query I rowsort
SELECT - col0 FROM tab1 WHERE - col0 = NULL GROUP BY col0, col1
----

query II rowsort
SELECT DISTINCT + col1 AS col2, - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) BETWEEN + col2 AND - col2 + - - col1 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT ( NULL ) < AVG ( DISTINCT - col0 )
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING + col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col0 + + col0 / - - col0 FROM tab1 GROUP BY col0 HAVING + col0 <= NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT col1 IS NULL
----
26
43
83

query I rowsort
SELECT col2 + - - col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT + col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 WHERE NULL NOT BETWEEN NULL AND col1 * - col2 GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 GROUP BY col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-4266
SELECT - col0 DIV + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4266
SELECT - col0 / + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT col2 - col2 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-3306
-6162
-7482

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
41
59
61

query I rowsort
SELECT + col1 - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query II rowsort
SELECT col2, col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT + col0 + col0 FROM tab1 GROUP BY col0
----
164
44
56

query II rowsort
SELECT ALL col2 AS col0, col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE - col0 IS NULL GROUP BY col0
----

query II rowsort
SELECT col2 AS col0, col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT col1 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4276
SELECT - col0 - - - col0 DIV + + col0 FROM tab0 GROUP BY col0, col0
----
-27
-44
-84

skipif mysql # not compatible
query I rowsort label-4276
SELECT - col0 - - - col0 / + + col0 FROM tab0 GROUP BY col0, col0
----
-27
-44
-84

query I rowsort
SELECT DISTINCT col0 * - - col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE ( NULL ) = - - col2 GROUP BY col1
----

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col1 + col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NULL NOT BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * - + col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col2 * - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 + + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT DISTINCT col1 - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL - + col2 * - + col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
2378
4661
5307

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 WHERE ( col0 ) IS NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1, col2
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col0 + + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

query II rowsort
SELECT col1 * + AVG ( DISTINCT + col1 ) + - + col1, col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - 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 - col2 col1 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING + col0 * - - col0 IS NULL
----

query I rowsort
SELECT - col1 * col1 AS col0 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query II rowsort
SELECT + col1 AS col1, + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
71
57
45
6
8

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79

query II rowsort
SELECT ALL - col2 AS col1, col1 + - col2 FROM tab2 cor0 WHERE + col2 IS NOT NULL GROUP BY col1, col2
----
-58
-17
-79
-20
-87
-26

query I rowsort
SELECT ALL - - col2 + + - col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col1 * + col1 AS col0 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0
----
58
79
87

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL col2 + col2 AS col0 FROM tab0 GROUP BY col2, col2, col2
----
158
48
76

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
22
28
82

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col0 - - col0 AS col1 FROM tab0 GROUP BY col0, col1
----
166
52
86

query I rowsort
SELECT - - col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + + col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT col1 + + col1 - + col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4321
SELECT DISTINCT + col0 DIV - col0 FROM tab1 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-4321
SELECT DISTINCT + col0 / - col0 FROM tab1 GROUP BY col0
----
-1

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

query I rowsort
SELECT + + col2 + - col2 FROM tab0 cor0 GROUP BY col2 HAVING ( col2 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * col0 col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

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 col0 FROM tab2 GROUP BY col1, col0, col0
----
15
91
92

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-4329
SELECT ALL col0 DIV - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4329
SELECT ALL col0 / - col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 AS col2, col0 col2 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 - + - col0 FROM tab1 cor0 GROUP BY col0, col1
----
126
28
85

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
24
38
79

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 + + col2 FROM tab0 cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - AVG ( ALL - - col2 ) AS col0 FROM tab1 AS cor0 WHERE NOT NULL < NULL GROUP BY col2
----

query I rowsort
SELECT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-4340
SELECT + + col1 DIV col1 + + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
42
60
62

skipif mysql # not compatible
query I rowsort label-4340
SELECT + + col1 / col1 + + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
42
60
62

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-4342
SELECT - + col1 DIV col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4342
SELECT - + col1 / col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT col2 IS NULL
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col1, col0, col2, col1 HAVING NOT col0 >= col0
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col0, col2
----
58
79
87

query II rowsort
SELECT + col0, + col0 AS col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + - col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col0 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col0, col2, col1
----
41
59
61

query II rowsort
SELECT + col0, - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
-26
43
-43
83
-83

query I rowsort
SELECT ALL + col2 * + - col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

query II rowsort
SELECT - col1 AS col0, col1 FROM tab1 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 + col0 + - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col2 FROM tab1 WHERE NULL <> + col1 GROUP BY col2
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 * - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT col0 + - col0 AS col0 FROM tab2 GROUP BY col0
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-4367
SELECT DISTINCT col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-4367
SELECT DISTINCT col0 / col0 FROM tab0 AS cor0 GROUP BY col0
----
1

query I rowsort
SELECT ALL col1 * - col1 AS col0 FROM tab1 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + AVG ( + - col2 ) AS col0 FROM tab2 WHERE NOT NULL = - - col2 GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab1 cor0 GROUP BY col2, col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL + + col0 + col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
166
52
86

query I rowsort
SELECT ALL col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT col1 * - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 GROUP BY col2, col2, col0
----
22
28
82

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 WHERE NOT NULL > + col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
158
48
76

query I rowsort
SELECT DISTINCT + col1 FROM tab0 cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col1, col0, col1
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-4385
SELECT DISTINCT col1 DIV - + col1 + + - col1 col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
-45
-58
-7

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4385
SELECT DISTINCT col1 / - + col1 + + - col1 col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
-45
-58
-7

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query II rowsort
SELECT + col0 AS col1, col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL + col1 * + + col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 WHERE col1 IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + - col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query II rowsort
SELECT - - col0 AS col0, - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, + col2 FROM tab1 GROUP BY col0, col2
----
22
8
28
45
82
71

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 - + - col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4403
SELECT col1 + + - col1 DIV + - col1 AS col2 FROM tab1 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-4403
SELECT col1 + + - col1 / + - col1 AS col2 FROM tab1 GROUP BY col1
----
45
58
7

query I rowsort
SELECT col0 FROM tab0 WHERE col0 IS NOT NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col1 - + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * - col1 + col1 AS col2 FROM tab0 GROUP BY col1
----
0
6642

query I rowsort
SELECT DISTINCT - col2 + col2 AS col0 FROM tab2 GROUP BY col0, col2
----
0

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-4409
SELECT ALL col2 DIV - col2 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

skipif mysql # not compatible
query I rowsort label-4409
SELECT ALL col2 / - col2 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
23
37
78

query I rowsort
SELECT + + col1 AS col0 FROM tab2 WHERE NOT NULL >= NULL GROUP BY col1
----

query I rowsort
SELECT col0 * + - col0 * col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + - col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT + col1 * - + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-6561
0
0

query I rowsort
SELECT - col2 + - col2 FROM tab1 cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col0 AS col2, + col0 FROM tab0 GROUP BY col2, col0
----
26
26
43
43
83
83

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT + - col2 * col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING NULL <= NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING ( + - col2 ) IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 * - col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT col1 + - col1 FROM tab1 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2, col2, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 WHERE NOT + col2 < + - col1 + col2 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-4435
SELECT + col1 DIV + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

skipif mysql # not compatible
query I rowsort label-4435
SELECT + col1 / + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING + + col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( ( NULL ) IS NULL )
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab1 WHERE - col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + - + col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
-72
12
34

query I rowsort
SELECT - col2 - col2 AS col0 FROM tab0 GROUP BY col2
----
-158
-48
-76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - - AVG ( col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
26
43
83

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT NULL = NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL BETWEEN ( - col2 ) AND ( col0 )
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND - AVG ( DISTINCT - col1 )
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 cor0 GROUP BY col0, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( col1 ) >= NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 cor0 WHERE col2 IS NULL GROUP BY col2
----

query II rowsort
SELECT col1 AS col1, - col0 AS col1 FROM tab1 AS cor0 WHERE NOT NULL < ( NULL ) GROUP BY col1, col0
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT col1 * - - col1 - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 * + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 cor0 GROUP BY col1, col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT - col0 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col0 HAVING + col1 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT + col1 + - col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT + col0 * col0 * + col2 * + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-293625
-45163904
-59532109

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL >= col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 / + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN col0 AND NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT ( NULL IS NOT NULL ) )
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0 HAVING - col0 > NULL
----

query II rowsort
SELECT col2 + + col2 AS col0, - col2 FROM tab0 GROUP BY col2
----
158
-79
48
-24
76
-38

query II rowsort
SELECT - col1 AS col1, + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

query II rowsort
SELECT col0 AS col0, - col0 AS col2 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING col1 IS NOT NULL
----
0
81

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0, col2 HAVING + + col0 / - col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT + col2 + - col2 + + + col2 AS col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-4495
SELECT ALL col1 DIV - col1 + + + col2 FROM tab2 GROUP BY col2, col1
----
57
78
86

skipif mysql # not compatible
query I rowsort label-4495
SELECT ALL col1 / - col1 + + + col2 FROM tab2 GROUP BY col2, col1
----
57
78
86

query I rowsort
SELECT DISTINCT - col2 * col2 + - col2 FROM tab1 WHERE NULL >= - col0 GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4497
SELECT DISTINCT - col0 DIV col0 - col0 FROM tab1 GROUP BY col0, col0
----
-23
-29
-83

skipif mysql # not compatible
query I rowsort label-4497
SELECT DISTINCT - col0 / col0 - col0 FROM tab1 GROUP BY col0, col0
----
-23
-29
-83

query I rowsort
SELECT ALL col2 / col0 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT + col0 - AVG ( col0 ) FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 + col1 * col1 FROM tab0 AS cor0 WHERE NOT ( col0 ) NOT BETWEEN NULL AND col0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) NOT BETWEEN + AVG ( ALL - col2 ) AND NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT ALL + col2 / col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col1 * - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 * - col2 AS col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

query II rowsort
SELECT ALL + col2, - col2 * - col2 FROM tab2 GROUP BY col2
----
58
3364
79
6241
87
7569

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING NOT NULL < + col0
----

query I rowsort
SELECT - - col1 + - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-32
-51
46

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT - col1 AS col0 FROM tab0 WHERE NOT + col0 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 * - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col2 AS col1 FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 * + col0 + + - col0 col0 FROM tab1 cor0 GROUP BY col0, col2, col0
----
462
6642
756

query II rowsort
SELECT - col1, col1 + + col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) <= ( + + col1 )
----

query II rowsort
SELECT + col2 AS col0, - col2 + + col2 FROM tab1 GROUP BY col2
----
45
0
71
0
8
0

query II rowsort
SELECT - col1, col1 FROM tab2 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT DISTINCT + col1 + - col1 * - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) NOT IN ( - col1 )
----

query I rowsort
SELECT DISTINCT - AVG ( ALL - col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + - - col0 * - col0 col2 FROM tab2 GROUP BY col0
----
-210
-8190
-8372

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 - + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col0, col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col0 + + - col1 FROM tab0 GROUP BY col1, col0
----
-38
26
83

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 + - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-15
-91
-92

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 - col2 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query II rowsort label-4547
SELECT DISTINCT - col0 DIV - col1, + col1 FROM tab1 GROUP BY col1, col0
----
0
57
1
44
3
6

skipif mysql # not compatible
query II rowsort label-4547
SELECT DISTINCT - col0 / - col1, + col1 FROM tab1 GROUP BY col1, col0
----
0
57
1
44
3
6

query I rowsort
SELECT - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4550
SELECT DISTINCT col2 DIV - col2 FROM tab2 GROUP BY col2, col2
----
-1

skipif mysql # not compatible
query I rowsort label-4550
SELECT DISTINCT col2 / - col2 FROM tab2 GROUP BY col2, col2
----
-1

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col2 + - + col2 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col0, col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query II rowsort
SELECT DISTINCT col1 AS col0, col1 + + col1 FROM tab1 GROUP BY col1, col1
----
44
88
57
114
6
12

query I rowsort
SELECT - + col0 - + col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col1, col2 FROM tab0 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col2
----
24
24
38
38
79
79

query II rowsort
SELECT col2 AS col0, col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL IS NULL )
----
-26
-43
-83

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col0, col0
----
24
38
79

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
22
28
82

query II rowsort
SELECT - col2, + col2 + col2 AS col2 FROM tab1 GROUP BY col2
----
-45
90
-71
142
-8
16

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

query I rowsort
SELECT col2 * + - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT col1 FROM tab2 GROUP BY col0, col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col0 * - col0 FROM tab0 GROUP BY col0, col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL OR NOT - col1 IS NULL
----
41
59
61

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT + col1 * - col1 > NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab1 cor0 GROUP BY col0, col1, col1
----
44
57
6

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col2, col0, col2 HAVING ( NULL IS NULL )
----
26
43
83

query I rowsort
SELECT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 * - col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
-17576
-571787
-79507

query I rowsort
SELECT - col1 + col1 - - col1 * + col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 AS col2, col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 - col0 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + col2 col0 FROM tab1 GROUP BY col1, col2
----
-12
2
27

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col0, col1, col1
----
-26
-43
-83

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 + col1 FROM tab2 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col2 HAVING NOT NULL > NULL
----

query II rowsort
SELECT DISTINCT + col0 AS col0, col0 AS col1 FROM tab1 cor0 GROUP BY col0, col2
----
22
22
28
28
82
82

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING + + col1 >= NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT AVG ( - + col2 ) * - col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col2, col0
----
-15
-91
-92

query II rowsort
SELECT + + col1 AS col0, col1 - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT col1 IS NULL )
----
41
82
59
118
61
122

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col0, col1, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col1 + + col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
0

query I rowsort
SELECT + - col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab2 WHERE col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col1, col0 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col0 + col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
0

onlyif mysql # DIV for integer division: 
query I rowsort label-4618
SELECT - col0 + col0 DIV + col0 FROM tab0 GROUP BY col0, col0
----
-25
-42
-82

skipif mysql # not compatible
query I rowsort label-4618
SELECT - col0 + col0 / + col0 FROM tab0 GROUP BY col0, col0
----
-25
-42
-82

query I rowsort
SELECT DISTINCT - col0 - col0 FROM tab2 GROUP BY col0 HAVING NOT ( AVG ( DISTINCT col1 ) ) IS NOT NULL
----

query I rowsort
SELECT - col1 * col0 AS col1 FROM tab2 GROUP BY col1, col0
----
-3772
-5369
-915

query I rowsort
SELECT ALL - col2 * col2 FROM tab1 GROUP BY col1, col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT + - col0 FROM tab0 cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab1 GROUP BY col0
----
484
6724
784

query II rowsort
SELECT ALL + + col1, + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
142
16
90

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0, + col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col0 + - - col0 * + - col0 - + - col0 * col0 AS col0 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2, col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 + col1 AS col0 FROM tab0 GROUP BY col1, col1, col2
----
105
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT ALL - col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col0 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL >= NULL
----

query II rowsort
SELECT col0, + col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT - col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col2 * - col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT + + col2 IS NULL
----
58
79
87

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
158
48
76

query I rowsort
SELECT col2 FROM tab1 GROUP BY col1, col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col1 + - col1 AS col2 FROM tab0 cor0 WHERE NOT ( + col1 ) = ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL - col2 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-116
-158
-174

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT AVG ( DISTINCT col2 ) IS NOT NULL
----

query II rowsort
SELECT DISTINCT col0, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-44
-57
-6

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL AND NULL IS NULL
----
15
91
92

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NULL NOT BETWEEN ( + col0 ) AND NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT col0 + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
164
44
56

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 AS col2 FROM tab0 WHERE col1 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + col0 + - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
0

query II rowsort
SELECT + col1, + col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col1, col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( col0 >= 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 + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col2 * + col2 FROM tab0 GROUP BY col2 HAVING col2 = ( NULL )
----

query I rowsort
SELECT ALL col0 * col2 FROM tab0 GROUP BY col1, col2, col0
----
1032
2054
3154

query II rowsort
SELECT + col2, col2 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 ALL - + col0 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-4677
SELECT col2 DIV + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4677
SELECT col2 / + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
1
1
1

query I rowsort
SELECT - + col0 AS col1 FROM tab2 cor0 GROUP BY col1, col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - - col0 FROM tab0 WHERE NULL > NULL GROUP BY col0 HAVING + + col0 > NULL
----

query I rowsort
SELECT - col2 FROM tab1 WHERE NULL < NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col0, col1, col2
----
0
0
81

query I rowsort
SELECT col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING - AVG ( ALL + - col1 ) IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NOT - col2 IS NULL
----
45
71
8

query II rowsort
SELECT ALL - col0 AS col1, + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL NOT IN ( col1 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 GROUP BY col2 HAVING NULL IN ( col2 + col2 * - col2 )
----

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col0, col1, col2
----
0
0
81

query I rowsort
SELECT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 + - col1 FROM tab0 GROUP BY col1
----
0

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

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 ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT col1 * col1 * + - col1 + + col1 FROM tab0 GROUP BY col1
----
-531360
0

query I rowsort
SELECT ALL + + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT ALL col1 + - col1 FROM tab0 GROUP BY col1 HAVING col1 IS NOT NULL
----
0
0

query II rowsort
SELECT ALL + col0 AS col1, col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 * - col1 * + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col2, col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 - - col1 FROM tab1 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4715
SELECT ALL col2 * - col2 * + col2 DIV + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

skipif mysql # not compatible
query I rowsort label-4715
SELECT ALL col2 * - col2 * + col2 / + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col2, col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT + AVG ( DISTINCT col1 ) FROM tab2 WHERE NULL < NULL OR ( NULL ) IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab1 GROUP BY col1, col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT + - col0 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-4723
SELECT ALL + col1 DIV col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4723
SELECT ALL + col1 / col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1
1
1

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + + col2 * col1 AS col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT + col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
45
71
8

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

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NULL
----
24
38
79

query II rowsort
SELECT DISTINCT col2 AS col0, col2 + - - col2 AS col2 FROM tab1 GROUP BY col2, col0
----
45
90
71
142
8
16

query I rowsort
SELECT ALL - col0 * col0 AS col1 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT + col0 * - col0 AS col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT + + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab1 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
22
28
82

query II rowsort
SELECT DISTINCT col1, - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81
-81

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 WHERE NOT - + col2 IS NOT NULL GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 WHERE NOT - col1 IS NULL GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col0 + + col0 * col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
3864
5460
930

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col1, col0, col0
----
15
91
92

query I rowsort
SELECT - - col2 AS col1 FROM tab0 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 DISTINCT col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL col0, col0 FROM tab1 GROUP BY col1, col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col1, col2, col0
----
22
28
82

query I rowsort
SELECT + + col1 + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col1 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col2 AS col2 FROM tab1 WHERE NULL IN ( col1 ) GROUP BY col2
----

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NOT NULL <= NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT col1 + + col1 AS col0 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-81
0
0

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col1 AS col1, col1 FROM tab0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT ALL - col2 + col1 FROM tab1 GROUP BY col2, col1
----
-2
-27
12

query I rowsort
SELECT - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL < ( NULL ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + - col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT DISTINCT - col2 * + col2 + - col0 AS col2 FROM tab1 GROUP BY col0, col2
----
-2053
-5123
-86

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 WHERE NOT NULL = + col1 GROUP BY col2
----

query I rowsort
SELECT - AVG ( + - col2 ) AS col1 FROM tab2 AS cor0 WHERE NULL = col0 * + col1 - + - col2 GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 - - col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
162

onlyif mysql # DIV for integer division: 
query I rowsort label-4772
SELECT ALL col0 DIV col0 AS col0 FROM tab1 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4772
SELECT ALL col0 / col0 AS col0 FROM tab1 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT DISTINCT - col2 + col2 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 + - col1 * col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-126
-1539
-3564

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL > - col1
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2 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
----
22
28
82

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col0, col0, col1, col2
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + - col1 + col1 * AVG ( - - col1 ) 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 - col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query II rowsort
SELECT - col2, col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL > col0 GROUP BY col0
----

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query II rowsort
SELECT DISTINCT col0 AS col2, col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col0 HAVING NOT + col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4790
SELECT DISTINCT + col0 * - + col0 DIV - col0 FROM tab1 GROUP BY col0
----
22
28
82

skipif mysql # not compatible
query I rowsort label-4790
SELECT DISTINCT + col0 * - + col0 / - col0 FROM tab1 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query II rowsort
SELECT DISTINCT + col1, - col2 FROM tab0 cor0 GROUP BY col2, col1
----
0
-38
0
-79
81
-24

query I rowsort
SELECT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT col1 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-4796
SELECT - col0 * + col2 DIV col2 + + + col2 FROM tab0 cor0 GROUP BY col0, col2
----
-19
-45
53

skipif mysql # not compatible
query I rowsort label-4796
SELECT - col0 * + col2 / col2 + + + col2 FROM tab0 cor0 GROUP BY col0, col2
----
-19
-45
53

query I rowsort
SELECT col2 * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - + col0 * col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT col2 * - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4802
SELECT - - col2 DIV + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4802
SELECT - - col2 / + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 * + col0 * - col0 AS col0, col0 col1 FROM tab1 GROUP BY col0
----
-10648
22
-21952
28
-551368
82

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + + col1 AS col0 FROM tab0 WHERE NULL > NULL GROUP BY col1
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 WHERE NOT NULL > + col1 GROUP BY col2, col2, col2
----

query I rowsort
SELECT ALL - col0 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col2, col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 GROUP BY col2 HAVING NOT + col2 >= NULL
----

query I rowsort
SELECT DISTINCT + col0 * + + col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
-45
-71
-8

query I rowsort
SELECT - col2 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT 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 + col1 + + col1 col1 FROM tab2 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL col1 FROM tab2 WHERE NOT ( NOT ( NULL ) IS NOT NULL ) GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 + - - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0

query I rowsort
SELECT - col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - - col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 + + col2 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
142
16
90

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0 HAVING ( NOT ( NULL ) IS NOT NULL )
----
15
91
92

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * - col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT ALL - - col0 + - col0 - - - col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col0, col1 HAVING NOT + col1 IS NULL
----
41
59
61

query I rowsort
SELECT col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + + col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col2 + - - col2 + - + col0 FROM tab0 GROUP BY col0, col2
----
-7
132
5

query I rowsort
SELECT DISTINCT col0 + + col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col0 * col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT ( NOT ( NULL IS NULL ) )
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab1 GROUP BY col0, col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT + col1 * + col2 FROM tab1 AS cor0 WHERE NOT NULL <= ( NULL ) GROUP BY col1, col2 HAVING NOT NULL BETWEEN col2 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab2 GROUP BY col1 HAVING ( + col1 ) IS NOT NULL
----
41
59
61

query II rowsort
SELECT DISTINCT + col2, col2 + + - col2 FROM tab1 GROUP BY col2, col2
----
45
0
71
0
8
0

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
0
0
81

query I rowsort
SELECT - - col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query II rowsort
SELECT DISTINCT - col0, - col0 * - col1 + - col1 AS col0 FROM tab1 AS cor0 WHERE NULL < NULL GROUP BY col1, col0
----

query I rowsort
SELECT col2 - + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-22
-28
-82

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
0

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL col0 / - - col0 + - - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 + + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= - + col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT - col0 * + col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT - col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL AND NOT col0 IS NULL
----
-22
-28
-82

query I rowsort
SELECT + col0 + col0 + + - col0 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
22
28
82

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
41
59
61

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col0, col1 HAVING + + col0 = NULL
----

query II rowsort
SELECT ALL + col0 AS col0, - col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT ALL - col2 + + + col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - AVG ( ALL col1 ) FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * + col0 col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab2 GROUP BY col2, col2
----
0

query I rowsort
SELECT + col0 FROM tab2 WHERE ( NULL ) IS NULL GROUP BY col0, col1 HAVING col0 >= NULL
----

query I rowsort
SELECT - col2 + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 cor0 GROUP BY col2, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col0, col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
484
6724
784

query I rowsort
SELECT - + col0 FROM tab2 cor0 GROUP BY col0, col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - + col0 IS NULL
----
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 col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING ( + col2 ) IS NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 + - col2 FROM tab1 GROUP BY col2, col2
----
0

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT - col2 * - col2 AS col2 FROM tab2 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 * col1 * - - col1 FROM tab2 GROUP BY col1, col1
----
-205379
-226981
-68921

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1, col1, col1 HAVING NOT NULL > + col1
----

query I rowsort
SELECT + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col0, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - + col2 + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT + + col0 - - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
22
28
82

query II rowsort
SELECT col2, - col2 AS col0 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT col1 + + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
124
26
83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 WHERE NOT col1 <= - + col1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT AVG ( + col2 ) FROM tab0 AS cor0 WHERE NOT ( NULL ) IN ( - col0 ) GROUP BY col0, col2, col2
----

query I rowsort
SELECT DISTINCT col0 * - col0 AS col2 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query II rowsort
SELECT DISTINCT + col2, - col2 FROM tab2 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT + col2 FROM tab0 cor0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT - col0 + - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col1 * - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col0 FROM tab0 WHERE NOT - col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
0
0
81

query I rowsort
SELECT + col0 + col0 AS col1 FROM tab2 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2, col1, col0
----
-58
-79
-87

query I rowsort
SELECT ALL + - col1 * col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-6561
0
0

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 * - + col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

onlyif mysql # DIV for integer division: 
query I rowsort label-4941
SELECT DISTINCT - - col1 DIV + col1 - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-4941
SELECT DISTINCT - - col1 / + col1 - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-40
-58
-60

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col1, col0 HAVING NOT + + col0 + - col1 >= + col0
----
-58
-79
-87

query I rowsort
SELECT col1 * - col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1 HAVING NOT + col1 IS NULL
----
-2378
-4661
-5307

query I rowsort
SELECT ALL - - col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col0 FROM tab0 cor0 GROUP BY col1, col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL + col0 * + - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - AVG ( col2 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4951
SELECT DISTINCT - col0 DIV + col0 FROM tab0 GROUP BY col2, col0
----
-1

skipif mysql # not compatible
query I rowsort label-4951
SELECT DISTINCT - col0 / + col0 FROM tab0 GROUP BY col2, col0
----
-1

query I rowsort
SELECT DISTINCT - col1 + - + col1 FROM tab1 GROUP BY col1
----
-114
-12
-88

onlyif mysql # DIV for integer division: 
query I rowsort label-4953
SELECT DISTINCT + col1 DIV - col1 + + + col1 FROM tab1 GROUP BY col1, col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-4953
SELECT DISTINCT + col1 / - col1 + + + col1 FROM tab1 GROUP BY col1, col1
----
43
5
56

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col0, col1, col1
----
0
0
81

query I rowsort
SELECT - col0 * col0 FROM tab1 GROUP BY col1, col0 HAVING col0 / + col1 IS NULL
----

query I rowsort
SELECT + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query II rowsort
SELECT col2 AS col1, + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT ( NOT NULL >= NULL )
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col2 AS col2 FROM tab2 cor0 GROUP BY col2, col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NULL IS NOT NULL OR NOT col1 NOT BETWEEN NULL AND NULL GROUP BY col1, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col2, col2
----
26
43
83

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
79
87

query II rowsort
SELECT DISTINCT col1 AS col0, + col1 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + - col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 * + col0 AS col0 FROM tab1 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT - col2 - col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 WHERE ( NULL ) IN ( col2 ) GROUP BY col0, col0, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4986
SELECT + col1 DIV + col1 col1 FROM tab2 GROUP BY col1, col0, col2
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4986
SELECT + col1 / + col1 col1 FROM tab2 GROUP BY col1, col0, col2
----
1
1
1

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 FROM tab1 WHERE - - col0 NOT BETWEEN - - col0 AND - col2 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 cor0 GROUP BY col2, col2, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab0 cor0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING + col1 = 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 col1 * col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 + + col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col2, col1, col2 HAVING NOT NULL <> col1
----

query I rowsort
SELECT col1 FROM tab2 cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 WHERE NULL < NULL GROUP BY col2, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING ( NULL ) > ( NULL )
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col0, col1
----
44
57
6

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0, col2 HAVING AVG ( DISTINCT + col2 ) IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT col1 * + - col1 AS col2 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL - - col0 * col0 * - col0 FROM tab2 cor0 GROUP BY col0
----
-3375
-753571
-778688

query I rowsort
SELECT - col1 + + - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 cor0 WHERE NOT NULL >= NULL GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col0, col2, col1
----
45
71
8

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-58
-79
-87

query II rowsort
SELECT DISTINCT + col0, - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
116
158
174

query I rowsort
SELECT ALL AVG ( ALL col2 ) FROM tab0 GROUP BY col2 HAVING NULL IN ( - col2 * col2 )
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL > NULL
----

query II rowsort
SELECT - col2 AS col2, col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 WHERE ( NOT ( NULL IS NULL ) ) GROUP BY col0
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * + + AVG ( ALL + col2 ) + col0 FROM tab1 WHERE NULL = col1 GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL > + col2
----

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-15
-91
-92

query I rowsort
SELECT ALL col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0, col2
----

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col1 AS col0 FROM tab0 cor0 WHERE NOT ( NULL ) > NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 * - - col2 * col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5028
SELECT - col2 DIV + col2 AS col0 FROM tab0 GROUP BY col2, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5028
SELECT - col2 / + col2 AS col0 FROM tab0 GROUP BY col2, col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT col1 + - + col1 FROM tab2 GROUP BY col0, col1 HAVING col1 IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 * - - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + col0 AS col1 FROM tab2 WHERE NOT NULL = NULL GROUP BY col0, col1
----

query I rowsort
SELECT + col0 * col0 * - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-17576
-571787
-79507

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col0 AS col0 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL + col1 + + 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 NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL + - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 GROUP BY col0, col1, col2
----
41
59
61

query I rowsort
SELECT col2 * + col2 * - + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING col0 * + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT col2 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT col1 FROM tab1 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

query II rowsort
SELECT - col1 AS col1, col1 + + - col1 FROM tab0 GROUP BY col1, col1
----
-81
0
0
0

query I rowsort
SELECT DISTINCT - - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
0

query I rowsort
SELECT DISTINCT - col1 + + + col1 FROM tab2 GROUP BY col1
----
0

query I rowsort
SELECT + col1 * + col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 + - + col2 - col2 AS col0 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

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 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 cor0 WHERE col1 * - col1 IS NOT NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + + col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT - col0 ) FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 - - col2 AS col2 FROM tab1 GROUP BY col2, col2
----
142
16
90

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col2, col2
----
-41
-59
-61

query I rowsort
SELECT - AVG ( + col2 ) AS col0 FROM tab0 AS cor0 WHERE NOT col1 IS NOT NULL GROUP BY col2 HAVING ( - col2 ) IS NULL
----

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT col1 * col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 WHERE NULL BETWEEN NULL AND ( NULL ) GROUP BY col1, col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 AS col2, + col1 col0 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT + - col0 AS col0 FROM tab2 WHERE + col2 IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col1 HAVING + - col1 < NULL
----

query I rowsort
SELECT + col0 - + + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col2, col0, col0, col0
----
22
28
82

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT ( NOT ( NULL ) IS NULL )
----
15
91
92

query I rowsort
SELECT - col0 + + col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + AVG ( DISTINCT + col2 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 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 tab2 AS cor0 GROUP BY col1, col2, col0, col0
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL + col1 + col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col0 * col0 FROM tab0 GROUP BY col0, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 + - col1 FROM tab0 cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT DISTINCT col1 + - col0 FROM tab1 GROUP BY col0, col1
----
-16
-38
29

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
58
79
87

query I rowsort
SELECT ALL + - col1 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab1 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
22
28
82

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - AVG ( col1 ) > NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab0 WHERE NOT NULL <= NULL GROUP BY col1
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT col0 * + col0 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT AVG ( - col1 ) FROM tab0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL - + col1 - - col0 FROM tab2 WHERE NOT col2 + + - col2 IS NULL GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-46
32
51

query I rowsort
SELECT DISTINCT + + col1 + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col0, col0
----
45
71
8

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col0, col1, col0, col1
----
41
59
61

query I rowsort
SELECT col1 + + col1 FROM tab2 GROUP BY col0, col1
----
118
122
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT col2 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col2 * col1 AS col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 / + col1 + col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col0 AS col0, - col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
0
91
0
92
0

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col0 + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - + col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + col2 ) + - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col0
----
-26
-43
-83

query II rowsort
SELECT ALL col2, + col2 AS col1 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT - - col1 * - + col0 + - col0 * + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1140
-12236
-13650

query I rowsort
SELECT + + col1 + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
162

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col0 + + col0 + - + col0 + col0 AS col0 FROM tab0 cor0 GROUP BY col1, col2, col0
----
0
0
0

query I rowsort
SELECT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 * - col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-1444
-576
-6241

query I rowsort
SELECT ALL - AVG ( - col0 ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL >= NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-5166
SELECT DISTINCT + col0 DIV + + col0 AS col1 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-5166
SELECT DISTINCT + col0 / + + col0 AS col1 FROM tab0 GROUP BY col0
----
1

query I rowsort
SELECT ALL - col0 * col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT col1 - - - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 WHERE NULL > + col0 * - col0 GROUP BY col1
----

query I rowsort
SELECT - 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 ALL col1 col1 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + + col1 + + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT col1 AS col0 FROM tab2 WHERE NOT + - col2 NOT BETWEEN NULL AND - col0 GROUP BY col1
----

query I rowsort
SELECT + AVG ( col2 ) FROM tab2 AS cor0 WHERE + col2 IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + + col0 FROM tab1 WHERE NOT NULL > - - col0 + - col1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 * + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col1 + col1 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1, col0
----
-44
-57
-6

query I rowsort
SELECT - col1 * col1 + col1 FROM tab2 GROUP BY col1, col1
----
-1640
-3422
-3660

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1, col2 HAVING ( - col1 ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT col2 * col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + AVG ( col2 ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + - col0 FROM tab2 WHERE - col1 IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) > col0
----

query I rowsort
SELECT col2 - - col1 FROM tab2 GROUP BY col2, col1
----
138
148
99

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col1, col2, col1
----
45
71
8

query I rowsort
SELECT + col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-5197
SELECT col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5197
SELECT col1 / + col1 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING NOT col0 <> NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 WHERE ( NULL ) NOT IN ( - col1 + + col1 ) GROUP BY col2
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col0, col0 HAVING ( NULL ) IS NULL
----
44
57
6

query I rowsort
SELECT - col1 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING - + col1 IS NULL
----

query II rowsort
SELECT + col2, + col2 AS col0 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT col2 + + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - - col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT + col1 - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING + + AVG ( - col2 ) IS NOT NULL
----
15
91
92

query II rowsort
SELECT ALL col0 * - col0, col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-1849
43
-676
26
-6889
83

query I rowsort
SELECT - + col0 FROM tab2 WHERE NULL >= NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col1 * + col1 AS col0 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col1 + col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 * col2 AS col1 FROM tab1 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
2025
5041
64

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL NOT BETWEEN + AVG ( DISTINCT + col2 ) AND ( NULL )
----

query I rowsort
SELECT - col2 + - + col2 AS col0 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col0, col2 HAVING col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col2 FROM tab1 AS cor0 WHERE ( NULL ) >= NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NOT col0 IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 * AVG ( ALL + col2 ) FROM tab2 AS cor0 GROUP BY col2, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col0 - - col1 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
133
150
76

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
24
38
79

query I rowsort
SELECT + col1 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col1
----
132
1596
3608

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
22
28
82

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0, col1, col0 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * - - col2 col0 FROM tab2 cor0 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT col0 * - col0 AS col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col2 * - + col2 * col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-357911
-512
-91125

query I rowsort
SELECT col1 FROM tab0 WHERE NULL >= NULL GROUP BY col0, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col0 HAVING ( NULL ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + col1 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT + col0 + + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 + col0 * - col0 AS col0 FROM tab2 GROUP BY col0
----
-210
-8190
-8372

query I rowsort
SELECT ALL col2 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL col2 * - col2 * col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-1408
-413362
-56700

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 * col0 FROM tab0 GROUP BY col0 HAVING ( - + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 AS col2, - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT col0 * col0 FROM tab2 GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + col2 col2 FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

query I rowsort
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0, col1
----
22
28
82

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query II rowsort
SELECT - col1 * + + col1, + AVG ( + col1 ) FROM tab2 WHERE NOT ( NULL IS NULL ) GROUP BY col1
----

query I rowsort
SELECT + col2 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NULL < - col2
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL = + col1
----

query I rowsort
SELECT ALL AVG ( DISTINCT + col1 ) FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING NOT + + col2 IS NOT NULL
----

query II rowsort
SELECT - col0 AS col2, col0 AS col2 FROM tab0 AS cor0 WHERE NULL = ( NULL ) GROUP BY col0 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT ALL + col1 * + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col2, col2, col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
225
8281
8464

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( col1 ) IS NULL
----

query I rowsort
SELECT ALL + + col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col0 - col0 AS col1 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 WHERE NOT ( NOT ( NULL IS NOT NULL ) ) GROUP BY col1, col1 HAVING NULL = NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col2 * + col2 AS col1 FROM tab1 WHERE NULL >= - col1 GROUP BY col2
----

query I rowsort
SELECT ALL - col2 + - + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
-142
-16
-90

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL > NULL
----

query II rowsort
SELECT + col1 AS col0, + col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
44
44
57
57
6
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col0 * + - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL >= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5291
SELECT col2 DIV - col2 AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5291
SELECT col2 / - col2 AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING - col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col0 HAVING NOT - + col1 IS NOT NULL
----

query I rowsort
SELECT + col0 + - + col2 AS col0 FROM tab1 cor0 GROUP BY col0, col0, col2
----
-17
11
14

onlyif mysql # DIV for integer division: 
query I rowsort label-5297
SELECT DISTINCT + - col0 DIV + col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-5297
SELECT DISTINCT + - col0 / + col0 FROM tab1 AS cor0 GROUP BY col0
----
-1

query I rowsort
SELECT col1 + + + col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

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 col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col1 + - col1 * - col1 FROM tab0 GROUP BY col1
----
0
6642

query II rowsort
SELECT ALL col1 AS col2, 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 col1 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT AVG ( ALL - col0 ) FROM tab1 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 WHERE + col0 IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 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 DISTINCT + col2 col1 FROM tab2 WHERE NULL NOT BETWEEN col2 AND NULL GROUP BY col2, col2 HAVING NULL NOT BETWEEN + - AVG ( - col0 ) AND AVG ( - col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 + - col2 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-142
-16
-90

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT + col2 * + + col2 AS col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + col2 * + + col2 FROM tab0 GROUP BY col2, col1
----
1444
576
6241

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 * col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col1 FROM tab1 cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query II rowsort
SELECT - col1 AS col0, - col1 + - + col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0, col1
----
-81
-105
0
-38
0
-79

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + + col1 * - col1 IS NULL
----
-81
0

query I rowsort
SELECT ALL - + col0 * + col0 AS col0 FROM tab2 WHERE - + col2 * col1 IS NULL GROUP BY col1, col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 GROUP BY col2, col2, col1
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query II rowsort
SELECT ALL + col2 AS col2, col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) BETWEEN col0 AND NULL GROUP BY col0
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL AND NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 * - - col1 + col2 AS col0 FROM tab1 GROUP BY col1, col2
----
2007
3294
44

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT + col1 > NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL < ( NULL )
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 WHERE col2 > col1 GROUP BY col2
----
-71
-8

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL col2 + - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING ( col1 IS NULL )
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col0, col0, col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-5344
SELECT ALL - + col1 DIV + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5344
SELECT ALL - + col1 / + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 WHERE col1 * - col0 BETWEEN NULL AND ( NULL ) GROUP BY col0
----

query I rowsort
SELECT - col1 * - col1 FROM tab2 GROUP BY col2, col2, col1
----
1681
3481
3721

query I rowsort
SELECT col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - - col1 IS NULL
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-5350
SELECT col2 DIV + col2 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5350
SELECT col2 / + col2 FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
-26
-43
-83

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col1, col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

query II rowsort
SELECT DISTINCT + col0 + col0 AS col0, - col0 FROM tab1 AS cor0 GROUP BY col0
----
164
-82
44
-22
56
-28

query I rowsort
SELECT DISTINCT + col2 + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + col1 IS NULL
----

query I rowsort
SELECT - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NULL BETWEEN + col1 AND NULL GROUP BY col2
----

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 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT ALL + col0 * - - col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT col1 AS col1 FROM tab0 WHERE NOT ( + col0 + col2 ) <> ( col1 ) GROUP BY col0, col1
----

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2, col0
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - col0 - col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query II rowsort
SELECT ALL col0, + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
1944

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 WHERE NOT col0 IS NOT NULL GROUP BY col0, col1 HAVING NOT col0 + + col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab1 GROUP BY col1, col2 HAVING NOT - col1 NOT IN ( - + col1, + col1 )
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 col1, + col2 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
41
59
61

query I rowsort
SELECT col1 FROM tab1 GROUP BY col0, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-41
-59
-61

query I rowsort
SELECT col2 * + + col2 AS col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 * col2 IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query II rowsort
SELECT col0, col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT - col0 + + col0 AS col1 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col2 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT col1 * + col1 AS col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - col2 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5396
SELECT DISTINCT col2 DIV + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-1
0

skipif mysql # not compatible
query I rowsort label-5396
SELECT DISTINCT col2 / + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-1
0

query I rowsort
SELECT - - col0 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 - + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
0

query I rowsort
SELECT DISTINCT - col2 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0

query I rowsort
SELECT - col0 * + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT ALL col1 + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL AVG ( - + col1 ) col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL col0 + + - col2 AS col1 FROM tab0 GROUP BY col2, col0
----
-53
19
45

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NOT ( - col2 ) IS NULL
----
44
57
6

query I rowsort
SELECT col0 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col0, col0, col0
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-5418
SELECT - col0 * + + col0 DIV - + col0 AS col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif mysql # not compatible
query I rowsort label-5418
SELECT - col0 * + + col0 / - + col0 AS col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col2 * - col2 FROM tab0 GROUP BY col2, col0
----
1444
576
6241

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query II rowsort
SELECT - + col0, + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col1 FROM tab2 cor0 GROUP BY col0 HAVING ( NOT NULL >= NULL )
----

query I rowsort
SELECT - AVG ( col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT ( + col2 - col0 ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col1 + col1 * col1 FROM tab2 GROUP BY col1
----
1722
3540
3782

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * col2 col1 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query II rowsort
SELECT DISTINCT + col2 * - - col2 AS col2, col2 AS col1 FROM tab2 GROUP BY col2
----
3364
58
6241
79
7569
87

query I rowsort
SELECT ALL + + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col0 * - col0 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col1 FROM tab1 cor0 WHERE + col2 BETWEEN NULL AND + col1 GROUP BY col1
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 * + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT - col0 * + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 cor0 GROUP BY col0, col0 HAVING ( NULL ) < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5437
SELECT DISTINCT col0 DIV + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-5437
SELECT DISTINCT col0 / + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
1

query II rowsort
SELECT - col2, col2 FROM tab2 GROUP BY col2, col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT - + col2 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query II rowsort
SELECT DISTINCT col2 AS col0, col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

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 ALL + col0 FROM tab2 GROUP BY col0, col1, col2 HAVING NOT ( ( NULL IS NOT NULL ) )
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col2, col0
----
-41
-59
-61

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + - col2 AS col1 FROM tab1 cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query II rowsort
SELECT DISTINCT col2, col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - AVG ( ALL col1 ) col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT - - col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col0 FROM tab1 cor0 WHERE NOT ( NULL <= NULL ) GROUP BY col0
----

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL - - col2 * + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT DISTINCT - col2 * - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 WHERE - + col0 * - col0 IS NULL GROUP BY col1
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT col0 + + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
166
52
86

onlyif mysql # DIV for integer division: 
query I rowsort label-5468
SELECT col2 DIV col0 FROM tab1 cor0 GROUP BY col0, col2
----
0
0
1

skipif mysql # not compatible
query I rowsort label-5468
SELECT col2 / col0 FROM tab1 cor0 GROUP BY col0, col2
----
0
0
1

query I rowsort
SELECT ALL - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col1 * - + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
2565
3124
48

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL - + col2 * + + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-3364
-6241
-7569

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL col0 * - col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - - col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 WHERE NOT ( col2 ) IS NULL GROUP BY col2, col2
----
58
79
87

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 + 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 DISTINCT col1 col1 FROM tab1 cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT col2 + + col2 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0, - col0 col1 FROM tab1 GROUP BY col1, col0, col2
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - + col2 - - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
0
0
0

query II rowsort
SELECT + col1, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) = ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT col2 + - col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-19
-45
53

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 ALL col2 col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL < + + col0 - col2
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL - col1 + + - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT + - col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * col2 - + col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT col1 * - col1 + - col1 FROM tab2 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT + col2 * + col2 FROM tab0 GROUP BY col0, col2, col2, col1 HAVING NOT NULL NOT BETWEEN - col1 AND NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 cor0 WHERE col0 > - - col2 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + + col0 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
182
184
30

query I rowsort
SELECT ALL - - col2 * - col2 * + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 WHERE NOT - col0 IS NULL GROUP BY col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + + col2 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
126
28
85

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-5521
SELECT + col1 DIV + - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5521
SELECT + col1 / + - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 GROUP BY col2, col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT col2 ) / col0 AS col1 FROM tab2 WHERE NOT NULL > ( NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 - + - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
158
48
76

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
41
59
61

query II rowsort
SELECT col1 AS col2, + col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT col1 * col1 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
45
71
8

onlyif mysql # DIV for integer division: 
query II rowsort label-5542
SELECT col1, col1 DIV - - col1 AS col0 FROM tab2 GROUP BY col1
----
41
1
59
1
61
1

skipif mysql # not compatible
query II rowsort label-5542
SELECT col1, col1 / - - col1 AS col0 FROM tab2 GROUP BY col1
----
41
1
59
1
61
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - col0 IS NOT NULL
----
0
81

query I rowsort
SELECT - - col0 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col0 * - col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
225
8281
8464

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 cor0 WHERE col2 IS NULL GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 * - col2 AS col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT ALL + + col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT - AVG ( + col2 ) <> NULL
----

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col2 - + - col1 FROM tab2 GROUP BY col1, col2, col1
----
138
148
99

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 WHERE NOT + col1 > NULL GROUP BY col2
----

query I rowsort
SELECT + + col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col0, col1, col1 HAVING NOT AVG ( ALL + + col0 ) IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 AS cor0 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 ALL + col0 * col1 - col1 AS col1 FROM tab1 GROUP BY col0, col1
----
126
1539
3564

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1, col2, col2
----
44
57
6

query I rowsort
SELECT - - col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( col2 ) <= NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col2 - - col1 FROM tab1 GROUP BY col1, col2 HAVING NOT + col1 IS NULL
----
102
115
14

query I rowsort
SELECT col1 FROM tab0 GROUP BY col0, col1, col2
----
0
0
81

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT - - col0 + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT + col1 * col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - col1 * col2 FROM tab2 GROUP BY col1, col2
----
-2378
-4661
-5307

query I rowsort
SELECT col0 FROM tab2 WHERE NOT + + col1 < + - col0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col0, col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * col1 col1 FROM tab0 GROUP BY col2, col1
----
-1944
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT col0 * + + col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 * + - col1 FROM tab1 GROUP BY col1, col2
----
-2565
-3124
-48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 WHERE + col2 IS NOT NULL GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col1 HAVING col1 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING NOT AVG ( + col2 ) IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL AVG ( ALL - col2 ) AS col0 FROM tab0 WHERE NOT ( - col2 ) BETWEEN ( NULL ) AND NULL GROUP BY col2 HAVING NULL BETWEEN + col0 AND ( NULL )
----

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2, col2, col1
----
-58
-79
-87

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
0
0
81

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE - col1 IS NULL AND col1 * + + col0 IS NULL GROUP BY col2
----

query II rowsort
SELECT + - col1 AS col0, col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT + col0 * - - col0 FROM tab0 GROUP BY col0 HAVING NULL > col0
----

query I rowsort
SELECT + AVG ( + col1 ) FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL = - - col0
----

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 DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 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
----
-182
-184
-30

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT col2 * + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

onlyif mysql # DIV for integer division: 
query I rowsort label-5612
SELECT + col2 DIV col2 FROM tab2 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5612
SELECT + col2 / col2 FROM tab2 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col2, col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab0 cor0 WHERE ( NULL ) <> NULL GROUP BY col0, col2
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT - - col1 - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT - 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 + col0 col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0 HAVING NOT NULL IS NULL OR NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col1, col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING col0 / col1 IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 WHERE ( col0 ) <> ( + col0 ) GROUP BY col1 HAVING NOT NULL >= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5622
SELECT col1 DIV + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5622
SELECT col1 / + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT - col1 FROM tab0 cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - col0 + col0 AS col1 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT + col0 * - - col0 FROM tab2 WHERE NOT NULL = NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1 HAVING NOT + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL <= - - col0
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 + col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NOT NULL
----
118
122
82

onlyif mysql # DIV for integer division: 
query I rowsort label-5639
SELECT DISTINCT col2 DIV col2 AS col1 FROM tab0 GROUP BY col2, col2
----
1

skipif mysql # not compatible
query I rowsort label-5639
SELECT DISTINCT col2 / col2 AS col1 FROM tab0 GROUP BY col2, col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * + col1 col2 FROM tab2 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NULL <= - col1 GROUP BY col1
----

query II rowsort
SELECT + + col1 AS col1, + col1 FROM tab2 cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + col0 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab0 WHERE NOT ( + - col2 ) IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL col2 FROM tab0 WHERE - col0 BETWEEN NULL AND ( - col0 ) GROUP BY col2, col0, col2 HAVING col2 IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( NOT NULL IS NOT NULL )
----
-41
-59
-61

query I rowsort
SELECT ALL + col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT col2 * + + col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2
----
1406
552
6162

onlyif mysql # DIV for integer division: 
query I rowsort label-5652
SELECT ALL - col0 DIV - col0 AS col1 FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5652
SELECT ALL - col0 / - col0 AS col1 FROM tab1 GROUP BY col0
----
1
1
1

query I rowsort
SELECT - + col1 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

query I rowsort
SELECT + - col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 + + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-38
-79
57

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col2 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
142
16
90

onlyif mysql # DIV for integer division: 
query I rowsort label-5665
SELECT - - col1 DIV - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5665
SELECT - - col1 / - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT ALL - + col0 FROM tab2 cor0 GROUP BY col0, col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 * + col2 + - - col2 col2 FROM tab2 GROUP BY col2
----
3422
6320
7656

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT ALL col0 * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col0 * + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT - + col2 - + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1, col2
----
45
71
8

query I rowsort
SELECT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col2, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 + - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL col2 + + + col0 AS col2 FROM tab0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT col2 FROM tab2 GROUP BY col0, col2 HAVING NULL = ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 WHERE NULL BETWEEN NULL AND NULL GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - 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 * - col1 col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query II rowsort
SELECT col2 AS col2, - col2 FROM tab0 AS cor0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT ALL + col1 + - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-5693
SELECT DISTINCT + col2 DIV - - col2 FROM tab2 cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-5693
SELECT DISTINCT + col2 / - - col2 FROM tab2 cor0 GROUP BY col2
----
1

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NOT AVG ( ALL col0 ) IS NULL
----
15
91
92

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col1, col2, col1 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - + col2 + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
0

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col0 AS col0, col1 AS col2 FROM tab1 GROUP BY col0, col1
----
22
6
28
57
82
44

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 WHERE NULL >= NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col1, col2, col2
----
58
79
87

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col1 * col1 * + col2 FROM tab1 GROUP BY col1, col2 HAVING NOT ( NOT - col2 = NULL )
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL IS NOT NULL )
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT + col2 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING ( - col2 ) IS NOT NULL
----
0
0
1944

query II rowsort
SELECT ALL - col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query II rowsort
SELECT ALL + - col1, - col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
-81
0
0

query I rowsort
SELECT DISTINCT + col2 * - - col1 AS col1 FROM tab1 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT ALL col0 * - col0 FROM tab0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col2 + - col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 * col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1032
-2054
-3154

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query II rowsort
SELECT ALL col1 AS col1, col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col1, col2, col0
----
-24
-38
-79

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col0, col2 HAVING col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL col1 * - col1 * col1 FROM tab2 GROUP BY col1
----
-205379
-226981
-68921

query I rowsort
SELECT ALL - + col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col2 BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NOT - col0 <= NULL GROUP BY col2
----

query I rowsort
SELECT ALL col1 + - - col0 AS col2 FROM tab2 GROUP BY col0, col1
----
133
150
76

query II rowsort
SELECT ALL + col0 + + col0, - col0 * + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
-6889
52
-676
86
-1849

query II rowsort
SELECT DISTINCT col0, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
15
91
91
92
92

query I rowsort
SELECT col1 * col1 * + - col1 + - + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
-531441
0
0

query I rowsort
SELECT ALL + - col0 + + AVG ( + col0 ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
0
81

query II rowsort
SELECT ALL + + col1 AS col0, + col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
162

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL IS NOT NULL )
----

query II rowsort
SELECT DISTINCT col2 AS col0, - col2 AS col2 FROM tab1 GROUP BY col2
----
45
-45
71
-71
8
-8

query I rowsort
SELECT + col0 + - col1 AS col2 FROM tab1 GROUP BY col1, col0
----
-29
16
38

query I rowsort
SELECT DISTINCT - col2 + + + col2 FROM tab1 GROUP BY col2, col2
----
0

query I rowsort
SELECT - - col2 AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT + col2 * + + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col2 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-53
19
45

query I rowsort
SELECT + col0 * col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2, col2 HAVING NULL < col1
----

query I rowsort
SELECT ALL + col2 * col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
2025
5041
64

query I rowsort
SELECT col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT + + col1 IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0 HAVING NOT + + col0 IS NULL
----
26
43
83

query I rowsort
SELECT + + col1 FROM tab2 cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col2, col1, col1
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
41
59
61

query II rowsort
SELECT col2 AS col1, col2 FROM tab1 GROUP BY col2 HAVING NOT ( col2 ) < ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT col2 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 cor0 WHERE NOT NULL <> NULL GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 + col0 AS col2 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - 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 I rowsort
SELECT + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col0, col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

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 DISTINCT + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
24
38
79

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT col2 + col0 AS col0 FROM tab0 cor0 GROUP BY col2, col0
----
105
121
67

query II rowsort
SELECT DISTINCT - col0 AS col0, + col0 * col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-15
915
-91
5369
-92
3772

query I rowsort
SELECT DISTINCT - col1 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT 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, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - col2, col2 AS col2 FROM tab2 GROUP BY col2 HAVING - col2 + - col2 > NULL
----

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT + + col1 + col1 FROM tab2 cor0 GROUP BY col0, col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 - - col0 FROM tab1 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * - + col1 col1 FROM tab1 GROUP BY col1 HAVING col1 <= NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col1, col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + + col1 col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col1 - - col1 * - - col1 AS col1 FROM tab1 GROUP BY col1
----
1892
30
3192

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING col1 / - col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 - col0 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

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-5809
SELECT col2 DIV + col2 AS col1 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5809
SELECT col2 / + col2 AS col1 FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query II rowsort
SELECT + col2, - col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING - col0 IS NOT NULL
----
24
-43
38
-83
79
-26

query I rowsort
SELECT + col1 + + - col1 + - col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING ( NULL = NULL )
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT - - col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NOT 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 - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2, col1 HAVING ( col1 ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
15
91
91
92
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query II rowsort
SELECT - - col2 + + + col2, col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
158
79
48
24
76
38

onlyif mysql # DIV for integer division: 
query I rowsort label-5824
SELECT col2 DIV + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5824
SELECT col2 / + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col0 - - col2 FROM tab0 GROUP BY col0, col2
----
105
121
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 GROUP BY col0, col0, col0 HAVING NULL >= - col0
----

query I rowsort
SELECT ALL col1 * + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col1, col2, col1
----
-24
-38
-79

query I rowsort
SELECT col2 * + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE + - col0 IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT - AVG ( + + col1 ) FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT - - col1 * + col1 + - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
6642

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT + col0 - - + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 + - + col1 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT col0 * col2 IS NOT NULL
----

query II rowsort
SELECT + - col0 AS col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
45
71
8

query II rowsort
SELECT ALL + + col0, col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
22
484
28
784
82
6724

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col1 HAVING ( NOT ( NULL ) < NULL )
----

query I rowsort
SELECT - col1 + - - col1 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-81
0
0

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col0 * - col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT + - col1 IS NULL
----
24
38
79

query II rowsort
SELECT + col0, - col0 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col1, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 - + + col1 col1 FROM tab2 GROUP BY col1, col0, col1
----
-46
32
51

query I rowsort
SELECT - - col0 * - col0 FROM tab1 cor0 GROUP BY col0, col1
----
-484
-6724
-784

query II rowsort
SELECT + col1 AS col0, col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT ( NULL IS NOT NULL )
----
-26
-43
-83

query II rowsort
SELECT + - col1 * - col1 AS col1, + col2 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
0
38
0
79
6561
24

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col0 * col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT + col1 * - + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col0, col1, col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * + col0 AS col1 FROM tab0 GROUP BY col2, col0
----
1849
676
6889

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col0
----
26
43
83

query II rowsort
SELECT + col2, col2 FROM tab2 cor0 GROUP BY col2, col2
----
58
58
79
79
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL AND NOT ( NULL >= ( NULL ) )
----

query I rowsort
SELECT DISTINCT + col1 * - col1 * - col1 FROM tab0 GROUP BY col1, col1
----
0
531441

query II rowsort
SELECT ALL col1 + - col1, - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
-24
0
-38
0
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * + col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
1444
576
6241

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

query II rowsort
SELECT ALL + col0 AS col1, col0 FROM tab0 GROUP BY col0, col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 * - col1 * col1 AS col1 FROM tab1 GROUP BY col1
----
-185193
-216
-85184

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + col0 + col0 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND - col2 * + col0 GROUP BY col0
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 WHERE - col0 IN ( - col2 ) GROUP BY col0
----

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL = NULL OR NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT + - col0 FROM tab2 AS cor0 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 - + col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
0
81

query I rowsort
SELECT + col0 + + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 GROUP BY col2, col0, col2
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-5904
SELECT DISTINCT col0 DIV col0 FROM tab0 cor0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-5904
SELECT DISTINCT col0 / col0 FROM tab0 cor0 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col0, col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN col2 AND NULL
----

query I rowsort
SELECT ALL col1 + col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
162

query I rowsort
SELECT - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - col1 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2, col0 HAVING NOT ( + + col0 ) IS NULL
----
24
38
79

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + + col2 AS col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT - col1 * col1 FROM tab0 cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col2 * + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL + col2 + - col2 FROM tab0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

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 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
79
87

query I rowsort
SELECT ALL AVG ( + col0 ) FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 - - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
182
184
30

query I rowsort
SELECT ALL + col2 + + + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab1 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab0 WHERE NOT col1 NOT IN ( col1 ) GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col2 * col0 AS col0 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query II rowsort
SELECT DISTINCT + col2 + - col2 AS col2, col0 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query II rowsort
SELECT ALL col0 * + col1, col0 FROM tab2 GROUP BY col0, col1
----
3772
92
5369
91
915
15

query II rowsort
SELECT DISTINCT - col1, - col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT - col0 FROM tab0 WHERE - col1 IS NOT NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + col2 col0 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING - col2 IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + col2 + + - col2 + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( NULL IS NULL )
----
-44
-57
-6

query I rowsort
SELECT + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT - + col2 + - - col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT + col2 / col0 AS col1, AVG ( + + col2 ) FROM tab1 AS cor0 GROUP BY col2, col0 HAVING col2 * + + col2 + col2 IS NULL
----

query I rowsort
SELECT col1 * - col1 AS col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT - - col1 * - col1 - - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1892
-30
-3192

query I rowsort
SELECT ALL + col1 * + - col1 * + col1 FROM tab2 AS cor0 WHERE NULL BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT col1 + + + col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-45
-71
-8

query II rowsort
SELECT DISTINCT - col0 * - col0, col0 FROM tab1 GROUP BY col0
----
484
22
6724
82
784
28

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query II rowsort
SELECT ALL - col1 AS col0, col0 * + + col0 AS col1 FROM tab1 GROUP BY col0, col1
----
-44
6724
-57
784
-6
484

query I rowsort
SELECT - col0 + - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-126
-28
-85

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + col0 - col2 AS col2 FROM tab0 GROUP BY col0, col2
----
-53
19
45

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0 HAVING ( NULL ) IS NULL
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT + - col0 AS col0 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL IN ( + AVG ( DISTINCT col2 ) ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 cor0 GROUP BY col0 HAVING + AVG ( + col2 ) IS NULL
----

query I rowsort
SELECT - + col2 FROM tab1 cor0 GROUP BY col2, col0
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-5984
SELECT col2 DIV + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NOT - col2 IS NULL
----
0
1
1

skipif mysql # not compatible
query I rowsort label-5984
SELECT col2 / + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col2 HAVING NOT - col2 IS NULL
----
0
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-5985
SELECT DISTINCT col2 DIV col1 AS col2 FROM tab1 GROUP BY col2, col1
----
0
1

skipif mysql # not compatible
query I rowsort label-5985
SELECT DISTINCT col2 / col1 AS col2 FROM tab1 GROUP BY col2, col1
----
0
1

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col0, col0
----

query I rowsort
SELECT - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab1 GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-6561
0

query I rowsort
SELECT ALL + col2 * + col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 + - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND col2
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col0 HAVING col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 + + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col2 * - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - col0 + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-19
-45
53

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT ( + col2 IS NULL )
----
24
38
79

query II rowsort
SELECT col2 AS col1, - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + + col1 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6005
SELECT ALL + col0 * + col0 * - col1 AS col2, - col1 DIV col1 FROM tab2 GROUP BY col0, col1
----
-13725
-1
-347024
-1
-488579
-1

skipif mysql # not compatible
query II rowsort label-6005
SELECT ALL + col0 * + col0 * - col1 AS col2, - col1 / col1 FROM tab2 GROUP BY col0, col1
----
-13725
-1
-347024
-1
-488579
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 * + + col0 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

query I rowsort
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 WHERE NOT ( + col0 + col1 ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col0, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - col1 * + col1 AS col2 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + col0 - col0 FROM tab0 AS cor0 WHERE NULL <> NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query II rowsort
SELECT + col0 AS col0, + col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col0 + + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 / col1 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 AS col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col0, col0, col1 HAVING - AVG ( - - col1 ) IS NOT NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-6029
SELECT ALL + col1 DIV + + col1 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6029
SELECT ALL + col1 / + + col1 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL <> NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT ALL col1 + - col1 * - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - AVG ( - + col0 ) FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 + - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 WHERE NULL <= + col0 GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
15
91
92

query I rowsort
SELECT - col1 * col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NULL <> ( + col2 )
----

query I rowsort
SELECT ALL - col1 * - + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - + col0 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 WHERE NOT + col0 IN ( col1 ) GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT col2 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 + + col2 col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
142
16
90

query I rowsort
SELECT + col2 + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col2, col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 * col0 AS col1 FROM tab2 AS cor0 WHERE NOT col0 * + col0 IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT + col0 + - col0 AS col2, - col0 * col0 FROM tab2 GROUP BY col0
----
0
-225
0
-8281
0
-8464

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1 HAVING NULL = NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + AVG ( ALL + - col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col1 + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
162

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + col2 * col2 FROM tab2 cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT ( ( NOT - AVG ( - col2 ) IS NULL ) )
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + col1 * + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + + col0 + + - col0 FROM tab2 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT + + col0 + col0 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0, col1
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING + col1 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col1 + + col0 FROM tab1 GROUP BY col1, col0
----
126
28
85

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * + col2 col1 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IN ( - col1 )
----

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-58
-79
-87

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2 HAVING NOT + - col2 <> ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col2, col0, col1 HAVING ( col0 >= NULL )
----

query I rowsort
SELECT - col2 + - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) <> ( NULL )
----

query I rowsort
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + + col0 IS NULL
----
22
28
82

query II rowsort
SELECT col2, col0 * + col2 AS col2 FROM tab1 GROUP BY col2, col0
----
45
1260
71
5822
8
176

query I rowsort
SELECT DISTINCT - - col2 - + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + - - col1 col0 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col1 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query II rowsort
SELECT ALL + col2, - col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
-784
71
-6724
8
-484

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col0 * col0 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * + - col1 * col0 AS col0 FROM tab2 GROUP BY col2, col0, col1
----
-13725
-347024
-488579

query I rowsort
SELECT col2 FROM tab1 WHERE ( NULL ) >= ( NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT + AVG ( col1 ) AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 / col2 AS col2 FROM tab0 WHERE NULL IN ( - col0 ) GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 WHERE col2 IS NULL GROUP BY col1, col2 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col1 + col1 - + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + col0 ) AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col1 HAVING col2 IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) > ( AVG ( DISTINCT col0 ) )
----

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 + - col2 AS col1 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query II rowsort
SELECT col0 AS col0, + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
6
28
57
82
44

query I rowsort
SELECT DISTINCT col0 + + - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 + + - col1 + + col1 FROM tab2 GROUP BY col1
----
41
59
61

query II rowsort
SELECT DISTINCT AVG ( - col2 ) AS col1, + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL < ( NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 * + + col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 + - col1 * - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
2025

onlyif mysql # DIV for integer division: 
query I rowsort label-6135
SELECT DISTINCT + col1 DIV - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1
0

skipif mysql # not compatible
query I rowsort label-6135
SELECT DISTINCT + col1 / - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL col2 / - col2 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + - - col2 AS col1 FROM tab2 GROUP BY col1, col2
----
17
20
26

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NOT - col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 + - col0 FROM tab2 GROUP BY col0 HAVING NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 + - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-126
-28
-85

query I rowsort
SELECT - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - col2 + + - col2 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE ( + + col2 IS NOT NULL ) GROUP BY col2, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT - - col1 - + + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col2
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-6152
SELECT DISTINCT + col2 DIV - + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-1
0

skipif mysql # not compatible
query I rowsort label-6152
SELECT DISTINCT + col2 / - + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-1
0

query II rowsort
SELECT + + col2, col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL < col1 * - AVG ( + col1 )
----

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT - col2 ) FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - col2 + col2 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + - col2 AS col2 FROM tab2 cor0 WHERE col2 IS NOT NULL GROUP BY col1, col2
----
-58
-79
-87

query II rowsort
SELECT ALL col1 * col2 + col1 AS col1, + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2622
45
3168
71
54
8

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1 HAVING - col2 IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + - col1 + - col1 col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 * - col1 AS col1 FROM tab1 GROUP BY col1, col2
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1 HAVING NOT - col0 < ( + AVG ( ALL - + col1 ) )
----
43

query I rowsort
SELECT ALL col2 FROM tab0 WHERE + col0 < NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col1 HAVING ( - AVG ( DISTINCT col1 ) ) IS NULL
----

query I rowsort
SELECT col1 * - - col1 AS col0 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
26
43
83

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) > - col0
----

query I rowsort
SELECT DISTINCT + col0 / col1 - + col1 AS col0 FROM tab2 GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab2 WHERE NULL >= NULL GROUP BY col2
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-6178
SELECT ALL col1 DIV + col1 FROM tab1 cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6178
SELECT ALL col1 / + col1 FROM tab1 cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
26
43
83

query I rowsort
SELECT + col1 FROM tab2 WHERE + col0 IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT + - col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT AVG ( ALL + col0 ) FROM tab0 AS cor0 GROUP BY col0, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT + col2 FROM tab0 WHERE NULL > NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT ALL - col0 + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-12
-34
72

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
45
71
8

query I rowsort
SELECT ALL - - col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING col0 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT + + col1, - col2 * + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
-2378
59
-4661
61
-5307

query I rowsort
SELECT ALL col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab1 AS cor0 WHERE + col0 IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab1 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 + col2 + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * - col1 AS col2 FROM tab0 GROUP BY col1, col0
----
-6561
0
0

query I rowsort
SELECT col2 + + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT ALL - AVG ( ALL - col0 ) FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col1 col2 FROM tab2 WHERE NOT - col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query II rowsort
SELECT - col2, - col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col0, col1 HAVING NOT ( NULL IS NOT NULL )
----
-81
0
0

query II rowsort
SELECT - col2, col2 * - AVG ( + col2 ) FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( NULL ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 + col0, col0 AS col1 FROM tab0 GROUP BY col0
----
166
83
52
26
86
43

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col0, col2, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + AVG ( DISTINCT col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

query I rowsort
SELECT + col0 + - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - + col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col2, col0, col1 HAVING NOT col0 IS NULL
----
22
28
82

query I rowsort
SELECT ALL + + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL - col0 * col0 AS col1 FROM tab1 GROUP BY col0, col0, col0
----
-484
-6724
-784

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 - col0 + + col0 + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - + col1 col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS 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 ALL + - col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-15
-91
-92

query II rowsort
SELECT DISTINCT col2 - + col2 AS col1, + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
0
24
0
38
0
79

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 WHERE ( col2 ) >= NULL GROUP BY col1
----

query I rowsort
SELECT + col1 * + + col2 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NULL NOT BETWEEN NULL AND ( NULL ) GROUP BY col1, col0, col2
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT + - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 WHERE NOT ( col0 ) > ( NULL ) GROUP BY col0, col0, col2
----

query I rowsort
SELECT ALL - + col0 * col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT + col1 * - + col1 - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6642
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - + col1 IS NULL
----
41
59
61

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL col2 * + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
1260
176
5822

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col1 AS col1, col1 col1 FROM tab1 cor0 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE ( col0 ) IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col1 - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2 HAVING + col2 IS NOT NULL
----
-58
-79
-87

onlyif mysql # DIV for integer division: 
query I rowsort label-6262
SELECT - col1 DIV + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6262
SELECT - col1 / + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - - col1 + + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query II rowsort
SELECT ALL - col2 AS col2, col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 cor0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT DISTINCT - col1 * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE ( col1 ) IS NULL GROUP BY col2, col2, col2
----

query I rowsort
SELECT DISTINCT col2 - + + col2 AS col2 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT - - col1 AS col0 FROM tab1 WHERE ( col2 > - col2 ) GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query II rowsort
SELECT - - col2 + + col2 * + - col2, col2 FROM tab0 AS cor0 GROUP BY col2
----
-1406
38
-552
24
-6162
79

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING + col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING col2 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING + + col2 < NULL
----

query I rowsort
SELECT + AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL <> NULL )
----

query I rowsort
SELECT col2 * + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col2 + + col2 AS col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 / - - col2 * col2 + - col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL NOT BETWEEN - + col2 AND NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 * + + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL >= col2
----

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + AVG ( DISTINCT col1 ) FROM tab1 GROUP BY col1, col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL - - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT + col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col1 + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL >= - col1
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT ( ( + col1 ) IS NULL )
----
41
59
61

query I rowsort
SELECT ALL + col0 * + col1 FROM tab0 GROUP BY col0, col1
----
0
0
3483

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col0, col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL + col0 + - + col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col0 * - col2 FROM tab1 cor0 GROUP BY col0, col2
----
-1260
-176
-5822

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT + col1 + + col1 AS col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT - col2 + + col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col0, col2
----

query II rowsort
SELECT col1, col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
41
59
59
61
61

query I rowsort
SELECT ALL - col0 * + col0 + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
-440
-6560
-728

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT ALL + col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT - col2 * - col2 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1, col0
----
-81
0
0

query II rowsort
SELECT DISTINCT + col1 + col1, AVG ( - + col1 ) FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-6315
SELECT - + col1 DIV col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6315
SELECT - + col1 / col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + + col0 * + + col0 * col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab0 GROUP BY col0, col0, col0
----
26
43
83

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 NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 GROUP BY col1 HAVING - col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + AVG ( - col2 ) FROM tab1 GROUP BY col2, col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col2, col0, col0
----
26
43
83

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 + - col1 col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 + + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
142
16
90

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 + - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT ( col2 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT col1 * - + col0 AS col0 FROM tab1 GROUP BY col0, col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT + col1 + + - col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT ALL col2 + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 + - col0 FROM tab0 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-166
-52
-86

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT ALL - col0 * + AVG ( col0 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 WHERE NOT NULL >= ( + col1 ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT col2 AS col1 FROM tab2 WHERE col0 + col0 <= NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT - col1 * col1 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING col0 IS NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

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 - col2 * - + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT ALL - col0 * - - col0 AS col2 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query II rowsort
SELECT + col0, col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 AS col2 FROM tab1 cor0 WHERE NOT NULL >= ( NULL ) GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( + col2 ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6356
SELECT - col2 + + col2 DIV + - col2 FROM tab0 GROUP BY col2
----
-25
-39
-80

skipif mysql # not compatible
query I rowsort label-6356
SELECT - col2 + + col2 / + - col2 FROM tab0 GROUP BY col2
----
-25
-39
-80

query I rowsort
SELECT + col2 FROM tab1 cor0 WHERE ( - col2 * col1 < NULL ) GROUP BY col1, col1, col2
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query II rowsort
SELECT - col0, - col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * - col2 col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 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 col2 + col2 col2 FROM tab0 GROUP BY col2
----
158
48
76

onlyif mysql # DIV for integer division: 
query II rowsort label-6368
SELECT col2 DIV col2 + + + col2 AS col0, + col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
25
576
39
1444
80
6241

skipif mysql # not compatible
query II rowsort label-6368
SELECT col2 / col2 + + + col2 AS col0, + col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
25
576
39
1444
80
6241

query I rowsort
SELECT + col2 FROM tab1 WHERE NOT col2 IS NULL GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT AVG ( + col0 ) * + col0 - - col0 * + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 - - col0 * - col1 FROM tab0 GROUP BY col1, col0
----
-3402
0

query I rowsort
SELECT ALL - col1 + col1 * + - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-1722
-3540
-3782

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col1 + - col0 FROM tab1 GROUP BY col0, col2, col1
----
-16
-38
29

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL + col0 * + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * + + col2 AS col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - + col0 - - col0 * + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-506
-6806
-812

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col2 FROM tab0 cor0 GROUP BY col0, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 WHERE NOT NULL > NULL GROUP BY col1
----

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 * col0 + + - col0 FROM tab1 GROUP BY col0
----
-506
-6806
-812

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col2 - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
-12
2
27

query I rowsort
SELECT col1 + + col1 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col1, col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-6401
SELECT ALL + col0 DIV + - col0 FROM tab0 cor0 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6401
SELECT ALL + col0 / + - col0 FROM tab0 cor0 GROUP BY col0, col0
----
-1
-1
-1

query II rowsort
SELECT DISTINCT + col2, - col2 FROM tab1 GROUP BY col2
----
45
-45
71
-71
8
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, - col1 col0 FROM tab0 GROUP BY col1, col2
----
-24
-81
-38
0
-79
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col1 FROM tab2 WHERE NOT - col0 IS NULL GROUP BY col1 HAVING NOT col1 IS NULL
----
41
59
61

query I rowsort
SELECT col0 AS col0 FROM tab2 WHERE ( NULL ) >= ( NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-6407
SELECT ALL - col0 DIV + col0 FROM tab1 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6407
SELECT ALL - col0 / + col0 FROM tab1 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT AVG ( + - col1 ) FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL OR NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT col1 * - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0, col0 HAVING col0 IS NOT NULL
----
22
28
82

query II rowsort
SELECT + - AVG ( DISTINCT col0 ), + col0 + + + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col0 AS col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 WHERE col2 IS NOT NULL GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 AS cor0 WHERE col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 WHERE NOT NULL >= NULL GROUP BY col1, col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 col1, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0, col2
----
45
71
8

query I rowsort
SELECT ALL col1 / - col1 FROM tab2 WHERE NOT ( - col0 ) >= NULL GROUP BY col1
----

query I rowsort
SELECT col0 + col1 AS col1 FROM tab2 cor0 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col0, col1, col0 HAVING ( NULL ) IS NOT 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

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - + col2 + - col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
-142
-16
-90

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-6437
SELECT ALL + col1 + - + col1 DIV + + col1 FROM tab2 AS cor0 GROUP BY col1
----
40
58
60

skipif mysql # not compatible
query I rowsort label-6437
SELECT ALL + col1 + - + col1 / + + col1 FROM tab2 AS cor0 GROUP BY col1
----
40
58
60

query II rowsort
SELECT DISTINCT - col1, col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT AVG ( + col1 ) * AVG ( + + col1 ) col2, - col0 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
1681
-92
3481
-91
3721
-15

query II rowsort
SELECT col1, col1 * + col1 AS col2 FROM tab0 GROUP BY col1
----
0
0
81
6561

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-41
-59
-61

query I rowsort
SELECT AVG ( ALL col0 ) FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT - - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT AVG ( - col2 ) IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN ( col2 ) AND ( NULL ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 - + col1 FROM tab1 GROUP BY col1, col2
----
-114
-12
-88

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NOT NULL IN ( - col0 ) GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT + + AVG ( ALL col0 ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 + + - col0 * - + col0 FROM tab2 cor0 GROUP BY col0
----
210
8190
8372

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - - col1 AS col1, - col1 * + col1 AS col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
-1681
59
-3481
61
-3721

query I rowsort
SELECT DISTINCT col1 + col1 AS col1 FROM tab1 WHERE NOT NULL = NULL GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 GROUP BY col1 HAVING NOT NULL = col1
----

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col2, col1, col1
----
41
59
61

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - col0 + - - col0 FROM tab2 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col2, col2
----
44
57
6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT - col2 <= NULL
----

query I rowsort
SELECT DISTINCT + col2 * + col2 * + col2 FROM tab0 GROUP BY col2
----
13824
493039
54872

query I rowsort
SELECT + col0 AS col0 FROM tab1 WHERE NOT + col1 IN ( col0 ) GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6475
SELECT DISTINCT + col2 DIV col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-6475
SELECT DISTINCT + col2 / col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * col2 col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1032
-2054
-3154

query I rowsort
SELECT AVG ( col2 ) FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - + col2 AS col0, + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING + AVG ( ALL - col1 ) <= NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 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 DISTINCT + + col1 col2 FROM tab0 WHERE - col0 < NULL GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 col1, col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
58
79
79
87
87

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL < NULL
----

query I rowsort
SELECT + + col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL col1 + + + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
114
12
88

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 * - - col2 FROM tab0 GROUP BY col1, col2
----
0
0
1944

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * - col1 + - col1 * - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING + col2 > NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( - AVG ( - col2 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

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 col0, col0 HAVING NULL > ( col1 )
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2, col2 * - col2 col0 FROM tab0 GROUP BY col2
----
24
-576
38
-1444
79
-6241

query I rowsort
SELECT ALL col1 - + col1 AS col0 FROM tab1 GROUP BY col1, col1, col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

query II rowsort
SELECT col1, - col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN ( NULL ) AND + - col1
----

query I rowsort
SELECT DISTINCT - col0 AS col2 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 + col0 col1 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 AS cor0 WHERE NOT NULL <= ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col0 FROM tab0 WHERE NOT - col0 = NULL GROUP BY col0
----

query I rowsort
SELECT - col1 + + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
17
20
26

query I rowsort
SELECT col1 + - col1 AS col0 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + col0 * - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * - col2 col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 WHERE NOT col0 + col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 + - col1 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query II rowsort
SELECT col0, col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT + col2 * + + col2 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
3422
6320
7656

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
105
121
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 GROUP BY col1, col2 HAVING + col1 > NULL
----

query I rowsort
SELECT + col2 - + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
17
20
26

onlyif mysql # DIV for integer division: 
query I rowsort label-6536
SELECT col2 DIV + + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6536
SELECT col2 / + + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
1
1
1

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING AVG ( col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col2, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - col0 / - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6543
SELECT col1 + col1 * + col1 DIV - col1 FROM tab2 GROUP BY col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-6543
SELECT col1 + col1 * + col1 / - col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING + - col2 IS NULL
----

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col1 + col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + + col0 col2 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1, col2, col2
----
41
59
61

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NOT - AVG ( ALL + col0 ) + - col2 = AVG ( ALL - col1 ) )
----
45
71
8

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - col1 col1 FROM tab2 GROUP BY col1, col2
----
-1681
-3481
-3721

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
-81
0

query I rowsort
SELECT - AVG ( col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = - AVG ( DISTINCT + - col0 )
----

query I rowsort
SELECT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 * col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 WHERE - col1 IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT col1 - col1 - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT col2 / - col2 + + col0 <> NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NOT NULL IS NOT NULL )
----
41
59
61

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 WHERE NULL BETWEEN NULL AND ( NULL ) GROUP BY col2
----

query I rowsort
SELECT ALL col0 * + + col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING + - col0 IS NOT NULL
----
-81
0
0

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + col1 col0 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2, col0, col0
----
45
71
8

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0
81

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 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col1, col0, col2
----
58
79
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - AVG ( ALL col2 ) AS col1 FROM tab1 GROUP BY col2, col2 HAVING ( NULL ) BETWEEN NULL AND ( col1 )
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 AS col1 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL + col1 + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
118
122
82

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab1 GROUP BY col2, col0
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT - - col1 + + col2 + + + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
140
197
209

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 * - - col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING NOT + + AVG ( DISTINCT - col2 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-6592
SELECT DISTINCT col0 DIV + + col0 FROM tab1 cor0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-6592
SELECT DISTINCT col0 / + + col0 FROM tab1 cor0 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT AVG ( ALL - col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col2 * + col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL col1 / col1 + col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL < NULL
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6600
SELECT DISTINCT + col0, col0 * col0 DIV + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
22
28
28
82
82

skipif mysql # not compatible
query II rowsort label-6600
SELECT DISTINCT + col0, col0 * col0 / + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col1 * col2 + - - col1 + - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING - + col0 <> NULL
----

query I rowsort
SELECT DISTINCT - col1 + - col2 AS col0 FROM tab0 GROUP BY col1, col2, col2
----
-105
-38
-79

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1, col1, col0
----
-44
-57
-6

query II rowsort
SELECT + col2, - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE NULL IS NULL GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT + col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col2 - + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-102
-150
-170

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query II rowsort
SELECT - + col0, col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
-26
-43
-83

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 * - col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL BETWEEN NULL AND NULL )
----

query I rowsort
SELECT - col2 * col2 FROM tab1 cor0 GROUP BY col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col2 * col2 AS col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT AVG ( DISTINCT + - col0 ) FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT col1 * - col1 + - + col1 AS col1 FROM tab1 GROUP BY col1
----
-1980
-3306
-42

query I rowsort
SELECT DISTINCT + - col0 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
0

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 * col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab1 WHERE ( col2 ) IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT + col0 + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
166
52
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col1 AS col1, + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query II rowsort
SELECT ALL col0, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 GROUP BY col1, col2 HAVING NOT col1 IS NULL
----
45
71
8

query II rowsort
SELECT col0, col0 AS col1 FROM tab0 GROUP BY col0, col1 HAVING col0 IS NOT NULL
----
26
26
43
43
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * + col1 col1 FROM tab1 GROUP BY col1, col2
----
1936
3249
36

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL col2 * - col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-6649
SELECT ALL col0 DIV - col0 FROM tab0 GROUP BY col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6649
SELECT ALL col0 / - col0 FROM tab0 GROUP BY col1, col0
----
-1
-1
-1

query II rowsort
SELECT + col0, col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 FROM tab0 GROUP BY col0, col1, col1 HAVING NULL IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + + col2 col0 FROM tab0 GROUP BY col2, col2
----
0

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( ( NULL ) IS NOT NULL )
----
0
81

query II rowsort
SELECT col1, col1 * - - col1 FROM tab2 GROUP BY col1, col2
----
41
1681
59
3481
61
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 AS col1, col1 * - col1 col2 FROM tab1 GROUP BY col1
----
-44
-1936
-57
-3249
-6
-36

query II rowsort
SELECT col0 AS col0, col0 FROM tab0 GROUP BY col0, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT - col0 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab0 cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

query I rowsort
SELECT ALL + col1 + + - col0 * col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
-3731
-5310
-854

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT - - col1 / col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6675
SELECT DISTINCT - col0 DIV - col0 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-6675
SELECT DISTINCT - col0 / - col0 FROM tab0 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL <> - AVG ( col1 )
----

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + - col1 + + - col2 FROM tab2 cor0 GROUP BY col1, col2
----
-138
-148
-99

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 WHERE NULL NOT IN ( col2 ) GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT + + col0 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL >= ( NULL )
----

query II rowsort
SELECT - col0, col0 FROM tab2 GROUP BY col0, col1, col2
----
-15
15
-91
91
-92
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + + col2 col1 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT ( col0 ) >= NULL
----

query I rowsort
SELECT - col1 + - - col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT col1 - + col1 = col1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
162

query I rowsort
SELECT - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col2, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6697
SELECT col2 DIV col2 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6697
SELECT col2 / col2 FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 cor0 WHERE + col2 <= + col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 + + col1 AS col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 + - + col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT + - col2 + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
0

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) <> ( NULL )
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6707
SELECT DISTINCT col2 DIV - col2 AS col1 FROM tab0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-6707
SELECT DISTINCT col2 / - col2 AS col1 FROM tab0 GROUP BY col2
----
-1

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL col2 + - - col2 AS col1 FROM tab0 GROUP BY col2
----
158
48
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING col1 > NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
15
91
92

query I rowsort
SELECT - 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 col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
0
81

query I rowsort
SELECT ALL col2 * - col2 * + + col2 + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-357840
-504
-91080

onlyif mysql # DIV for integer division: 
query I rowsort label-6718
SELECT + col1 * col1 DIV col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

skipif mysql # not compatible
query I rowsort label-6718
SELECT + col1 * col1 / col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + col0 * col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT col0 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query II rowsort
SELECT col1, col1 + col1 AS col1 FROM tab1 GROUP BY col1
----
44
88
57
114
6
12

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 * - + col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <= - col0 + + col0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + col2 AS col2, col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT + + col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1 HAVING ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE ( NOT NULL NOT IN ( col1 * col0 ) ) GROUP BY col0
----

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT + 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 col1 col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NULL
----
-24
-38
-79

query II rowsort
SELECT col2, col2 AS col2 FROM tab1 GROUP BY col2, col2
----
45
45
71
71
8
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query II rowsort label-6742
SELECT DISTINCT - - col0 AS col0, col0 DIV - - col0 FROM tab0 AS cor0 GROUP BY col0
----
26
1
43
1
83
1

skipif mysql # not compatible
query II rowsort label-6742
SELECT DISTINCT - - col0 AS col0, col0 / - - col0 FROM tab0 AS cor0 GROUP BY col0
----
26
1
43
1
83
1

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col0 HAVING NOT - col0 IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col1 + + + col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
0
0
0

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col2 + - + col2 * - col2 AS col2 FROM tab0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT col1 - + col0 FROM tab2 cor0 GROUP BY col1, col1, col0
----
-32
-51
46

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 cor0 GROUP BY col1, col0
----
-15
-91
-92

query II rowsort
SELECT col2, col2 AS col0 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col0 HAVING ( NOT NULL > NULL )
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 FROM tab1 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 col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL AVG ( - + col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT + col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col0 * + - col0 col1, - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-22
-6724
-82
-784
-28

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + col2 <= col0
----
22
82

query I rowsort
SELECT DISTINCT + col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING - col1 IS NOT NULL
----
0
81

query II rowsort
SELECT - col1, + col1 FROM tab0 cor0 GROUP BY col1
----
-81
81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT ( col0 ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 * + col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NOT + AVG ( - - col0 ) + - AVG ( + col0 ) < col1
----
0

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT - col2 - + col0 AS col0 FROM tab2 GROUP BY col2, col0
----
-102
-150
-170

query I rowsort
SELECT - col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col1, col0 HAVING NOT col0 < ( NULL )
----

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0, col1
----
225
8281
8464

query I rowsort
SELECT + + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col0, col0 HAVING + + col0 BETWEEN NULL AND NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6793
SELECT col1 DIV + col1 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6793
SELECT col1 / + col1 FROM tab1 GROUP BY col1
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col1 + + - col1 FROM tab0 cor0 GROUP BY col1, col0
----
-162
0
0

query II rowsort
SELECT col1 AS col1, col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL 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 DISTINCT col1 col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 + + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
0

query I rowsort
SELECT ALL - - col1 + col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT col0 * - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL BETWEEN ( NULL ) AND + col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL - col0 - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-166
-52
-86

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 * + - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col2 * + col2 + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL AVG ( DISTINCT - col1 ) FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + + col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 / - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - + col0 FROM tab0 WHERE NOT NULL > NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + AVG ( - + col0 ) * col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL = - - col1 + - AVG ( ALL col0 )
----

query II rowsort
SELECT DISTINCT + col2 AS col2, - col2 AS col1 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

query II rowsort
SELECT DISTINCT + col2 AS col2, + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
24
38
38
79
79

query I rowsort
SELECT + - col2 + + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 FROM tab1 WHERE - + col1 IS NULL GROUP BY col0
----

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 ALL + col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT col1 + + col2 IS NOT NULL
----

query II rowsort
SELECT + col0, - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 + - + col0 FROM tab1 GROUP BY col2, col0 HAVING ( NULL IS NULL )
----
-11
-14
17

query I rowsort
SELECT ALL col1 * - col1 - - col1 * + - col1 + - + col1 FROM tab0 cor0 GROUP BY col1
----
-13203
0

query I rowsort
SELECT - + col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col2 + - col2 AS col2 FROM tab2 GROUP BY col2
----
0

query I rowsort
SELECT ALL col2 - + - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col0, - col0 AS col1 FROM tab1 GROUP BY col1, col1, col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT ALL + + col1 AS col0 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 - col2 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 WHERE col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT + col2 - col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col2 + - col2 AS col0 FROM tab2 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - col2 FROM tab0 AS cor0 WHERE ( NULL ) <= + col2 GROUP BY col2
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 GROUP BY col1 HAVING NOT ( col1 ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6844
SELECT - + col0 DIV col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6844
SELECT - + col0 / col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL - col1 * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col0, col0, col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING - col1 * col1 * - col0 = NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL col1 * col1 FROM tab0 GROUP BY col1
----
0
6561

query II rowsort
SELECT col0 AS col1, + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col0 + + col1 AS col1 FROM tab0 WHERE NOT NULL < NULL GROUP BY col0, col1
----

query I rowsort
SELECT col1 + - + col1 AS col0 FROM tab1 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT AVG ( ALL col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 - - - col2, + col2 col2 FROM tab0 GROUP BY col2
----
0
24
0
38
0
79

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col2 HAVING ( NULL ) IS NULL
----
-58
-79
-87

query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT col1 * - col1 - - col1 - - col1 FROM tab1 GROUP BY col1
----
-1848
-24
-3135

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING + + col2 IS NOT NULL
----
45
71
8

query II rowsort
SELECT - + col0 AS col0, - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT ALL col1 + + + col1 FROM tab0 GROUP BY col1, col2, col1
----
0
0
162

query I rowsort
SELECT col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
0
0
6561

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT - + col0 FROM tab0 cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 cor0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + col1 col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - - col2 IS NOT NULL
----

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 WHERE ( NULL ) < NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab1 GROUP BY col2, col0
----
-484
-6724
-784

query I rowsort
SELECT + col1 FROM tab1 WHERE NOT col0 = NULL GROUP BY col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col1, col2, col0
----
22
28
82

query I rowsort
SELECT ALL + + col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - col0 * - + col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query II rowsort
SELECT col2, col2 AS col0 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 AS cor0 GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT - col2 + + col2 FROM tab2 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
0

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 + - col1 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT ALL - col2 * + - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col2, col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL col2 * - col2 + - col2 AS col1 FROM tab0 GROUP BY col2
----
-1482
-600
-6320

query I rowsort
SELECT col1 * + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
1944

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NULL BETWEEN - col2 AND ( NULL ) AND NOT ( NOT ( col1 ) IS NULL ) GROUP BY col1, col2 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
58
79
87

query I rowsort
SELECT - col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT col2 + + + 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, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col1, col2 HAVING NOT ( NULL ) IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2 HAVING col2 IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( ( NULL IS NOT NULL ) )
----
24
38
79

query I rowsort
SELECT + col2 + + - col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL < - + col2
----

query II rowsort
SELECT - col1, col1 * + - col1 AS col0 FROM tab0 GROUP BY col1
----
-81
-6561
0
0

query II rowsort
SELECT + col2 AS col1, + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT + col2 IS NULL
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT + col1 - col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-16
-38
29

query I rowsort
SELECT DISTINCT col0 + - col0 AS col2 FROM tab0 WHERE NOT NULL >= NULL GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6923
SELECT + col2 DIV col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-6923
SELECT + col2 / col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * + col1 col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col2 * AVG ( ALL - col2 ) FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6926
SELECT - col1 DIV - col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6926
SELECT - col1 / - col1 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT - + col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 WHERE NULL > NULL GROUP BY col0
----

query I rowsort
SELECT - + col1 AS col2 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NULL >= + col0
----

query I rowsort
SELECT + col0 + - - col0 AS col1 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col2 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col1 IS NULL
----

query II rowsort
SELECT + col1, - col1 * - col1 / col1 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL col2 + - col2 AS col1 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 + - col2 FROM tab0 GROUP BY col2, col2, col2
----
0
0
0

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * - + col0 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NULL
----
15
91
92

query I rowsort
SELECT col0 FROM tab2 WHERE NULL <= - col1 - + + col0 GROUP BY col1, col0 HAVING AVG ( ALL col1 ) IS NOT NULL
----

query I rowsort
SELECT col0 + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
164
44
56

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 ALL col1 + + col1 FROM tab2 GROUP BY col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2 HAVING ( NULL ) NOT BETWEEN col0 AND NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING + + col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT - - col2 AS col1 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN NULL AND col1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * col0 + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1806
-650
-6806

onlyif mysql # DIV for integer division: 
query I rowsort label-6955
SELECT col2 DIV col2 FROM tab0 cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6955
SELECT col2 / col2 FROM tab0 cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col2 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col1 <> NULL
----

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT + - col1 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT - + col1 IS NULL
----
-44
-57
-6

query I rowsort
SELECT col1 * col0 FROM tab0 GROUP BY col2, col1, col0
----
0
0
3483

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1 HAVING col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
158
48
76

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-22
-28
-82

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 * + col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL > + + col2
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 WHERE ( NULL ) = ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

query I rowsort
SELECT ALL + - col1 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-118
-122
-82

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2, col0, col2
----
58
79
87

query II rowsort
SELECT ALL + col0, col0 AS col2 FROM tab0 GROUP BY col0, col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + AVG ( col1 ) FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT + + col2 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 * + + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT + + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - col1 - - col1 FROM tab0 GROUP BY col1
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT - col0 * - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 * + + col0 FROM tab1 GROUP BY col2, col0
----
1260
176
5822

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
-45
-71
-8

query II rowsort
SELECT ALL col0, col0 AS col1 FROM tab0 GROUP BY col0, col0 HAVING NOT col0 IS NULL
----
26
26
43
43
83
83

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING - + col0 IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 * + col0 col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2, col1 col1 FROM tab1 GROUP BY col1, col2
----
45
57
71
44
8
6

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0, col1, col0
----

query I rowsort
SELECT AVG ( - col0 ) FROM tab0 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND NULL
----

query II rowsort
SELECT DISTINCT + col0 AS col0, - col0 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT + col0 * - col0 AS col2 FROM tab0 GROUP BY col2, col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col1 / + + col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7001
SELECT ALL - col0 DIV + - col0 FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7001
SELECT ALL - col0 / + - col0 FROM tab0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 WHERE ( NOT NULL = NULL ) GROUP BY col0, col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col2 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NULL <> ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 GROUP BY col0, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

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 + col0 + - - col0 AS col2 FROM tab2 GROUP BY col2, col0
----
182
184
30

query I rowsort
SELECT - col2 * col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
-3364
-6241
-7569

onlyif mysql # DIV for integer division: 
query I rowsort label-7012
SELECT ALL col2 DIV + col2 AS col1 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7012
SELECT ALL col2 / + col2 AS col1 FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 * - - col0 * + col0 * - col0 - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-234278
-45212258
-614684

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * - - col2 col1 FROM tab0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab1 GROUP BY col0, col2
----
-484
-6724
-784

query I rowsort
SELECT + - col0 + + col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-114
-12
-88

query II rowsort
SELECT DISTINCT + + col1 * - col1 - col1 * + col1 * - col1, + col1 * + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
524880
6561

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NOT ( NULL IS NOT NULL ) GROUP BY col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query II rowsort
SELECT DISTINCT + + col0, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
15
91
91
92
92

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 * + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1, col1 col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING + col1 * - col1 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
-26
-43
-83

query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1, col0
----
-22
-28
-82

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab0 WHERE NOT ( NOT + col0 IS NOT NULL ) GROUP BY col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + + col2 col1 FROM tab2 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab2 AS cor0 WHERE NOT + col2 + col1 < NULL GROUP BY col2, col2
----

query I rowsort
SELECT col0 - + AVG ( ALL - + col0 ) FROM tab2 AS cor0 WHERE NOT NULL >= NULL GROUP BY col0
----

query I rowsort
SELECT + col2 * - - col1 FROM tab1 GROUP BY col2, col1, col1
----
2565
3124
48

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING AVG ( + col1 ) IS NOT NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col2 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab0 cor0 GROUP BY col1
----
0
162

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col0 <= NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * + col2 + + col2 col2 FROM tab0 GROUP BY col2, col2
----
-1406
-552
-6162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab0 GROUP BY col0, col1
----
-81
0

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 ALL col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - col1 + + col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + col2 * + col2 FROM tab0 cor0 WHERE NULL < NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-7062
SELECT - + col1 DIV - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7062
SELECT - + col1 / - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab2 cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 * + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL = NULL
----

query I rowsort
SELECT + AVG ( + + col0 ) AS col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT - - col0 + col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
164
82
44
22
56
28

query I rowsort
SELECT - col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col1 + + + col2 AS col1 FROM tab2 GROUP BY col1, col2
----
138
148
99

onlyif mysql # DIV for integer division: 
query I rowsort label-7071
SELECT ALL - col0 DIV + col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7071
SELECT ALL - col0 / + col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col0 HAVING ( - col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 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 I rowsort
SELECT ALL col0 col2 FROM tab2 GROUP BY col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT - col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT col1 * + + col1 - + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT - - col2 + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
158
48
76

query I rowsort
SELECT - col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 * col1 col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1681
-3481
-3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 * - col2 AS col1 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT col2 - col2 AS col1 FROM tab2 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + AVG ( + col1 ) + - col1 col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT AVG ( + + col1 ) > NULL
----

query I rowsort
SELECT DISTINCT - col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL - col1 * - col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING + col0 = NULL
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col1 HAVING NOT + + col0 IS NULL
----
-26
-43
-83

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col1, col1 - - - col1 FROM tab0 GROUP BY col1
----
0
0
81
0

query II rowsort
SELECT ALL + col1 AS col2, - col1 AS col0 FROM tab1 GROUP BY col1, col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT ALL + col2 * + col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
1444
576
6241

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col1 * - col2 AS col0 FROM tab0 GROUP BY col2, col1
----
-1944
0
0

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL + col0 * + col2 * col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
35280
3872
477404

query I rowsort
SELECT col2 + + - col2 FROM tab1 GROUP BY col2, col2, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT ( + col2 ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - 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 - col2 col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 * + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
2378
4661
5307

query I rowsort
SELECT + col0 + - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL - + col0 * - - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0, col0
----
-3772
-5369
-915

query I rowsort
SELECT ALL col1 + - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col1, col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 WHERE NULL <> ( NULL ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col0, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT col1 IS NULL GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT - col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 + - col1 AS col1 FROM tab0 GROUP BY col1, col2
----
-57
38
79

query I rowsort
SELECT - + AVG ( col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT + col0, + col0 AS col0 FROM tab2 GROUP BY col1, col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - col0 + - + col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query II rowsort
SELECT DISTINCT + col2 AS col1, col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab2 GROUP BY col0, col0, col1, col0
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 GROUP BY col0, col1, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col0, col1, col1
----
-44
-57
-6

query I rowsort
SELECT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
6561

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-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 + col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
0

query II rowsort
SELECT - col1 AS col0, + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT + col2 * col2 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT + col0 FROM tab0 WHERE NULL NOT IN ( + col1 ) GROUP BY col2, col0, col2
----

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col0 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query II rowsort
SELECT + col2, + col0 FROM tab1 cor0 GROUP BY col2, col0
----
45
28
71
82
8
22

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + col2 + + - col2 - col2 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - - col0 AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 + + col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - + col2 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN NULL AND + col1
----

query I rowsort
SELECT ALL col1 - + col2 FROM tab0 GROUP BY col2, col1
----
-38
-79
57

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-22
-28
-82

query I rowsort
SELECT col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - col0 + col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col2 * - col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
-45
-71
-8

query I rowsort
SELECT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col0 + + col2 + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 + + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-32
-51
46

query I rowsort
SELECT DISTINCT col2 - - col2 * - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT + AVG ( DISTINCT - + col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) >= - col2
----

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 NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col1 * - + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-6561
0
0

query I rowsort
SELECT DISTINCT + col0 - + col0 AS col2 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 WHERE NOT - col1 + - col2 <= ( - col2 ) GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 - + + col2 AS col2 FROM tab2 GROUP BY col2, col2, col1
----
-17
-20
-26

query I rowsort
SELECT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( NOT NULL IS NULL )
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NULL IS NOT NULL )
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab0 cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col1, col2, col2
----
45
71
8

query I rowsort
SELECT ALL col1 * + col1 * + col1 AS col0 FROM tab1 GROUP BY col1
----
185193
216
85184

query II rowsort
SELECT col2, col2 FROM tab2 GROUP BY col2, col2, col2
----
58
58
79
79
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + - col2 + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT + col2 FROM tab1 WHERE + col0 IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 + - - col0 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
44
57
6

query II rowsort
SELECT + col2 AS col0, - col1 + col1 FROM tab0 GROUP BY col2, col0, col1 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 + - - col1 col0 FROM tab0 GROUP BY col0, col1
----
-26
-83
38

query I rowsort
SELECT ALL col1 + - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
0
0
0

query I rowsort
SELECT - + AVG ( DISTINCT - col0 ) * - col0 FROM tab2 WHERE + - col0 IS NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1, col0 HAVING - col0 - + - col2 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2, + col0 col1 FROM tab2 GROUP BY col0, col2
----
58
92
79
91
87
15

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col2, col1, col1 HAVING - col2 IS NULL
----

query II rowsort
SELECT + + col0 AS col1, + col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
484
28
784
82
6724

onlyif mysql # DIV for integer division: 
query I rowsort label-7227
SELECT DISTINCT + col0 DIV - - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-7227
SELECT DISTINCT + col0 / - - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
1

onlyif mysql # DIV for integer division: 
query I rowsort label-7228
SELECT - col2 DIV col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7228
SELECT - col2 / col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1
-1
-1

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col2 col2 FROM tab1 GROUP BY col0, col0, col2
----
153
30
73

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT - + col1 - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 GROUP BY col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col1 + - + col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col1 + - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
17
20
26

query I rowsort
SELECT ALL - col2 + + AVG ( DISTINCT + col2 ) FROM tab2 WHERE - col2 IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
0

query I rowsort
SELECT DISTINCT col2 AS 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 col2 col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NULL
----
26
43
83

query I rowsort
SELECT ALL + col0 * - col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-3483
0
0

query I rowsort
SELECT DISTINCT col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col1 + + col1 AS col0 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL col2 * + - col2 - + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-1482
-600
-6320

onlyif mysql # DIV for integer division: 
query I rowsort label-7253
SELECT DISTINCT col0 DIV + + col0 FROM tab1 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-7253
SELECT DISTINCT col0 / + + col0 FROM tab1 GROUP BY col0
----
1

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 * - col2 AS col1 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL - col2 + - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NOT NULL
----
-81
0

query I rowsort
SELECT ALL col2 - col2 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING ( NULL BETWEEN col2 AND col2 )
----

query I rowsort
SELECT - col1 * + col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-6561
0

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 - col2 * - col2 AS col0 FROM tab1 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT ALL - - col2 * col2 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 WHERE NOT NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + AVG ( ALL + col2 ) + col1 FROM tab0 WHERE col0 * - col0 + - col1 IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col2, + col2 * + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + col0 < NULL
----

query I rowsort
SELECT ALL + col2 * + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
1260
176
5822

query II rowsort
SELECT + + col2 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
24
38
38
79
79

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col1 + - col1 FROM tab2 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING + col1 - + col1 IS NULL
----

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col0, col1, col2
----
24
38
79

query II rowsort
SELECT DISTINCT - col1, col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2, col2, col1
----
-45
-71
-8

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT col1 * + - col1 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING NOT ( ( NULL ) IS NULL )
----

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col0, col0, col1, col2 HAVING ( NULL ) = - col2 * + col1 + + col0
----

query I rowsort
SELECT DISTINCT - col0 * col0 AS col1 FROM tab1 GROUP BY col0
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 + + col2 FROM tab1 GROUP BY col0, col2, col1
----
153
30
73

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col1 FROM tab1 cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col1, col0 HAVING ( - col0 ) BETWEEN NULL AND col0 * - col1
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col0 / col0 FROM tab0 AS cor0 WHERE NOT col1 <= NULL GROUP BY col0 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - + col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query II rowsort
SELECT ALL col1 AS col0, + col1 * - AVG ( DISTINCT + col1 ) FROM tab1 GROUP BY col1 HAVING AVG ( DISTINCT - + col1 ) IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col1, col0, col2
----
-45
-71
-8

query I rowsort
SELECT + + col0 FROM tab2 WHERE NULL = col2 GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT col0 + - col0 FROM tab0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 <> NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( - AVG ( DISTINCT col0 ) / - - col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col0, col2, col1
----
26
43
83

query I rowsort
SELECT + col0 - - col0 FROM tab0 GROUP BY col0 HAVING - + col0 + + - AVG ( DISTINCT col0 ) >= ( NULL )
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col1, col2 HAVING NOT + col2 IS NULL
----
24
38
79

query II rowsort
SELECT DISTINCT - col0, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT - col0 FROM tab0 AS cor0 WHERE NULL >= ( NULL ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col1 + col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
0

query I rowsort
SELECT ALL + col2 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query II rowsort
SELECT + col0 AS col0, col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 WHERE - col0 BETWEEN NULL AND + - col2 GROUP BY col1, col0, col0
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT + col1 + - - col1 AS col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col0 - col0 AS col2 FROM tab1 GROUP BY col0, col2
----
-164
-44
-56

query II rowsort
SELECT - col1, - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
-81
0
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-7341
SELECT col2 DIV + col2 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7341
SELECT col2 / + col2 FROM tab2 GROUP BY col2
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-7342
SELECT DISTINCT col0 + + col0 DIV + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
27
44
84

skipif mysql # not compatible
query I rowsort label-7342
SELECT DISTINCT col0 + + col0 / + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
27
44
84

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col1 FROM tab0 WHERE ( NULL ) BETWEEN NULL AND - col1 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING ( col2 ) IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col1, col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + - col2 * + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3422
-6320
-7656

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
-44
-57
-6

query II rowsort
SELECT + col1 AS col0, col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
71
57
45
6
8

query I rowsort
SELECT + - col1 AS col2 FROM tab2 WHERE col0 = NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col0, col0
----
58
79
87

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL <> col2
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * col0 * + + col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT col0 AS col2, - col1 FROM tab0 GROUP BY col0, col1
----
26
0
43
-81
83
0

query I rowsort
SELECT - - col1 + + col1 + - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 + - + col2 * col2 + + col2 FROM tab0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT - col2 * - col1 AS col2 FROM tab2 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 NULL IS NULL
----
44
57
6

query II rowsort
SELECT ALL - col0, - col0 FROM tab2 GROUP BY col0, col0
----
-15
-15
-91
-91
-92
-92

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7375
SELECT col0 DIV + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - col1 IS NULL
----
0
1
2

skipif mysql # not compatible
query I rowsort label-7375
SELECT col0 / + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - col1 IS NULL
----
0
1
2

query III rowsort
SELECT DISTINCT col0 AS col2, col0 - - + col0, + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
9 values hashing to 1a03f26a61c2a3f9c91540a11f1a77bf

query II rowsort
SELECT DISTINCT col1 * - - col1, col1 FROM tab0 GROUP BY col1, col1
----
0
0
6561
81

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - col2 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab1 cor0 GROUP BY col2, col0, col2
----
22
28
82

query I rowsort
SELECT + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT DISTINCT col0 * col0 AS col2 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL + col2 * col2 FROM tab2 GROUP BY col2 HAVING col2 <= NULL
----

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL < NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING AVG ( ALL + col2 ) IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col2, col2, col0
----
26
43
83

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT + col2 + + col2 * - col2 AS col1 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

query II rowsort
SELECT - col1 AS col2, + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
43
0
26
0
83

query I rowsort
SELECT DISTINCT + col2 FROM tab1 WHERE NOT - col1 BETWEEN NULL AND NULL GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 * + col2 AS col0 FROM tab2 GROUP BY col2, col0
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col2, col2, col1
----
0
81

query I rowsort
SELECT ALL + col1 * - col1 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 WHERE ( NULL ) <> ( - col2 ) GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT col2 * col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-26
-43
-83

query I rowsort
SELECT - - col2 FROM tab0 cor0 WHERE NOT col1 < NULL GROUP BY col2
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + 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 + col0 col2 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL = - col1
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query II rowsort
SELECT ALL col2, col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
24
38
38
79
79

query I rowsort
SELECT + col2 * col2 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab0 GROUP BY col0, col0
----
0

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col0, + col0 col1 FROM tab1 cor0 WHERE NOT + col1 IS NULL GROUP BY col2, col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col0 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT + + col1 - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 * col2 FROM tab1 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT - - col0 + + + col0 FROM tab1 cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT + - col1 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-3483
0

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - - col2 + - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT col2 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + col0 ) IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT - col0 - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT ALL - col2, - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT + - col1 FROM tab2 cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + col2 * - col2 * - + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
357911
512
91125

onlyif mysql # DIV for integer division: 
query II rowsort label-7441
SELECT DISTINCT + col2, + col2 * - col2 DIV + col2 FROM tab2 GROUP BY col2
----
58
-58
79
-79
87
-87

skipif mysql # not compatible
query II rowsort label-7441
SELECT DISTINCT + col2, + col2 * - 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 - + col0 col1 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND ( NULL ) GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + + col1 <= NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT - - col2 IS NULL
----
-58
-79
-87

query I rowsort
SELECT + col1 FROM tab1 cor0 GROUP BY col1, col2, col2
----
44
57
6

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL = - col1
----

query I rowsort
SELECT ALL + - col2 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab1 WHERE NOT NULL <= NULL GROUP BY col1
----

query II rowsort
SELECT ALL + col2 AS col2, col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab0 WHERE NOT ( col0 ) IN ( - col0 ) GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT ( NULL ) >= + col0
----

query I rowsort
SELECT ALL + col2 + + + col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
0
0
81

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + + col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
41
59
61

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col0 HAVING ( NULL ) >= ( NULL )
----

query I rowsort
SELECT ALL + - col2 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

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 NULL
----

query I rowsort
SELECT DISTINCT - - col1 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - col2 + - col2 col0 FROM tab1 GROUP BY col1, col2
----
-2610
-3195
-56

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query II rowsort
SELECT + col1 AS col1, - col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
81
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 + col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + col0 + - col0 * - col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT - - col1 AS col0 FROM tab2 AS cor0 WHERE col1 NOT BETWEEN NULL AND NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
58
79
79
87
87

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-7478
SELECT DISTINCT - col0 DIV - - col0 FROM tab1 cor0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-7478
SELECT DISTINCT - col0 / - - col0 FROM tab1 cor0 GROUP BY col0
----
-1

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-7480
SELECT ALL + col1 DIV - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7480
SELECT ALL + col1 / - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT + col0 * - col1 IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + + col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - col2 + col2 IS NULL
----

query II rowsort
SELECT + col0 AS col2, - col0 FROM tab0 GROUP BY col0, col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT col0 + - col0 FROM tab1 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT ALL - col0 * - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT ( - col1 ) = NULL
----

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT + col1 AS 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 + col2 + col2 col1 FROM tab2 GROUP BY col0, col2, col2
----
189
208
249

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 cor0 WHERE NOT NULL < ( NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT - col1 - - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-12
2
27

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - - col1 - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-38
-79
57

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 - col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING ( + - AVG ( DISTINCT - col2 ) ) IS NULL
----

query I rowsort
SELECT + col2 + col0 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
110
131
204

query I rowsort
SELECT ALL - col2 * - + col2 * col2 FROM tab2 GROUP BY col2, col2
----
195112
493039
658503

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 * - col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) <= NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 AS col1, col1 col0 FROM tab2 GROUP BY col1, col2, col1
----
58
41
79
59
87
61

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col1, col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2, col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7520
SELECT col2 DIV col2 DIV + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-7520
SELECT col2 / col2 / + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query II rowsort
SELECT DISTINCT col0, col0 AS col1 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col1, col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 * col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query II rowsort
SELECT DISTINCT + - col1, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
43
0
26
0
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 GROUP BY col0 HAVING - col0 <> NULL
----

query I rowsort
SELECT ALL + col0 + - + col0 FROM tab2 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL col0 * + - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab2 GROUP BY col0, col1
----
118
122
82

query I rowsort
SELECT ALL col2 + + col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NULL
----
116
158
174

query I rowsort
SELECT col1 / - - col1 * - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * + - col2 AS col0 FROM tab2 GROUP BY col2
----
3364
6241
7569

onlyif mysql # DIV for integer division: 
query I rowsort label-7538
SELECT - + col0 + - col0 DIV - + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-21
-27
-81

skipif mysql # not compatible
query I rowsort label-7538
SELECT - + col0 + - col0 / - + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-21
-27
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col1 + - col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
0

query I rowsort
SELECT + col1 + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING - col2 <> NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 cor0 GROUP BY col2, col1 HAVING NULL <= - col1
----

query I rowsort
SELECT - col2 * col0 AS col2 FROM tab2 GROUP BY col0, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2, col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col0 HAVING - AVG ( ALL col0 ) + col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NOT + col1 <= NULL
----

query I rowsort
SELECT ALL - col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1, col0 HAVING NOT - col1 IS NULL
----
41
59
61

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT + col0 AS col2 FROM tab1 cor0 WHERE NULL <> ( NULL ) GROUP BY col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - - col1 * - col1 + col1 IS NULL
----
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 ALL col2 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query II rowsort
SELECT DISTINCT + col0 AS col2, col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
15
91
91
92
92

query I rowsort
SELECT - col2 * - col2 FROM tab0 GROUP BY col2
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + + col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + + col1 col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col2 + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
153
30
73

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * - - col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
44
57
6

query II rowsort
SELECT DISTINCT col1 + + col1, col2 AS col0 FROM tab0 GROUP BY col2, col1, col2
----
0
38
0
79
162
24

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col1, col2 HAVING NOT - + col1 < NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT ALL + col1 * col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL + col2 + col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col1 + + col1 FROM tab2 GROUP BY col1, col1
----
118
122
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col0 + col0 + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
273
276
45

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
0
0
81

query II rowsort
SELECT ALL - col1 * - col1 AS col2, col2 AS col0 FROM tab1 cor0 GROUP BY col1, col2
----
1936
71
3249
45
36
8

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col1 * + + col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL - col2 * + + col1 FROM tab1 GROUP BY col1, col2
----
-2565
-3124
-48

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col0, col0, col1
----
0
0
81

query II rowsort
SELECT DISTINCT col2, col2 AS col1 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 + + + col0 - col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col1 + col1 - col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 / - col1 col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * - col0 col2 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-24
-38
-79

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) IS NULL OR NOT ( col0 IS NULL )
----
15
91
92

query II rowsort
SELECT DISTINCT + col0, + col0 FROM tab0 WHERE NULL >= ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col1 + + col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 * - - col0 AS col2 FROM tab0 GROUP BY col2, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 * - col1 - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-38
-79
6537

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND col1
----

query I rowsort
SELECT ALL - col2 * - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-2378
-4661
-5307

query I rowsort
SELECT DISTINCT - col0 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query II rowsort
SELECT col0, AVG ( + col0 ) AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7620
SELECT ALL + - col2 DIV + col2 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7620
SELECT ALL + - col2 / + col2 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE NULL <= col2 GROUP BY col0
----

query I rowsort
SELECT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT + AVG ( - + col2 ) IS NULL
----
-58
-79
-87

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col1 * + col0 + col0 * + + col0 FROM tab0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0, col1 HAVING NOT + AVG ( + - col1 ) * + col1 IS NULL
----

query I rowsort
SELECT + - col2 * - - col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT + col2 * - + col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL + col2 + + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col0
----
142
16
90

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0, col1, col2
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col0, col1 HAVING ( NULL <= + col1 )
----

query I rowsort
SELECT + - col0 * col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query II rowsort
SELECT ALL col2 AS col1, col2 FROM tab2 GROUP BY col2 HAVING ( NOT NULL BETWEEN NULL AND NULL )
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 + - col2 AS col1 FROM tab0 WHERE + col1 IS NOT NULL GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col0 - + col0 - - col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 * + col2 AS col1 FROM tab1 GROUP BY col1, col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL BETWEEN NULL AND + col0
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND - - col1
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - - col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT + col1 - + col1 FROM tab0 GROUP BY col1 HAVING NOT - col1 < NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 + - col2 AS col2 FROM tab0 GROUP BY col2, col1
----
-38
-79
57

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col0 + + col0 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 AS col2 FROM tab0 cor0 WHERE NOT ( NULL ) NOT IN ( col2 ) GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 * + + col1 AS col2 FROM tab2 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - + AVG ( col1 ) FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col0 * col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING AVG ( DISTINCT - col2 ) BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 * - col2 FROM tab0 GROUP BY col2, col0 HAVING - + col2 IS NOT NULL
----
-1032
-2054
-3154

query I rowsort
SELECT - - col2 * - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col2, col1
----
-2025
-5041
-64

query I rowsort
SELECT - col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col0 - + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col1 HAVING NOT NULL IS NOT NULL
----
-164
-44
-56

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE NOT ( - col1 ) IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT col0 - + col1 AS col0 FROM tab0 GROUP BY col0, col1
----
-38
26
83

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col0 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col2 * - col0 * col2 AS col2 FROM tab0 GROUP BY col0, col2
----
119852
162266
24768

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 AS cor0 WHERE col1 IS NOT NULL GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 * - - col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 cor0 WHERE col1 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 - - - col0 FROM tab0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING col0 IS NOT NULL
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-7689
SELECT + col1 DIV + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7689
SELECT + col1 / + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
1
1
1

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query II rowsort
SELECT ALL - col0, col0 FROM tab0 GROUP BY col0
----
-26
26
-43
43
-83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 WHERE col1 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 * col2 AS col2 FROM tab0 GROUP BY col1, col0, col2
----
-1032
-2054
-3154

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2, col1 HAVING ( NOT ( NULL ) >= NULL )
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT - AVG ( DISTINCT col1 ) FROM tab0 WHERE + col0 <> NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-7701
SELECT ALL - + col0 + col0 + - + col0 DIV - col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7701
SELECT ALL - + col0 + col0 + - + col0 / - col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + - col2 >= + AVG ( ALL + + col2 )
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * - col1 / - col1 col2 FROM tab1 GROUP BY col1, col2, col1 HAVING - AVG ( + col0 ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col1 * col1 + + + col1 + col1 * + AVG ( + col1 ) FROM tab1 GROUP BY col1 HAVING ( col1 ) BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 + + col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
22
28
82

query I rowsort
SELECT col2 - - col2 - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 - + - col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
116
158
174

query I rowsort
SELECT + AVG ( + col0 ) FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query II rowsort
SELECT - - col0, + col0 - + col0 * - - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT col0 - - + col0 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 + + - col1 FROM tab2 GROUP BY col1, col1
----
-118
-122
-82

query I rowsort
SELECT + col0 + col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col1 - col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
0

query I rowsort
SELECT col0 * - + col0 * + - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
10648
21952
551368

query I rowsort
SELECT col1 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + - col1 AS col1 FROM tab2 cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
0

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 WHERE NULL <= - col2 * - + col1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 + - + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0

query I rowsort
SELECT + col0 + + col0 * + col2 * + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
19590
491004
654290

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 cor0 GROUP BY col1, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col2 FROM tab2 cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 - - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col2, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT AVG ( ALL + col0 ) * - AVG ( DISTINCT col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING ( col1 ) <> NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab1 GROUP BY col0, col1
----
-164
-44
-56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL >= - AVG ( ALL + col2 )
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col1, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab0 WHERE ( NULL ) IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT DISTINCT col0 * col0 * + col0 AS col2 FROM tab2 GROUP BY col0
----
3375
753571
778688

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NOT NULL NOT BETWEEN NULL AND NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col0 col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT col2, col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 WHERE NOT ( - col1 IS NULL ) GROUP BY col1 HAVING NOT - AVG ( col0 ) IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - AVG ( + col1 ) + - AVG ( + col1 ) FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * + - col0 AS col0 FROM tab2 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 WHERE - col1 IS NULL OR NOT NULL BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0, col0
----
-45
-71
-8

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 col2 * - col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2025
-5041
-64

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col1, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
132
1596
3608

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col2 col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col1, col0
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col1, col2, col1
----
-58
-79
-87

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col1 AS col0, col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
0
0
0
0
81
81

query I rowsort
SELECT + col1 + col1 FROM tab0 AS cor0 WHERE NULL > col2 * - + col1 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING ( NOT NULL NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT - - col0 AS col0 FROM tab0 WHERE NOT col2 IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0, col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 - col2 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT + + col1 >= NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT col1, - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
-58
59
-79
61
-87

query I rowsort
SELECT ALL 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 col1 col2 FROM tab2 cor0 GROUP BY col1, col1 HAVING NOT - + col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT - - col1 * - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 WHERE NOT NULL = col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 * - col0 FROM tab2 GROUP BY col0, col1
----
-3772
-5369
-915

query II rowsort
SELECT - col0 AS col2, col0 FROM tab2 GROUP BY col0, col1
----
-15
15
-91
91
-92
92

query I rowsort
SELECT + col1 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT + col2 + - col1 AS col0 FROM tab2 AS cor0 WHERE NULL > - col0 GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - + col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-484
-6724
-784

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT col0 + col1 FROM tab2 GROUP BY col1, col0
----
133
150
76

query I rowsort
SELECT col1 - col1 FROM tab2 GROUP BY col1, col1, col0
----
0
0
0

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL + + col2 FROM tab2 cor0 GROUP BY col1, col2, col2 HAVING ( - col1 ) IS NOT NULL
----
58
79
87

query I rowsort
SELECT col0 - - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col1 * - col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1, col1, col0
----
-41
-59
-61

query I rowsort
SELECT col2 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab1 cor0 WHERE + col1 * - - col1 > NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL AVG ( + col0 ) FROM tab1 GROUP BY col0 HAVING NULL NOT IN ( - + col0 )
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT + col2 * col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query II rowsort
SELECT - col1 AS col0, + col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL > + AVG ( ALL + col2 )
----

query II rowsort
SELECT col1, + col1 FROM tab2 GROUP BY col2, col2, col1 HAVING NOT col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT + AVG ( DISTINCT - col2 ) FROM tab1 GROUP BY col1, col2 HAVING NOT - col2 * col1 IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - AVG ( - col1 ) FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col0 + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT AVG ( DISTINCT + + col0 ) FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING + + col1 <> NULL
----

query I rowsort
SELECT DISTINCT col0 * - col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col0 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE col2 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL - - col1 * + col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT col0 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

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 ALL col2 + + col2 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col1, col1, col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT + - col2 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
1032
2054
3154

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1 HAVING + col1 IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT col1 + - col1 * col2 FROM tab1 cor0 GROUP BY col2, col0, col1 HAVING NULL < NULL
----

query I rowsort
SELECT + - 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 col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL + col1 - - - col0, col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
26
-83
83
38
43

query I rowsort
SELECT + col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 + - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT col1 * + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * col2 col0 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col2 * - col2 FROM tab0 GROUP BY col2, col0, col0
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col2 * + + col2 AS col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col0, col1, col1 HAVING NULL > col0
----

query I rowsort
SELECT DISTINCT - col1 * - col0 AS col0 FROM tab0 GROUP BY col0, col1
----
0
3483

query I rowsort
SELECT col0 * col1 FROM tab2 GROUP BY col1, col0
----
3772
5369
915

query II rowsort
SELECT + col1 AS col1, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL < NULL
----

query II rowsort
SELECT + col2, col2 AS col1 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT + col2 * + col2 * + col2 FROM tab2 GROUP BY col2
----
195112
493039
658503

query I rowsort
SELECT col2 / col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT - - col1 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
-1936
-3249
-36

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING NULL <> - - col2
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) BETWEEN AVG ( + col1 ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 WHERE - col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT - + col2 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - col0 * col0 * col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-261782
-44376
-53404

onlyif mysql # DIV for integer division: 
query I rowsort label-7875
SELECT - col0 DIV - col0 FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7875
SELECT - col0 / - col0 FROM tab1 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING + col0 IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2 HAVING col1 IS NOT NULL
----
-81
0
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING col2 / + - col2 IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - + col1 + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
0

query I rowsort
SELECT + col0 * + col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col0, col0, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING NULL <= - col0
----

query I rowsort
SELECT ALL AVG ( DISTINCT - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT col2 * col2 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL + col0 + - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-46
32
51

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 >= NULL
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 * - col0 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-17576
-571787
-79507

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 > NULL
----

query I rowsort
SELECT - - col2 AS col2 FROM tab2 cor0 GROUP BY col2, col1 HAVING NOT NULL BETWEEN ( NULL ) AND - col2
----

query I rowsort
SELECT + + col0 + - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT ( col0 ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING + col2 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 * + col1 FROM tab1 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col1, col2, col0
----
-58
-79
-87

query II rowsort
SELECT ALL col1, - col1 + col1 * - col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
44
-1980
57
-3306
6
-42

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING ( NOT NULL > + col2 * + col1 * col1 )
----

query II rowsort
SELECT - col1, + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL - col1 + + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-12
2
27

query I rowsort
SELECT - col0 * - col0 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-10648
-21952
-551368

query II rowsort
SELECT DISTINCT - col2, col2 AS col1 FROM tab1 AS cor0 WHERE NULL >= NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL col2 FROM tab0 cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT - - col0 AS col0 FROM tab0 WHERE NOT + col0 IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + AVG ( + col1 ) FROM tab2 GROUP BY col1 HAVING col1 <= NULL
----

query I rowsort
SELECT ALL - col2 * - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 WHERE col1 + - - col0 <= NULL GROUP BY col1, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 * col1 col1 FROM tab0 cor0 GROUP BY col2, col1
----
-6561
0
0

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT ALL + col0 * + col0 * + col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
17602
571870
79550

query I rowsort
SELECT - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
-15
-91
-92

query I rowsort
SELECT + + col1 + + + col1 AS col0 FROM tab0 cor0 GROUP BY col2, col0, col1, col1 HAVING NOT + col1 IS NULL
----
0
0
162

query I rowsort
SELECT - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + col2 * col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab0 GROUP BY col2, col1
----
-1444
-576
-6241

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + - col2 - + - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-72
12
34

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query II rowsort
SELECT DISTINCT + col0 AS col2, col1 AS col2 FROM tab1 GROUP BY col0, col1, col0
----
22
6
28
57
82
44

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( - col2 * col0 ) <= ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0, - col0 col0 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL >= - col1
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
0

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col1, col2, col2
----
-45
-71
-8

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + col0 + + col1 AS col0, + col0 / + - col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING AVG ( - - col1 ) >= NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + col2 * col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 GROUP BY col2, col1
----
44
57
6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2, col2, col2 HAVING NULL < col0
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING NOT - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 + + col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 WHERE NOT ( ( NOT NULL IS NULL ) ) GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
24
38
79

query I rowsort
SELECT + - col1 - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query II rowsort
SELECT col1 AS col2, col1 AS col1 FROM tab1 GROUP BY col1 HAVING col1 IS NOT NULL
----
44
44
57
57
6
6

query II rowsort
SELECT DISTINCT - col2, col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL 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 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col2 * col2 * col2 FROM tab1 GROUP BY col2, col2
----
357911
512
91125

query I rowsort
SELECT + col0 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-53
19
45

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 * col1 FROM tab0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
0
6561

query I rowsort
SELECT - col2 - col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT ALL col0 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
41
59
61

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 - - col0 col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-46
32
51

query I rowsort
SELECT ALL + + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query II rowsort
SELECT ALL - col0 AS col2, col0 FROM tab2 GROUP BY col0, col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 cor0 GROUP BY col1 HAVING ( NOT - col1 IS NULL )
----
44
57
6

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING + col1 < NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col0, col1, col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL > ( NULL )
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 WHERE col2 BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 * + col0 AS col0 FROM tab1 GROUP BY col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query II rowsort
SELECT ALL col1, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT + col0 / + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL < ( col2 )
----

query I rowsort
SELECT ALL col0 * col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT - col0, - col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 * - + col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - col1 + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col1, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + + col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE ( NULL IS NOT NULL ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 * - col0 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col1, col0
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 + - - col1 FROM tab1 GROUP BY col1, col2
----
102
115
14

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
26
43
83

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 WHERE NULL NOT BETWEEN ( + col1 ) AND NULL GROUP BY col1
----

query II rowsort
SELECT ALL col2 AS col0, col2 AS col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL + col1 + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
133
150
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col1 HAVING AVG ( col0 ) IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT ALL col1 * + col1 AS col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT - col1 FROM tab0 cor0 WHERE NULL = NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 * + col1 AS col0 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING ( NULL NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab2 AS cor0 WHERE - col0 IS NULL GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT col1 + - - col1 + + col1 AS col1 FROM tab2 GROUP BY col1
----
123
177
183

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
15
91
92

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1 HAVING ( col1 ) IS NOT NULL
----
0
81

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT - AVG ( col0 ) IS NULL
----
24
38
79

query I rowsort
SELECT col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 + - col1 * + + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT + + col0 - - AVG ( DISTINCT - col0 ) FROM tab0 WHERE - col1 - col1 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 * + col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
225
8281
8464

query II rowsort
SELECT + + col1 AS col0, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

query I rowsort
SELECT + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

onlyif mysql # DIV for integer division: 
query I rowsort label-8045
SELECT - col2 DIV - col2 FROM tab0 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8045
SELECT - col2 / - col2 FROM tab0 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT DISTINCT + col0 * col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 WHERE ( + - col1 / + col2 + + col0 ) IS NOT NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2 HAVING AVG ( col1 ) IS NULL
----

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-8055
SELECT DISTINCT + - col2 DIV - col2 FROM tab0 AS cor0 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-8055
SELECT DISTINCT + - col2 / - col2 FROM tab0 AS cor0 GROUP BY col2
----
1

query I rowsort
SELECT - col1 + - col1 AS col2 FROM tab2 GROUP BY col1
----
-118
-122
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-8057
SELECT + col1 DIV - col1 FROM tab2 GROUP BY col0, col1 HAVING NOT - col1 IS NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8057
SELECT + col1 / - col1 FROM tab2 GROUP BY col0, col1 HAVING NOT - col1 IS NULL
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab1 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col1
----
-1936
-3249
-36

query II rowsort
SELECT - col0, col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8062
SELECT DISTINCT col0 DIV - col0 AS col0 FROM tab1 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-8062
SELECT DISTINCT col0 / - col0 AS col0 FROM tab1 GROUP BY col0
----
-1

query I rowsort
SELECT + col2 AS col2 FROM tab0 WHERE ( NOT NULL IS NOT NULL ) GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col0 + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query II rowsort label-8066
SELECT ALL - col0 + - + col0 DIV - col0, + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-21
22
-27
28
-81
82

skipif mysql # not compatible
query II rowsort label-8066
SELECT ALL - col0 + - + col0 / - col0, + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-21
22
-27
28
-81
82

query I rowsort
SELECT - col2 AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-8069
SELECT ALL + col0 + - col0 DIV + + col2 FROM tab2 GROUP BY col2, col0
----
15
90
91

skipif mysql # not compatible
query I rowsort label-8069
SELECT ALL + col0 + - col0 / + + col2 FROM tab2 GROUP BY col2, col0
----
15
90
91

query II rowsort
SELECT col0 AS col2, + col0 FROM tab1 cor0 GROUP BY col0
----
22
22
28
28
82
82

onlyif mysql # DIV for integer division: 
query I rowsort label-8071
SELECT col2 DIV - col2 col1 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8071
SELECT col2 / - col2 col1 FROM tab2 cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col1, col1, col0
----
15
91
92

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + AVG ( col2 ) FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col0 col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query II rowsort
SELECT ALL + col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query II rowsort
SELECT DISTINCT + col0, col0 * col0 AS col1 FROM tab2 GROUP BY col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT ( ( NULL IS NOT NULL ) )
----
0
0
81

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT - col1 * - col0 FROM tab1 AS cor0 GROUP BY col2, col0, col1 HAVING col1 IS NOT NULL
----
132
1596
3608

query I rowsort
SELECT col2 + col2 FROM tab2 GROUP BY col2, col0
----
116
158
174

query I rowsort
SELECT + col2 * + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1444
576
6241

query II rowsort
SELECT - col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
26
-43
43
-83
83

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 - col0 FROM tab1 cor0 GROUP BY col0, col2
----
0

query I rowsort
SELECT + col1 * - col2 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 WHERE ( col1 ) IS NOT NULL GROUP BY col1 HAVING ( NULL ) IS NULL
----
41
59
61

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT - col0 + + - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab0 GROUP BY col0, col0
----
-1849
-676
-6889

onlyif mysql # DIV for integer division: 
query I rowsort label-8104
SELECT - col1 DIV col2 * - - col2 AS col1 FROM tab0 GROUP BY col1, col2
----
-72
0
0

skipif mysql # not compatible
query I rowsort label-8104
SELECT - col1 / col2 * - - col2 AS col1 FROM tab0 GROUP BY col1, col2
----
-72
0
0

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * + - col1 AS col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <= - - col0
----

query I rowsort
SELECT ALL AVG ( - col2 ) AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col1, - col1 FROM tab0 GROUP BY col1, col2
----
-81
-81
0
0
0
0

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NULL
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) <> NULL
----

query I rowsort
SELECT AVG ( + + col2 ) FROM tab0 GROUP BY col0, col2, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 + + col2 col1 FROM tab2 GROUP BY col2, col0
----
0

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT ( + AVG ( DISTINCT + col2 ) ) IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT - - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 WHERE - col2 IS NULL GROUP BY col0, col2, col0 HAVING NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 WHERE NOT col2 + - + col1 <> NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT AVG ( ALL - col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT ( + col2 ) IS NULL
----
22
28
82

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 * + col1 * col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
137924
368219
461709

query I rowsort
SELECT col0 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-3483
0
0

query II rowsort
SELECT ALL + col1 AS col2, + col1 AS col0 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + AVG ( - col0 ) FROM tab2 WHERE NOT ( NULL IS NULL ) GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 AS col2 FROM tab2 WHERE NULL >= col0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 cor0 GROUP BY col2, col1, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NOT + col0 <> NULL GROUP BY col0
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT ALL - - col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 WHERE NOT ( ( NOT col1 * - col0 IS NULL ) ) GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 col1, - col1 AS col0 FROM tab1 GROUP BY col2, col1
----
45
-57
71
-44
8
-6

query I rowsort
SELECT ALL col0 + col0 AS col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col2 * + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT col0 IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE + col0 NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT - - col2 AS col1 FROM tab2 WHERE - + col2 IS NULL GROUP BY col1, col2
----

query II rowsort
SELECT col0, - col0 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * - col0 col2 FROM tab0 GROUP BY col0, col2, col0
----
-1849
-676
-6889

query I rowsort
SELECT - AVG ( DISTINCT col2 ) AS col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT col2 + col2 AS col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col1 - + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
-102
-115
-14

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col2 AS col1 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NULL BETWEEN - AVG ( DISTINCT - col2 ) AND NULL
----

query I rowsort
SELECT ALL col1 + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
162

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col0, col0, col1
----
44
57
6

query I rowsort
SELECT - + 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 ALL - - col1 col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) NOT BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
58
79
87

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
58
79
87

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT - + col0 * col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-3483
0
0

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab2 GROUP BY col0, col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT ALL col0 + - + col2 * + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + - col2 <> NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NULL < NULL GROUP BY col1
----

query I rowsort
SELECT + + col2 * col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
3364
6241
7569

query I rowsort
SELECT - - col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + 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 col0 col0 FROM tab2 GROUP BY col1, col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 * - col1 AS col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - + col2 * - AVG ( - col2 ) AS col0 FROM tab0 cor0 GROUP BY col2, col1, col2 HAVING ( - col2 + AVG ( + col0 ) ) IS NULL
----

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 tab0 cor0 WHERE col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NOT + col1 < ( NULL ) GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) > NULL GROUP BY col1
----

query I rowsort
SELECT ALL - - col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col0 HAVING NULL = col0
----

query I rowsort
SELECT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT - col0 * - col0 + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
462
6642
756

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - col0 * + col0 AS col1 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 * - col1 AS col1 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING NOT col1 IS NULL
----
0
81

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col1, col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - - AVG ( - col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL IS NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT col1 FROM tab0 GROUP BY col2, col2, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + + col0 IS NOT NULL
----

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT col1 AS col1 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT - + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING ( col2 ) IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + col2 FROM tab2 cor0 GROUP BY col1, col2 HAVING ( + + col2 ) IS NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col2 AS col2 FROM tab0 cor0 GROUP BY col2 HAVING ( NULL ) < NULL
----

query I rowsort
SELECT col1 * + col1 AS col1 FROM tab2 GROUP BY col0, col1
----
1681
3481
3721

query I rowsort
SELECT ALL col1 * col1 - col1 * - col0 FROM tab0 GROUP BY col1, col0 HAVING NOT ( NULL ) <> NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 * - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 cor0 GROUP BY col2, col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 * + - col0 + - col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-1892
-6972
-702

onlyif mysql # DIV for integer division: 
query I rowsort label-8238
SELECT ALL col1 DIV + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8238
SELECT ALL col1 / + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT ALL col2 + - + col2 FROM tab1 GROUP BY col2
----
0
0
0

query II rowsort
SELECT + col1, + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL col1 * col0 * - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-2904
-295856
-44688

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query II rowsort
SELECT col1 AS col0, col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col2 * - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * - col0 col2 FROM tab1 GROUP BY col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT + + col0 * col0 * + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
10648
21952
551368

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

query II rowsort
SELECT + col2 AS col0, col0 + - col0 AS col1 FROM tab0 GROUP BY col2, col0, col0
----
24
0
38
0
79
0

query I rowsort
SELECT ALL + + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 * - col2 FROM tab2 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - col1 * col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING ( NOT col0 IS NOT NULL )
----

query I rowsort
SELECT col1 * - col1 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + col0 - + col0 AS col2 FROM tab0 GROUP BY col0
----
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL - - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING - col1 IS NOT NULL
----
41
59
61

query I rowsort
SELECT col2 + - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-12
-34
72

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col2 AS col2, col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
45
-71
71
-8
8

query I rowsort
SELECT col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
1936
3249
36

query II rowsort
SELECT - col1, col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 AS col0, - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1 HAVING - col2 < NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN + col0 AND col1 GROUP BY col2
----

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

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
-26
-43
-83

query I rowsort
SELECT + AVG ( + col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - AVG ( DISTINCT + col0 ) IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + + AVG ( DISTINCT + col2 ) IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col2 + + col2 * - col2 FROM tab2 GROUP BY col2
----
-3306
-6162
-7482

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - col1 AS col2 FROM tab2 WHERE NOT ( - col2 ) < NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 + + col0 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING col0 IS NOT NULL
----
164
44
56

onlyif mysql # DIV for integer division: 
query I rowsort label-8286
SELECT + col2 DIV + + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8286
SELECT + col2 / + + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * col2 col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
1444
576
6241

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING ( NULL <> NULL )
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL = col1
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 * col1 * col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
531441

query I rowsort
SELECT - col2 * - - col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING ( ( ( NOT ( NULL ) >= NULL ) ) )
----

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 ALL + col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL - AVG ( DISTINCT + - col2 ) FROM tab1 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col0 + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col0, - col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-484
-28
-784
-82
-6724

query I rowsort
SELECT - + col1 AS col0 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col2, - col1 AS col0 FROM tab2 GROUP BY col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 * - + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 * col1 col1 FROM tab1 GROUP BY col0, col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 WHERE NOT NULL NOT IN ( - col0 ) GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND col1 * - col1
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab2 GROUP BY col2, col0, col2
----
58
79
87

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 col0 + col0 AS col2 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col2, col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT ALL + - col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col1 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT ALL - col1 * col1 + - col1 FROM tab1 GROUP BY col1
----
-1980
-3306
-42

query I rowsort
SELECT - col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT ( col0 IS NOT NULL )
----

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <> ( + - col0 )
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col0
----

query I rowsort
SELECT - col2 * + col2 FROM tab1 AS cor0 WHERE NULL IN ( col1 ) GROUP BY col2
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1, col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 * - col1 / - - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT col2 + + - col2 IS NULL
----
-22
-28
-82

query I rowsort
SELECT - - col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 + + col1 FROM tab1 GROUP BY col2, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col1 col2 FROM tab2 cor0 GROUP BY col1, col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 FROM tab1 WHERE NOT NULL >= NULL GROUP BY col0, col2, col2
----

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab0 AS cor0 WHERE col0 + + col0 IS NOT NULL GROUP BY col1, col0, col1
----
0
0
81

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 WHERE NULL = NULL GROUP BY col2
----

query II rowsort
SELECT DISTINCT - AVG ( col2 ) * - col0 AS col1, - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
1260
-45
176
-8
5822
-71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND - - col2 / - col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 * - - col2 * - + col2 * + col2 AS col0 FROM tab0 GROUP BY col1, col2, col2
----
-2085136
-331776
-38950081

query I rowsort
SELECT ALL + col0 * + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT col1 * + - col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8375
SELECT col2 DIV col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
1

skipif mysql # not compatible
query I rowsort label-8375
SELECT col2 / col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
1

query I rowsort
SELECT ALL col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
1444
576
6241

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING ( NULL ) >= NULL
----

query I rowsort
SELECT + col1 * col1 - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
1589
3390
3706

query I rowsort
SELECT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT + col1 * - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col1 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + - col0 * - col0 - + col0 + - col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
180
8008
8188

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE col2 NOT BETWEEN - col0 AND NULL GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL col1 * col1 * + col1 AS col1 FROM tab2 GROUP BY col1
----
205379
226981
68921

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1 HAVING NOT NULL >= - col1
----

query I rowsort
SELECT col0 * AVG ( ALL - - col0 ) FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - + col1 FROM tab2 cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT - + col0 * - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL col2 * col2 + + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
2053
5123
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
44
57
6

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING col2 IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 * col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
1936
3249
36

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 - + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 + + + col2 * - col2 * + col2 AS col1 FROM tab0 GROUP BY col2
----
-13800
-492960
-54834

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col2 HAVING NULL >= col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT col2 * + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT - col1 FROM tab2 WHERE NOT NULL < + + col2 GROUP BY col1
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT DISTINCT col0 AS col0, - col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
22
-44
28
-56
82
-164

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 + + col0 FROM tab1 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 * + col1 col2 FROM tab2 cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col2, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 * col0 col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + - col0 * - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
10648
21952
551368

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - + col2 * + col2 col1 FROM tab2 GROUP BY col2
----
195112
493039
658503

query I rowsort
SELECT ALL + col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL = + col0
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col2, col0 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT - + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col0, col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab1 GROUP BY col0, col0, col1
----
44
57
6

query I rowsort
SELECT AVG ( DISTINCT - col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL = AVG ( DISTINCT col0 )
----

query I rowsort
SELECT col2 + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
158
48
76

query I rowsort
SELECT + AVG ( + col2 ) * + col2 AS col0 FROM tab1 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82

query I rowsort
SELECT ALL + + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - + AVG ( DISTINCT + col1 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col2 * + col2 AS col0 FROM tab0 GROUP BY col1, col2, col0
----
1444
576
6241

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8452
SELECT ALL col0 DIV + col0 FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8452
SELECT ALL col0 / + col0 FROM tab1 GROUP BY col0
----
1
1
1

query I rowsort
SELECT ALL + col2 + + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-12
-34
72

query I rowsort
SELECT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT + col2 * - col2 AS col2 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 WHERE NOT ( NULL ) < NULL GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col0, col1, col0
----
41
59
61

query I rowsort
SELECT + - col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col0, col1, col0
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
24
38
79

query I rowsort
SELECT + col0 - + col0 AS col1 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT + col0 + - col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-8465
SELECT DISTINCT - col2 DIV col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( ( NULL ) IS NULL )
----
-1

skipif mysql # not compatible
query I rowsort label-8465
SELECT DISTINCT - col2 / col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( ( NULL ) IS NULL )
----
-1

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT ( + - col1 ) IS NULL
----
44
57
6

query I rowsort
SELECT ALL - + col0 + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - - col2 IS NULL
----
-166
-52
-86

query I rowsort
SELECT ALL col2 * - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - col2 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1, col1
----
58
79
87

query I rowsort
SELECT ALL - col0 * + + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col1 + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
162

query I rowsort
SELECT - col0 FROM tab2 WHERE NULL <= NULL GROUP BY col0
----

query I rowsort
SELECT col0 * col2 FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

query II rowsort
SELECT DISTINCT col1 AS col1, col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT col2 * - col2 AS col1 FROM tab2 AS cor0 WHERE NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - AVG ( - + col0 ) IS NULL
----
58
79
87

query I rowsort
SELECT ALL - col1 + - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT + + col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 + + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + + col0 - col0 + col2, + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
43
38
83
79
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 col2, col1 * - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
15
-3721
91
-3481
92
-1681

query I rowsort
SELECT col0 - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - col0 + + + col0 AS col1 FROM tab2 GROUP BY col0, col1, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col0 FROM tab2 WHERE + col0 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT AVG ( ALL - col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 WHERE NOT col0 * col2 * + col1 * + - col1 + + col2 IS NOT NULL GROUP BY col1, col0, col2, col2
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NOT NULL IS NULL )
----
0
0
81

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-8495
SELECT DISTINCT + col0 DIV col0 FROM tab1 GROUP BY col0, col0
----
1

skipif mysql # not compatible
query I rowsort label-8495
SELECT DISTINCT + col0 / col0 FROM tab1 GROUP BY col0, col0
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 WHERE ( col0 * - col0 ) >= ( NULL ) GROUP BY col1
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL - + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( + AVG ( DISTINCT - + col2 ) ) IS NULL
----
-81
0

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + - col2 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT AVG ( - col2 ) AS col1 FROM tab0 cor0 WHERE NOT ( NULL ) <> NULL GROUP BY col2
----

query I rowsort
SELECT col2 * + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NOT ( NULL ) <> ( NULL ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL col0 / + col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL + col0 AS col1, col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col1, col0, col2 HAVING col1 + - col2 IS NOT NULL
----
26
43
83

query II rowsort
SELECT col1 AS col2, + col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col1 FROM tab1 cor0 GROUP BY col1, col1, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - col0 * + - col0 FROM tab2 GROUP BY col0 HAVING AVG ( ALL - col1 ) IS NOT NULL
----
225
8281
8464

query I rowsort
SELECT + col2 AS col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
44
57
6

query I rowsort
SELECT ALL col2 * + col0 AS col2 FROM tab1 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT + AVG ( ALL col2 ) FROM tab1 cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-8526
SELECT col1 DIV col1 FROM tab2 GROUP BY col1 HAVING col1 IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8526
SELECT col1 / col1 FROM tab2 GROUP BY col1 HAVING col1 IS NOT NULL
----
1
1
1

query I rowsort
SELECT + col2 * col2 * - col2 FROM tab2 GROUP BY col2, col2
----
-195112
-493039
-658503

query I rowsort
SELECT ALL + col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL + col1 + - - col1 AS col0 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT ALL + col2 - - + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2
----
174
237
261

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL <> - col2
----

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col1 col2 FROM tab0 AS cor0 WHERE col2 IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab1 GROUP BY col1, col1, col1
----
1936
3249
36

query I rowsort
SELECT ALL - col1 + + col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 AS col2 FROM tab0 cor0 WHERE NOT NULL <= NULL GROUP BY col1, col1
----

query I rowsort
SELECT - - col0 * + + col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL - - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab2 GROUP BY col1, col2, col2
----
41
59
61

query I rowsort
SELECT AVG ( DISTINCT + col0 ) * + col1 + col0 + - col0 FROM tab2 GROUP BY col1, col0 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT AVG ( DISTINCT col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8549
SELECT DISTINCT - col0 DIV + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
-1

skipif mysql # not compatible
query I rowsort label-8549
SELECT DISTINCT - col0 / + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
-1

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1, col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col0, col1
----
58
79
87

query I rowsort
SELECT col0 - - col0 FROM tab2 GROUP BY col0
----
182
184
30

onlyif mysql # DIV for integer division: 
query I rowsort label-8553
SELECT ALL col1 DIV col1 AS col0 FROM tab2 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8553
SELECT ALL col1 / col1 AS col0 FROM tab2 GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col2, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 * + - col1 FROM tab2 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL - - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - - col1 * - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col1 * + col1 AS col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

onlyif mysql # DIV for integer division: 
query I rowsort label-8561
SELECT ALL + col1 DIV - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8561
SELECT ALL + col1 / - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-1
-1
-1

query I rowsort
SELECT col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 * - col2 * - col2 * + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-11316496
-38950081
-57289761

query I rowsort
SELECT ALL AVG ( ALL - col0 ) FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) <= NULL
----

query II rowsort
SELECT + + col2, col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col2, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 GROUP BY col1, col2, col0 HAVING NULL <= ( NULL )
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING ( NULL ) IS NULL
----
26
43
83

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL = ( - col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 WHERE NULL <> col1 * - col0 GROUP BY col2
----

query I rowsort
SELECT ALL col2 * col2 FROM tab1 GROUP BY col2, col2, col1
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - AVG ( ALL col2 ) >= + col1
----

query I rowsort
SELECT DISTINCT - col0 * col0 + col2 FROM tab0 GROUP BY col2, col0 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 WHERE col2 IS NOT NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col2, col1, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query II rowsort
SELECT col1 + + col1, col1 AS col2 FROM tab1 GROUP BY col1
----
114
57
12
6
88
44

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1 HAVING + AVG ( DISTINCT - - col1 ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
15
91
92

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0, col1, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 - - col2 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
158
48
76

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT + + col1 * col1 FROM tab0 cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT - AVG ( ALL - + col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 + col2 AS col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col0 + + col0 + + + col0 AS col1 FROM tab0 GROUP BY col0
----
129
249
78

query II rowsort
SELECT col0, + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - AVG ( col1 ) col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT col2 * col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * - col0 - - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT DISTINCT col2 * - + col0 AS col2 FROM tab1 GROUP BY col2, col0
----
-1260
-176
-5822

onlyif mysql # DIV for integer division: 
query I rowsort label-8608
SELECT ALL - col2 DIV col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8608
SELECT ALL - col2 / col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab2 WHERE ( NULL ) NOT IN ( col1 ) GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT - col2 col2, col2, col2 AS col1 FROM tab2 GROUP BY col2
----
9 values hashing to 0b557cf9945bfac98ef8ff910306a370

query I rowsort
SELECT + col0 * + - col0 + + col0 FROM tab1 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT DISTINCT - col1 + col1 + - - col1 FROM tab2 GROUP BY col1
----
41
59
61

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 AS col1 FROM tab0 GROUP BY col1, col2, col2
----
24
38
79

query II rowsort
SELECT col0 AS col1, col0 FROM tab1 GROUP BY col2, col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
-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 - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 - + - col1 AS col1 FROM tab2 GROUP BY col2, col1
----
118
122
82

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query II rowsort
SELECT ALL - col0 AS col1, col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
87
-91
79
-92
58

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col2 + + col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 IS NOT NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT col0 >= NULL
----

query I rowsort
SELECT col2 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + 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 + col2 col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col1, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
45
71
8

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0, col2 HAVING ( NULL ) IS NULL
----
22
28
82

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-81
0
0

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT + + col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT + - col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 + + col2 col0 FROM tab2 GROUP BY col2, col2, col1
----
116
158
174

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT - - col1 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL col1 * col1 AS col2 FROM tab1 cor0 GROUP BY col1 HAVING NOT +