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 + - col2 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 AS col0, + col0 col2 FROM tab2 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 tab0 AS cor0 GROUP BY col1
----
0
81

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL > ( col2 )
----

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

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

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

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

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

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

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

query I rowsort
SELECT + 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 tab1 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - AVG ( + + col0 ) AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT col1 IS NULL AND 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 tab0 WHERE ( NULL ) IN ( + col1 ) GROUP BY col2
----

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

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

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

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

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 NULL = col0 / col0
----

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

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

query I rowsort
SELECT ALL - - 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 tab2 GROUP BY col1, col0
----
-15
-91
-92

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT - 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 - col1 * + col1 col2 FROM tab0 GROUP BY col1, col1
----
-6561
0

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 + - + col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3306
-6162
-7482

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

query I rowsort
SELECT - col2 FROM tab0 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 NULL IS NOT NULL OR ( - col0 ) = NULL
----

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

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

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

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

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

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

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

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
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 ALL col2 FROM tab0 GROUP BY col2, col1, col1 HAVING + col2 IS NOT NULL
----
24
38
79

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

skipif mysql # not compatible
query I rowsort label-87
SELECT DISTINCT - col0 / - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 + col1 col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

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

query I rowsort
SELECT col0 + - col0 FROM tab1 GROUP BY col0 HAVING ( NULL > NULL )
----

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE col2 NOT IN ( col2 ) GROUP BY col2
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - - col1 * - col1 * col2 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
-274999
-323727
-97498

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

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

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

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

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 ALL + col2 col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

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

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

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

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

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

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

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

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

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col2, 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 col0 FROM tab1 GROUP BY col2, col1, col1
----
44
57
6

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

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

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

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

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

query I rowsort
SELECT - 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 + - col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

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

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

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

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

query I rowsort
SELECT ALL - + col2 AS col0 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
----
0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING + col2 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 col2 + - col2 FROM tab1 GROUP BY col2
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-194
SELECT ALL col1 DIV - - col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-194
SELECT ALL col1 / - - col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
1
1
1

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

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

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

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col0
----
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 DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

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

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 ALL + col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NULL > NULL
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col2 * - col2 + col2 FROM tab2 GROUP BY col2, col2
----
-3306
-6162
-7482

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-224
SELECT col1 + col1 DIV - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-224
SELECT col1 + col1 / - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

query II rowsort
SELECT DISTINCT + col0, - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT DISTINCT col2 * - - col2, col1 FROM tab1 GROUP BY col2, col1
----
2025
57
5041
44
64
6

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

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

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

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-251
SELECT DISTINCT col2 DIV col2 FROM tab1 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-251
SELECT DISTINCT col2 / col2 FROM tab1 GROUP BY col2
----
1

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

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

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

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

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

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 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 - - col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING - + col2 IS NULL
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col0 * - col2 FROM tab2 AS cor0 WHERE NOT col0 >= col2 GROUP BY col2, col0
----
-1305

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

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

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, 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 - col1 * + col1 FROM tab0 GROUP BY col1
----
-6561
0

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

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

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

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

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

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

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

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

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

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 + col0 * + col0 + col0 FROM tab1 GROUP BY col0
----
506
6806
812

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

onlyif mysql # DIV for integer division: 
query I rowsort label-354
SELECT ALL + col2 * col2 * - col2 DIV + col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

skipif mysql # not compatible
query I rowsort label-354
SELECT ALL + col2 * col2 * - col2 / + col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

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

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

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

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

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

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0 HAVING - col0 IN ( col0 )
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

onlyif mysql # DIV for integer division: 
query I rowsort label-376
SELECT DISTINCT col0 DIV + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1

skipif mysql # not compatible
query I rowsort label-376
SELECT DISTINCT col0 / + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1

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

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

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

query I rowsort
SELECT DISTINCT + col0 + - - col0 + + col0 * + + col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

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

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

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 DISTINCT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col0 * col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

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

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

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

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 DISTINCT - col0 col2 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT col1 AS col2, col1 * col1 AS col1 FROM tab1 GROUP BY col1
----
44
1936
57
3249
6
36

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col1 FROM tab2 WHERE NOT col1 * col0 IS NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - + 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-425
SELECT + col0 + + col0 * + col0 DIV - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

skipif mysql # not compatible
query I rowsort label-425
SELECT + col0 + + col0 * + col0 / - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
182
184
30

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING + col0 NOT IN ( + col2, col0 )
----

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col0 * + + 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 col2 + + col2 col1 FROM tab0 GROUP BY col2, col2
----
158
48
76

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

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

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

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

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

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

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 col0 FROM tab1 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + col1 col2 FROM tab2 GROUP BY col1
----
118
122
82

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

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING + col2 <> + - col2 + + + AVG ( DISTINCT col1 )
----
24
38
79

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

query II rowsort
SELECT ALL - 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 DISTINCT + - col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

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

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

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

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

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

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

query I rowsort
SELECT col2 AS col0 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 col2
----
0
0
0

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

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

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

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab1 cor0 GROUP BY col1, col0
----
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 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
102
115
14

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT DISTINCT - col2 AS col1, col1 + + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
-45
114
-71
88
-8
12

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

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

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * col0 col1 FROM tab2 GROUP BY col0, col1 HAVING - col1 / col0 IS NOT NULL
----
225
8281
8464

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 - - col0 col2 FROM tab2 GROUP BY col0, col0
----
182
184
30

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

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

onlyif mysql # DIV for integer division: 
query II rowsort label-549
SELECT - col0, + col0 DIV + col0 + - + col0 AS col0 FROM tab0 GROUP BY col0
----
-26
-25
-43
-42
-83
-82

skipif mysql # not compatible
query II rowsort label-549
SELECT - col0, + col0 / + col0 + - + col0 AS col0 FROM tab0 GROUP BY col0
----
-26
-25
-43
-42
-83
-82

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 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 DISTINCT col1 col0 FROM tab0 GROUP BY col1, col0
----
0
81

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

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

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

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

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 tab2 AS cor0 GROUP BY col0, col2, col1
----
-41
-59
-61

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL col0 * col0 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
1892
6972
702

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * - col1 * - col1 col0 FROM tab2 GROUP BY col0, col1, col2
----
274999
323727
97498

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

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

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

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col2, 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 DISTINCT - - col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

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

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

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

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

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

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

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

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

query II rowsort
SELECT ALL + + col0, + col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
15
61
91
59
92
41

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

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

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

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

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

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

query I rowsort
SELECT - col0 / + col0 FROM tab2 GROUP BY col0 HAVING NULL BETWEEN NULL AND col0
----

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

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

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-659
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-659
SELECT col1 / + col1 col0 FROM tab2 GROUP BY col1
----
1
1
1

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

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

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

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

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

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

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

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

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

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

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 tab1 cor0 GROUP BY col2
----
45
71
8

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - col0 AS col0, col1 * - col1 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-36
-28
-3249
-82
-1936

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT col2 + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - - col2 IS NULL
----
102
115
14

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * - col0 + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

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

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

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

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 + col0 FROM tab0 GROUP BY col1, col0, col0 HAVING NOT AVG ( col0 ) IS NULL
----
26
43
83

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL col2 FROM tab2 cor0 WHERE ( col1 ) IS NOT NULL GROUP BY col2
----
58
79
87

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL + col0 * - col0 * col0 AS col2 FROM tab2 GROUP BY col0
----
-3375
-753571
-778688

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT NULL >= NULL GROUP BY col2, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * col0 col1 FROM tab1 GROUP BY col0, col2
----
1260
176
5822

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 II rowsort
SELECT DISTINCT - col2 AS col0, + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + - 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 ALL - col0 col1 FROM tab0 GROUP BY col0, col0 HAVING - col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL col2 * + col2 + - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
1980
4970
56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 tab1 GROUP BY col1, col2, col0
----
45
71
8

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

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

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

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

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

query I rowsort
SELECT col2 - - col1 FROM tab1 GROUP BY col2, col1
----
102
115
14

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

skipif mysql # not compatible
query I rowsort label-855
SELECT ALL - 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 col1 col1 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - 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 ALL - col2 col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT - col1 IS NOT NULL
----

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

query I rowsort
SELECT + col1 / - col0 FROM tab0 cor0 WHERE NOT NULL NOT IN ( col0 ) GROUP BY col0, col1
----

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

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

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

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

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

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

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

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

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

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

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

skipif mysql # not compatible
query I rowsort label-871
SELECT DISTINCT - col0 / - col0 FROM tab1 GROUP BY col0
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 * col1 col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
1936
3249
36

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

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

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 DISTINCT col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query II rowsort
SELECT col0 AS col2, + col0 + col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
44
28
56
82
164

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * col2 col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT + + col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col0 * + + col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col0 * - + col0 FROM tab0 GROUP BY col1, col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

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 tab2 GROUP BY col0, col2
----
225
8281
8464

query I rowsort
SELECT col0 FROM tab0 WHERE - col1 IS NULL GROUP BY col0
----

query II rowsort
SELECT ALL + col0, - col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - - col2 * - AVG ( DISTINCT + + col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT col2 + + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0 HAVING + col0 > ( NULL )
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-22
-28
-82

query I rowsort
SELECT - + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL BETWEEN NULL AND col2
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col1, col2 HAVING NOT col1 IS NULL
----
24
38
79

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL col2 * - col2 * + + col2 FROM tab2 AS cor0 GROUP BY col2
----
-195112
-493039
-658503

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 * col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT col1 >= NULL
----

query I rowsort
SELECT ALL col1 + - col1 FROM tab0 GROUP BY col1, col1
----
0
0

query I rowsort
SELECT col1 + col0 + + + col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-968
SELECT ALL + col0 DIV + col1 AS col0 FROM tab2 GROUP BY col0, col1, col0
----
0
1
2

skipif mysql # not compatible
query I rowsort label-968
SELECT ALL + col0 / + col1 AS col0 FROM tab2 GROUP BY col0, col1, col0
----
0
1
2

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT - col2 + + - col2 AS col1 FROM tab0 GROUP BY col0, col0, col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-973
SELECT col2 DIV - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-973
SELECT col2 / - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 * + col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL = ( + col1 )
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT ALL col0, + col0 AS col1 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT + - col1 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col0 * - + col1 - - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-3731
-5310
-854

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

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 ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL - col0 * + col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col2 + - col1 AS col1 FROM tab1 GROUP BY col1, col2
----
-12
2
27

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 + col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 * - - col2 + - + col2 FROM tab0 GROUP BY col2
----
1406
552
6162

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT col1 * + AVG ( col1 ) FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
-45
-71
-8

query I rowsort
SELECT - col0 + + col0 + col0 AS col1 FROM tab0 GROUP BY col0
----
26
43
83

query II rowsort
SELECT ALL + col1, col1 AS col1 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col0, col1, col0 HAVING ( NULL ) IS NULL
----
41
59
61

query I rowsort
SELECT col2 - col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - col1 + col1 + col1 AS col0 FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 FROM tab2 cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
44
57
6

query II rowsort
SELECT + col2, - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
-24
38
-38
79
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-1011
SELECT - col1 DIV - col1 FROM tab2 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1011
SELECT - col1 / - col1 FROM tab2 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col2, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 + col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * + col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab1 GROUP BY col1, col0
----
-114
-12
-88

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
-24
-38
-79

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + + col2 + col2 FROM tab2 cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + col1 - - col1 AS col0 FROM tab1 GROUP BY col0, col1
----
114
12
88

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col2 * col0 AS col0 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL + col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col1 AS col0 FROM tab1 cor0 GROUP BY col2, col0, col1
----
44
57
6

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

query I rowsort
SELECT - col0 * - + col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-1042
SELECT DISTINCT + col2 DIV - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-1042
SELECT DISTINCT + col2 / - col2 FROM tab1 AS cor0 GROUP BY col2
----
-1

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + - + col0 AS col1 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col2 + + - col2 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - - col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL - col2 * col2 FROM tab0 cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
58
79
87

query I rowsort
SELECT + - col2 FROM tab0 cor0 GROUP BY col1, col0, col2
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-1060
SELECT - - col0 DIV - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1060
SELECT - - col0 / - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-1
-1
-1

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - + col0 + + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

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, col1 HAVING NOT ( NULL ) < - col1 + - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab1 GROUP BY col1, col2
----
2025
5041
64

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col1, col1
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query II rowsort
SELECT ALL - col0 * - col0, col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
1849
43
676
26
6889
83

query I rowsort
SELECT - col1 * col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING col0 * - + col1 > NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL col2 * col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3422
6320
7656

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT col0 + col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 * + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

query I rowsort
SELECT ALL col2 + + - col0 FROM tab2 GROUP BY col2, col0
----
-12
-34
72

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col0 * - col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2, col0, col2 HAVING ( ( NULL ) IS NULL )
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 * col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-1980
-4970
-56

query I rowsort
SELECT col1 + col1 * col1 FROM tab0 cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-1094
SELECT + col1 DIV col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1094
SELECT + col1 / col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT + - col2 + + col2 + col2 * - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + - col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 AS 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 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL 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 DISTINCT + col1 FROM tab0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query II rowsort
SELECT + col2 + - col2 AS col1, col1 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
44
0
57
0
6

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT - - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col0 + - col2 FROM tab1 GROUP BY col2, col0 HAVING NULL < ( NULL )
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col1, col2, col2
----
58
79
87

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col1, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING NOT col1 IS NULL
----
-22
-28
-82

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 GROUP BY col1, col2
----
45
71
8

query II rowsort
SELECT DISTINCT col1 * - col2 AS col0, - col1 FROM tab2 GROUP BY col1, col2
----
-2378
-41
-4661
-59
-5307
-61

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL + + col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT - col0 + + col0 FROM tab0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IN ( - col1 * + col0 )
----

query II rowsort
SELECT ALL - col1 AS col2, col0 FROM tab0 GROUP BY col0, col1
----
-81
43
0
26
0
83

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
41
59
61

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col2 - - - col2 AS col0 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL - col0 + col0 FROM tab2 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 GROUP BY col2 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 - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 * col1 AS col2 FROM tab0 GROUP BY col2, col1
----
-1944
0

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

onlyif mysql # DIV for integer division: 
query I rowsort label-1141
SELECT col1 DIV - col1 FROM tab1 cor0 GROUP BY col2, col1, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1141
SELECT col1 / - col1 FROM tab1 cor0 GROUP BY col2, col1, col1
----
-1
-1
-1

query I rowsort
SELECT col1 * + + col1 AS col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT col2 + col2 FROM tab2 GROUP BY col2
----
116
158
174

query II rowsort
SELECT ALL + col0, - col2 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
15
-87
91
-79
92
-58

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab2 GROUP BY col0, col1
----
-225
-8281
-8464

query I rowsort
SELECT ALL - col0 * col2 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 col1 col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

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 DISTINCT - col0 * - + col0 FROM tab2 GROUP BY col2, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col1 * - col2 FROM tab0 GROUP BY col2, col1
----
-1944
0

onlyif mysql # DIV for integer division: 
query I rowsort label-1154
SELECT ALL + col0 DIV + col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1154
SELECT ALL + col0 / + col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( col2 )
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 + + - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
0

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col2 AS col1, - col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT col1 * - - col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 + col0 FROM tab1 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 + + col0 col2 FROM tab2 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col0, col0, col2
----
24
38
79

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NOT + + col0 IS NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query II rowsort
SELECT + col0, col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + + col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

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 tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT + - col0 + - col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col0 + col0 * col0 AS col0 FROM tab0 GROUP BY col0, col0, col0
----
1892
6972
702

query I rowsort
SELECT DISTINCT col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 + + col2 FROM tab0 GROUP BY col2
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-41
-59
-61

query II rowsort
SELECT ALL col1 + + + col1, - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL = - col1
----

query I rowsort
SELECT col2 + + col2 FROM tab0 GROUP BY col2
----
158
48
76

query II rowsort
SELECT DISTINCT + - AVG ( ALL - - col2 ) AS col1, col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT - col0 + - + col0 + - col0 FROM tab0 GROUP BY col0
----
-129
-249
-78

query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL - - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
26
43
83

query II rowsort
SELECT - col2, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT + col1 AS 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 DISTINCT col2 col1 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT col0 * col0 AS col2 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col2 * - col2 FROM tab2 GROUP BY col2, col0
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab2 AS cor0 WHERE NULL < col1 + + col1 GROUP BY col1, col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 GROUP BY col1, col1
----
0
81

query II rowsort
SELECT - - col0, + col1 FROM tab2 AS cor0 GROUP BY col0, col2, col1 HAVING ( NULL ) <> col2 * - col2
----

query I rowsort
SELECT ALL + col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col1, col1 AS col0 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query II rowsort
SELECT - col0 AS col1, col0 + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
-22
44
-28
56
-82
164

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + - col0 col0 FROM tab0 GROUP BY col1, col0
----
-26
-83
38

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 * - col1 FROM tab1 GROUP BY col2, col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col1 * col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
185193
216
85184

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab1 GROUP BY col1
----
114
12
88

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 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query II rowsort
SELECT + col0, + col0 FROM tab0 cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT + col0 / - col0 * + col0 - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col0 AS col0 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - + col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col0 + - col0 FROM tab0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT DISTINCT - col0 * col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2, - col2 col1 FROM tab1 GROUP BY col2
----
45
-45
71
-71
8
-8

query II rowsort
SELECT + col0, col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL col0 * - col0 / - - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING + AVG ( ALL + - col2 ) IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT + + col1 FROM tab0 cor0 GROUP BY col1
----
0
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 II rowsort
SELECT col0, + col0 AS col2 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query II rowsort
SELECT ALL - col1 + - + col1 AS col2, col1 AS col2 FROM tab2 GROUP BY col1
----
-118
59
-122
61
-82
41

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col0 * + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col1 + + - col1 * + + col1 FROM tab2 GROUP BY col1
----
-1640
-3422
-3660

query I rowsort
SELECT DISTINCT + + col2 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL >= - col0
----

query I rowsort
SELECT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + + col2 * col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
1260
176
5822

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - + col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0 HAVING col0 * - AVG ( DISTINCT col0 ) IS NOT NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - col2 col0, + col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col2, col0, col1
----
15
91
92

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL col2 - + + col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col2 - col2 FROM tab1 GROUP BY col2, col2
----
-142
-16
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - col2 + col2 + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query II rowsort
SELECT - + col2, + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT AVG ( - col0 ) FROM tab0 AS cor0 WHERE ( NULL ) >= + - col1 * - col0 GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 GROUP BY col2, col0, col0
----
58
79
87

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + col0 * col0 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-22
-28
-82

query II rowsort
SELECT + + col2, + col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col2
----

query II rowsort
SELECT ALL col1 AS col1, + col1 FROM tab2 GROUP BY col0, col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col0, col2, col0
----
45
71
8

query I rowsort
SELECT - + col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab0 WHERE NOT col1 - - col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 + + - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

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 + col2 col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col0, col2, col2 HAVING - AVG ( col2 ) IS NULL
----

query I rowsort
SELECT - col2 + + col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - + col0 AS col0 FROM tab1 WHERE NOT NULL < NULL GROUP BY col0, col0
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT col1 * + col1 * - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT ALL + + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT col1 FROM tab0 GROUP BY col2, col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col0 * - col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 * + + col0 * - col0 FROM tab0 GROUP BY col0
----
-17576
-571787
-79507

query II rowsort
SELECT col0 AS col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query II rowsort
SELECT DISTINCT + - col0, - col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col0, col2, col1
----
-24
-38
-79

query I rowsort
SELECT col1 FROM tab2 WHERE col0 NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * col1 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-6561
0

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-58
-79
-87

query I rowsort
SELECT - 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 - col1 * col1 col0 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

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 col0 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NULL <> ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col2 * + - col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-2025
-5041
-64

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1, col2
----
45
71
8

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 DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 + col0 FROM tab2 GROUP BY col0
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col0 col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col2 + col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + col1 + col1 AS col0 FROM tab0 GROUP BY col1
----
0
162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-1359
SELECT DISTINCT - col2 + col2 DIV col0 FROM tab2 GROUP BY col2, col0
----
-58
-79
-82

skipif mysql # not compatible
query I rowsort label-1359
SELECT DISTINCT - col2 + col2 / col0 FROM tab2 GROUP BY col2, col0
----
-58
-79
-82

query I rowsort
SELECT DISTINCT AVG ( DISTINCT + col2 ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING ( col1 ) BETWEEN col1 AND NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 col1, col0 AS col2 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT - 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 col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT + col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query II rowsort
SELECT DISTINCT col2 / col2 AS col1, - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
1
-22
1
-28
1
-82

query I rowsort
SELECT - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

query II rowsort
SELECT ALL + 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 ALL col1 col0 FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT 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 * + col1 col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query II rowsort
SELECT + col0, - col0 AS col2 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
22
28
82

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 II rowsort
SELECT + col2, col2 + + - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col1 - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-38
-79
57

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab2 WHERE NOT NULL <> col0 GROUP BY col2, col2, col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NULL < + col0
----

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col0 * col0 AS col2 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col2, col0 HAVING NOT ( NOT ( NOT NULL IS NULL ) )
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab1 cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
22
28
82

query I rowsort
SELECT ALL + 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 FROM tab0 cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - + col0 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL col2 * col2 + - col2 FROM tab2 GROUP BY col2
----
3306
6162
7482

query II rowsort
SELECT - col1 * + col2, - col2 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2565
2025
-3124
5041
-48
64

query I rowsort
SELECT ALL - + 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 DISTINCT + col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT col0 * - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
22
28
82

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL + col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 * col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 - + + col2 + - col2 col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * - col2 col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 - - col1 AS col0 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

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 + col1 AS col0 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

query II rowsort
SELECT + col2, - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0 HAVING NULL <> ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * col1 + col0 * col0 + - - col1 col0 FROM tab2 GROUP BY col1, col0
----
10186
11821
4007

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col2 + - col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query II rowsort
SELECT ALL col2, col0 FROM tab0 GROUP BY col0, col2
----
24
43
38
83
79
26

query I rowsort
SELECT - + col2 * + + col2 * - col2 + - col2 * + + col2 FROM tab2 AS cor0 GROUP BY col2
----
191748
486798
650934

query I rowsort
SELECT DISTINCT + col2 * - col2 + - col2 FROM tab1 GROUP BY col2, col2
----
-2070
-5112
-72

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 - col2 AS col0 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col2, + col2 FROM tab2 WHERE + col2 IS NOT NULL GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 GROUP BY col2, col1 HAVING NULL > col2
----

query II rowsort
SELECT + col1, - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
44
1936
57
3249
6
36

query I rowsort
SELECT + - col0 * + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + + col0 * + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1, col0
----
-81
0
0

query II rowsort
SELECT DISTINCT + col0 AS col2, col0 AS col2 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 DISTINCT col0 col2 FROM tab2 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col0, col2, col1
----
41
59
61

query I rowsort
SELECT - col2 / - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT - 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 col2 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + col1 + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
38
79

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 + + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col1 * - col0 + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
3526
83

query I rowsort
SELECT DISTINCT + col2 * - col0 / - col2 * AVG ( DISTINCT - col2 ) FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab1 cor0 GROUP BY col2
----
142
16
90

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 + col0 * - - col0 AS col1 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT ALL + AVG ( + + col1 ) AS col0 FROM tab2 GROUP BY col1 HAVING AVG ( - col2 ) <> NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col0 - - col0 * - col0 AS col1 FROM tab1 GROUP BY col0, col0
----
-462
-6642
-756

query I rowsort
SELECT - col0 + + col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
-58
-79
-87

query I rowsort
SELECT - + col1 * + - col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query II rowsort
SELECT DISTINCT + - col0 + col0, col0 AS col1 FROM tab2 WHERE NULL >= NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col2, col0, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT - col1 * - - col1 + - - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 cor0 GROUP BY col0, col1
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL + col2 * + - col2 FROM tab0 cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 cor0 GROUP BY col1, col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT + AVG ( DISTINCT - col2 ) >= NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col0, col0
----
-22
-28
-82

query I rowsort
SELECT col0 * + col0 AS col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
0
0
0

query II rowsort
SELECT DISTINCT col2, col2 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT - + 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 ALL - col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query II rowsort
SELECT col2 AS col0, col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
24
81
38
0
79
0

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col0, col2, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT col2 AS col2, col2 FROM tab0 GROUP BY col2, col1
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT col0 + + col1 FROM tab0 GROUP BY col0, col1, col0
----
124
26
83

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

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 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT ( col2 ) IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT + col2 IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query II rowsort
SELECT DISTINCT col0 * - col0, + col0 AS col0 FROM tab0 GROUP BY col0
----
-1849
43
-676
26
-6889
83

query I rowsort
SELECT DISTINCT + - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 + + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-166
-52
-86

query I rowsort
SELECT ALL col0 + + col0 FROM tab0 cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT - AVG ( DISTINCT + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 * col1 AS col0 FROM tab1 GROUP BY col1, col1, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 cor0 GROUP BY col0, col2, col0
----
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, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + + col2 FROM tab0 WHERE NOT + + col0 IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col2 + - col2 AS col2 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT + + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col0 * + + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

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 ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * - + col2 col0 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT col1 - - AVG ( + + col1 ) FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL - - col0 AS col1 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 col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query II rowsort
SELECT DISTINCT + col1, - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
-41
59
-59
61
-61

query I rowsort
SELECT + + col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - col1 * col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-3772
-5369
-915

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 + + col2 FROM tab0 GROUP BY col2 HAVING NOT AVG ( + col2 ) IS NOT NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 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 + col0 col2 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 FROM tab0 WHERE + col0 > + col0 GROUP BY col0
----

query I rowsort
SELECT col1 + - + col1 * + col1 AS col1 FROM tab1 GROUP BY col1
----
-1892
-30
-3192

query I rowsort
SELECT col2 * - col0 * col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-19575
-490912
-654199

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING + col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT + col1 / + col1 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 * + - col0 AS col2 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col1 * col1 FROM tab0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col0, col2 AS col0 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query II rowsort
SELECT - col1 AS col0, col1 AS col0 FROM tab1 GROUP BY col1
----
-44
44
-57
57
-6
6

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0 HAVING NOT + + col1 IS NOT NULL
----

query II rowsort
SELECT ALL col2 * + - col2 * col2, col2 FROM tab0 GROUP BY col2
----
-13824
24
-493039
79
-54872
38

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + col1 * - + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

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 DISTINCT col1 col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL + - col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query II rowsort
SELECT + col0 AS 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 DISTINCT + col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT + col0 - col0 FROM tab1 GROUP BY col0
----
0
0
0

query II rowsort
SELECT + col2, - col0 FROM tab1 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1, col1 HAVING - - col1 IS NOT NULL
----
0
81

query I rowsort
SELECT ALL col2 FROM tab2 cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col2 FROM tab2 WHERE NOT + col2 = - + col2 GROUP BY col1, col1, col2
----
58
79
87

query I rowsort
SELECT col2 * - col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT ( NOT NULL <> NULL )
----

query I rowsort
SELECT + col0 - + col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1, col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT AVG ( + col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NOT + col0 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1631
SELECT - col2 DIV + col2 AS col1 FROM tab2 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1631
SELECT - col2 / + col2 AS col1 FROM tab2 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT + col1 FROM tab1 WHERE + col2 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT + col1 * col1 FROM tab1 cor0 WHERE NOT col2 BETWEEN NULL AND NULL GROUP BY col1
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL col0 FROM tab0 WHERE + - col1 + col1 IS NOT NULL GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
24
38
79

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 cor0 GROUP BY col0, col0, col2
----
15
91
92

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 col1 + + col1 AS col2 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL + col1 / - col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab1 WHERE col2 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * col0 FROM tab2 AS cor0 WHERE NOT NULL < ( NULL ) GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING - col0 BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE col1 IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING + col2 <> NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col0, col1 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT col2 + col2 AS col1 FROM tab0 GROUP BY col2, col1
----
158
48
76

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL + - col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
44
57
6

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - - col1 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
105
38
79

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-1662
SELECT ALL - col2 DIV col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-1662
SELECT ALL - col2 / col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - AVG ( ALL - col0 ) IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 WHERE NULL = NULL GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1665
SELECT DISTINCT col2 DIV + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1

skipif mysql # not compatible
query I rowsort label-1665
SELECT DISTINCT col2 / + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1

onlyif mysql # DIV for integer division: 
query I rowsort label-1666
SELECT + col2 DIV + col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-1666
SELECT + col2 / + col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
1
1
1

query I rowsort
SELECT DISTINCT - AVG ( col0 ) AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query II rowsort
SELECT ALL - col2 AS col0, - col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + col1 FROM tab0 WHERE ( NOT - col1 IS NULL ) GROUP BY col1, col1
----
0
81

query II rowsort
SELECT DISTINCT + + col1 AS col1, - col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 cor0 WHERE NOT col1 IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col2 AS col2 FROM tab2 WHERE NOT NULL NOT IN ( col0 ) GROUP BY col2
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2 HAVING - AVG ( col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - - col1 - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL col1 - - col1 * - col0 AS col0 FROM tab0 cor0 GROUP BY col1, col0 HAVING NOT NULL < - - col1
----

query II rowsort
SELECT DISTINCT col0, - col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
22
-6
28
-57
82
-44

query I rowsort
SELECT col2 + - col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IN ( col1 )
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab1 WHERE NOT ( col2 ) IS NULL GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + + + col0 col2 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col2 * col2 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 WHERE ( + col0 ) <= NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query II rowsort label-1695
SELECT col1 * - + col1 DIV + col1 AS col0, col1 FROM tab2 GROUP BY col1
----
-41
41
-59
59
-61
61

skipif mysql # not compatible
query II rowsort label-1695
SELECT col1 * - + col1 / + col1 AS col0, col1 FROM tab2 GROUP BY col1
----
-41
41
-59
59
-61
61

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NULL = + col0 GROUP BY col2, col0
----

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT - col2 IS NULL
----
-81
0

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query II rowsort
SELECT - + col0 AS col0, col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
484
-28
784
-82
6724

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col0 AS col2 FROM tab2 WHERE NOT - + col1 IS NULL GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT + - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 WHERE NOT - col0 * col1 IS NOT NULL GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col1, col0 HAVING NOT col1 >= ( col1 )
----

query I rowsort
SELECT + col1 * - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT col0 * + + col2 FROM tab0 GROUP BY col0, col2, col1
----
1032
2054
3154

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT NULL IN ( - col2, col0 + - col2 ) GROUP BY col2
----

query I rowsort
SELECT + + col1 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL col2 FROM tab0 cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col0 AS col1 FROM tab1 WHERE ( col2 IS NULL ) GROUP BY col0
----

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + - col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1, col2, col0 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT col2 + - col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND col2
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col0, col2 HAVING col0 IS NULL
----

query I rowsort
SELECT - col0 * + col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT ( NOT ( NOT + col2 IS NOT NULL ) ) GROUP BY col1, col0
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT + col0 FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col1 + + - col1 + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * col2 FROM tab0 cor0 GROUP BY col2, col2, col1
----
0
0
1944

query I rowsort
SELECT + col1 FROM tab1 cor0 WHERE NOT NULL < ( NULL ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

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 HAVING NULL >= + - col0
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 WHERE NOT NULL > NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 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

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 GROUP BY col1, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

query II rowsort
SELECT + col2 AS col2, col2 FROM tab2 cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col1 + + + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + + col0 * - col0 col1 FROM tab1 GROUP BY col0, col1 HAVING NOT - + col0 IS NULL
----
-490
-6768
-841

query I rowsort
SELECT DISTINCT + col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query II rowsort
SELECT ALL + col0, + col0 AS col0 FROM tab1 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - AVG ( ALL col1 ) + col1 / + - col1 FROM tab1 WHERE NULL > col0 + - - col1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * + col2 AS col0 FROM tab2 GROUP BY col0, col1, col2 HAVING NULL IS NULL
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT + col1 * col0 FROM tab2 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col1, col2, col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col2, col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT col0 IS NULL
----
22
28
82

query I rowsort
SELECT + - col2 AS col2 FROM tab0 cor0 GROUP BY col1, col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1770
SELECT + col1 DIV col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-40
-58
-60

skipif mysql # not compatible
query I rowsort label-1770
SELECT + col1 / col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-40
-58
-60

query I rowsort
SELECT + col0 * col0 FROM tab1 cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col0 HAVING NOT + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - col0 AS col0 FROM tab2 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 HAVING NOT ( + col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + col0 ) IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + col2 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1, col1
----

query I rowsort
SELECT - col2 FROM tab1 WHERE col0 = ( - col2 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col0 AS col2 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT - col0 * + + col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING ( NULL ) IS NULL
----
-1305
-5336
-7189

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE - col0 <> NULL GROUP BY col1, col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab1 WHERE NULL IS NOT NULL OR NOT NULL IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL < NULL
----

query II rowsort
SELECT DISTINCT col1, col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
81
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 + + col0 + + col0 col1 FROM tab2 GROUP BY col0
----
273
276
45

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 GROUP BY col2, col2, col1 HAVING NOT NULL NOT BETWEEN + - col2 AND NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + AVG ( - col2 ) FROM tab2 WHERE NOT NULL >= col1 GROUP BY col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col1, col1 HAVING NULL BETWEEN - col0 AND NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 + - + col1 FROM tab2 GROUP BY col2, col1
----
-138
-148
-99

query I rowsort
SELECT ALL col0 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + - col2 GROUP BY col0
----

query I rowsort
SELECT + col0 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col2 + - col2 - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col0, col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 WHERE NULL <> NULL GROUP BY col2
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col0, col2, col1 HAVING NOT - - col0 IS NULL
----
0
0
81

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 WHERE NULL NOT IN ( - col0, col2 + + + col2 ) GROUP BY col2, col2
----

query I rowsort
SELECT ALL + + col0 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
164
44
56

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 col1 FROM tab1 GROUP BY col2 HAVING ( ( NULL ) IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE NOT + col0 > + + col0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col0 AS col2 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT ALL + col1, col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * col0 * - col0 * + col0 FROM tab2 cor0 GROUP BY col0, col0
----
-50625
-68574961
-71639296

query I rowsort
SELECT DISTINCT - col0 + + col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0, col1, col2, col0
----
22
28
82

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT + + AVG ( + col2 ) IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col2 * - col2 * col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT - AVG ( + col2 ) <> NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1834
SELECT - col2 DIV - col2 FROM tab1 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1834
SELECT - col2 / - col2 FROM tab1 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * + col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col1 FROM tab0 WHERE NOT NULL > NULL GROUP BY col1, col1, col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + 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 col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col0 * - + col1 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2 HAVING + col2 >= NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT col0 FROM tab1 cor0 WHERE col1 - col1 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 AS col2 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col1 HAVING NULL BETWEEN NULL AND - + col0
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col1, col1
----
-44
-57
-6

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 ALL - - col0 AS col1 FROM tab2 cor0 WHERE col1 IS NOT NULL GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col1 - + col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 * + + AVG ( DISTINCT - col2 ) AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL < + col0 + - col1
----

query I rowsort
SELECT - + col2 FROM tab2 WHERE NOT NULL <= NULL GROUP BY col2, col1
----

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 NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 WHERE NOT - col0 IS NOT NULL GROUP BY col0, col0, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab1 GROUP BY col2, col2
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) = - - col1 GROUP BY col2, col0, col0
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - col2 - + - col2 AS col0 FROM tab2 WHERE - col1 > NULL GROUP BY col2
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab2 WHERE NOT col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col2 * + + col2 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab0 WHERE NOT col2 <> col0 GROUP BY col1, col2
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NULL IN ( col0 )
----

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
-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 DISTINCT col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL > NULL GROUP BY col1, col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col2, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 * + col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT ALL - col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL - + col2 FROM tab0 WHERE col0 IS NOT NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL = ( NULL )
----

query I rowsort
SELECT ALL + col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) <> ( NULL )
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col1 + col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col1, col2 HAVING + col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NOT - col0 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = NULL
----

query II rowsort
SELECT + + col1, col1 AS col0 FROM tab2 WHERE col0 >= NULL GROUP BY col1, col1
----

query I rowsort
SELECT - + col0 FROM tab2 WHERE col1 IS NOT NULL GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT - col0 AS col2 FROM tab0 WHERE col1 NOT BETWEEN ( NULL ) AND NULL GROUP BY col0
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col2, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING + + col1 IS NOT NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-1905
SELECT DISTINCT - + col1 DIV - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1

skipif mysql # not compatible
query I rowsort label-1905
SELECT DISTINCT - + col1 / - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
1

query I rowsort
SELECT ALL + AVG ( + + col1 ) FROM tab2 GROUP BY col1, col1 HAVING NOT - AVG ( DISTINCT + col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 - - col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT ALL col2 / - col2 AS col1 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 + - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 * + - col2 AS col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + col0 FROM tab0 WHERE col2 IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col0, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col1, col2
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-1918
SELECT + col1 DIV col1 FROM tab2 cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-1918
SELECT + col1 / col1 FROM tab2 cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

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 col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
26
43
83

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= + col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1 HAVING NOT col1 <= ( NULL )
----

query II rowsort
SELECT - col0, + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING AVG ( ALL + col1 ) < NULL
----

query I rowsort
SELECT - + AVG ( ALL + col0 ) AS col2 FROM tab1 cor0 GROUP BY col0, col0 HAVING NOT col0 * - + col0 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - AVG ( ALL - - col2 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 WHERE NULL IS NULL GROUP BY col0, col1 HAVING col1 BETWEEN + col1 AND - AVG ( DISTINCT col2 ) - + col1
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col0, col2
----
24
38
79

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 col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 cor0 WHERE NOT ( NULL ) > NULL GROUP BY col1
----

query I rowsort
SELECT ALL AVG ( DISTINCT - col0 ) FROM tab0 AS cor0 WHERE NOT NULL >= ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT - col0 = NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-81
0

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 + col1 < NULL
----

query I rowsort
SELECT ALL - col0 * col0 AS col1 FROM tab2 WHERE NOT NULL = NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT + col1 * + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( col1 ) IN ( - col1 )
----
3772
5369
915

query I rowsort
SELECT ALL col0 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 ALL + col2 * - col2 col1 FROM tab1 AS cor0 WHERE NULL <> col0 GROUP BY col2
----

query II rowsort
SELECT DISTINCT - col0 AS col2, col2 * - col2 FROM tab0 GROUP BY col0, col1, col2
----
-26
-6241
-43
-576
-83
-1444

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0 HAVING ( ( NULL ) = NULL )
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL AVG ( - col0 ) AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col2 * - col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL < - - col1
----

query I rowsort
SELECT - col1 AS col2 FROM tab1 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 col2 col1 FROM tab0 GROUP BY col1, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 - - col1 AS col0 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 + - col2 FROM tab0 GROUP BY col1, col2
----
-158
-48
-76

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NOT ( NULL IS NOT NULL )
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + 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, col1 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col1, col0 HAVING col0 * col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( ( ( - col2 IS NOT NULL ) ) )
----

query I rowsort
SELECT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col2 AS col2 FROM tab0 WHERE NOT + col1 IS NULL GROUP BY col0, col2, col0 HAVING NOT + col2 / col0 NOT IN ( + col2 )
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col2, + col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col1, cor0.col0
----
22
28
82

query I rowsort
SELECT DISTINCT + cor0.col0 * 74 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1924
3182
6142

query I rowsort
SELECT + cor0.col2 * 38 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
1444
3002
912

query I rowsort
SELECT + + 30 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
30
30
30

query I rowsort
SELECT ALL 49 FROM tab1 AS cor0 GROUP BY cor0.col1
----
49
49
49

query I rowsort
SELECT + 6 AS col2 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col2
----
6
6
6

query I rowsort
SELECT ALL 56 * + 41 FROM tab1, tab2 AS cor0 GROUP BY tab1.col1
----
2296
2296
2296

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 65 * + cor0.col2 col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
3770
5135
5655

query I rowsort
SELECT - cor0.col1 + + 43 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-16
-18
2

query I rowsort
SELECT 65 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
65
65
65

query I rowsort
SELECT DISTINCT 84 - 18 AS col0 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col2
----
66

query I rowsort
SELECT 94 FROM tab2 AS cor0 GROUP BY col0
----
94
94
94

query I rowsort
SELECT + - tab2.col1 * - 99 FROM tab2 GROUP BY col1
----
4059
5841
6039

query I rowsort
SELECT - cor0.col2 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0, cor0.col0
----
-24
-38
-79

query I rowsort
SELECT 77 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col0
----
77
77
77

query I rowsort
SELECT cor0.col0 * 6 + cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
154
196
574

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + cor0.col2 col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
58
79
87

query I rowsort
SELECT - 79 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-79
-79
-79

query I rowsort
SELECT cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col1, col2, cor0.col0
----
58
79
87

query I rowsort
SELECT - 96 FROM tab2, tab0 cor0 GROUP BY cor0.col1
----
-96
-96

query I rowsort
SELECT ALL - 86 FROM tab0, tab0 AS cor0 GROUP BY tab0.col1
----
-86
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 49 col1 FROM tab2 cor0 CROSS JOIN tab0 cor1 GROUP BY cor0.col0
----
49

query I rowsort
SELECT + col1 FROM tab0 GROUP BY tab0.col1
----
0
81

query I rowsort
SELECT cor1.col1 FROM tab0, tab2 AS cor0, tab0 AS cor1 GROUP BY cor1.col1
----
0
81

query I rowsort
SELECT - 48 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-48
-48
-48

query I rowsort
SELECT 67 + 43 * cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
3550
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT cor0.col1 col1 FROM tab2 cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT ( + 28 ) AS col2 FROM tab2 cor0 GROUP BY cor0.col1, cor0.col0
----
28

query I rowsort
SELECT DISTINCT + 79 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
79

query I rowsort
SELECT cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0, cor0.col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + 16 col1 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col1
----
16
16
16

query I rowsort
SELECT ALL 1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1
1
1

query I rowsort
SELECT + 53 * - 93 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-4929
-4929
-4929

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2012
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2012
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 62 FROM tab0 AS cor0 GROUP BY cor0.col2
----
62
62
62

query I rowsort
SELECT - cor0.col1 FROM tab0, tab0 cor0 GROUP BY cor0.col1
----
-81
0

query I rowsort
SELECT DISTINCT ( - col2 ) + + ( 96 ) FROM tab1 AS cor0 GROUP BY col2, cor0.col0
----
25
51
88

query I rowsort
SELECT - 55 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-55
-55
-55

query I rowsort
SELECT 84 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
84
84
84

query I rowsort
SELECT cor0.col2 + 1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
59
80
88

onlyif mysql # DIV for integer division: 
query I rowsort label-2019
SELECT ALL cor0.col1 DIV - cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2019
SELECT ALL cor0.col1 / - cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-1
-1
-1

query I rowsort
SELECT + 20 FROM tab0 AS cor0 GROUP BY col2
----
20
20
20

query I rowsort
SELECT ALL - cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT cor0.col0 + - cor0.col0 col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
0

query I rowsort
SELECT ALL cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
44
57
6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2025
SELECT DISTINCT + CAST( - cor0.col0 AS SIGNED ) * - col0 FROM tab0 cor0 GROUP BY cor0.col0
----
1849
676
6889

skipif mysql # not compatible
query I rowsort label-2025
SELECT DISTINCT + CAST ( - cor0.col0 AS INTEGER ) * - col0 FROM tab0 cor0 GROUP BY cor0.col0
----
1849
676
6889

query I rowsort
SELECT + cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, col0
----
45
71
8

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY tab0.col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - 98 col0 FROM tab0, tab2 AS cor0, tab0 AS cor1 GROUP BY tab0.col0
----
-98

query I rowsort
SELECT DISTINCT 25 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
25

query I rowsort
SELECT - 51 * cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-4131
0

query I rowsort
SELECT DISTINCT + 31 FROM tab0 AS cor0 GROUP BY cor0.col1
----
31

query I rowsort
SELECT ALL - cor0.col0 AS col1 FROM tab0, tab1 cor0 GROUP BY cor0.col0
----
-22
-28
-82

query I rowsort
SELECT ( 89 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
89
89
89

query I rowsort
SELECT + 90 FROM tab2 AS cor0 GROUP BY col1
----
90
90
90

query I rowsort
SELECT - ( cor0.col2 ) AS col2 FROM tab0 cor0 GROUP BY cor0.col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT cor0.col0 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
182
184
30

query I rowsort
SELECT DISTINCT + cor0.col2 * ( col2 ) * cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
195112
493039
658503

query I rowsort
SELECT ALL cor0.col2 + + 40 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
119
127
98

query I rowsort
SELECT ALL - cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2041
SELECT ALL - + 44 * + cor1.col1 + - CAST( NULL AS SIGNED ) FROM tab1, tab0 cor0, tab0 AS cor1 GROUP BY cor1.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2041
SELECT ALL - + 44 * + cor1.col1 + - CAST ( NULL AS INTEGER ) FROM tab1, tab0 cor0, tab0 AS cor1 GROUP BY cor1.col1
----
NULL
NULL

query I rowsort
SELECT ALL + cor0.col0 FROM tab1 AS cor0 GROUP BY col0, cor0.col0
----
22
28
82

query I rowsort
SELECT + + 79 FROM tab2 GROUP BY col2
----
79
79
79

query I rowsort
SELECT - ( - cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-2045
SELECT ALL - 26 DIV + cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-4
0
0

skipif mysql # not compatible
query I rowsort label-2045
SELECT ALL - 26 / + cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-4
0
0

query I rowsort
SELECT ALL - 49 * cor0.col0 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col1
----
-1078
-1372
-4018

query I rowsort
SELECT - cor0.col2 * cor0.col1 * col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1, cor0.col2
----
-157464
0
0

query I rowsort
SELECT ALL 19 - + cor0.col0 * + 42 * - ( cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
20347
282427
32947

query I rowsort
SELECT 74 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
74
74
74

query I rowsort
SELECT ALL 39 FROM tab2 AS cor0 GROUP BY cor0.col0
----
39
39
39

query I rowsort
SELECT ALL 63 FROM tab1 AS cor0 GROUP BY cor0.col2
----
63
63
63

query I rowsort
SELECT - ( - 2 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
2
2
2

query I rowsort
SELECT ALL - cor0.col2 * + cor0.col2 + - cor0.col2 AS col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-2070
-5112
-72

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2054
SELECT CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2054
SELECT CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 15 + + 53 AS col1 FROM tab1, tab1 AS cor0, tab1 AS cor1 GROUP BY cor0.col0
----
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + cor0.col2 - col2 col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
0
0
0

query I rowsort
SELECT - cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, col1
----
-45
-71
-8

query I rowsort
SELECT 66 + col1 - - col1 AS col0 FROM tab1 cor0 GROUP BY cor0.col1, col0
----
154
180
78

query I rowsort
SELECT ALL + cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + cor0.col2 + 83 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
128
154
91

query I rowsort
SELECT DISTINCT - cor0.col1 * col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-6561
0

query I rowsort
SELECT DISTINCT ( + cor0.col2 ) * ( 88 ) FROM tab0 cor0 GROUP BY cor0.col2
----
2112
3344
6952

query I rowsort
SELECT + + ( + 56 ) FROM tab0 GROUP BY tab0.col0
----
56
56
56

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
-24
-38
-79

query I rowsort
SELECT - 4 + + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col1
----
2
40
53

query I rowsort
SELECT DISTINCT ( - 66 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-66

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2068
SELECT ALL - CAST( + 62 AS SIGNED ) AS col0 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col1
----
-62
-62
-62

skipif mysql # not compatible
query I rowsort label-2068
SELECT ALL - CAST ( + 62 AS INTEGER ) AS col0 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col1
----
-62
-62
-62

query I rowsort
SELECT DISTINCT 55 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2070
SELECT DISTINCT - - CAST( cor0.col2 AS SIGNED ) AS col0 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
45
71
8

skipif mysql # not compatible
query I rowsort label-2070
SELECT DISTINCT - - CAST ( cor0.col2 AS INTEGER ) AS col0 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
45
71
8

query I rowsort
SELECT DISTINCT cor0.col2 AS col2 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col2, cor0.col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 34 col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-34
-34

query I rowsort
SELECT ALL - 10 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-10
-10
-10

query I rowsort
SELECT ALL col2 + 97 FROM tab1 GROUP BY tab1.col2
----
105
142
168

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 18 col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-18
-18
-18

query I rowsort
SELECT + - 29 FROM tab0 GROUP BY tab0.col0
----
-29
-29
-29

query I rowsort
SELECT - 16 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-16
-16
-16

query I rowsort
SELECT ALL - ( 14 ) + cor0.col0 FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
14
68
8

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS 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 58 * cor0.col0 + 97 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
1373
1721
4853

query I rowsort
SELECT 48 + - cor0.col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-43
-44
33

query I rowsort
SELECT DISTINCT - 97 AS col1 FROM tab2 GROUP BY tab2.col2
----
-97

query I rowsort
SELECT DISTINCT - cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - ( 32 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-32
-32
-32

query I rowsort
SELECT ALL 97 FROM tab2 cor0 GROUP BY cor0.col0
----
97
97
97

query I rowsort
SELECT DISTINCT ( + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT cor0.col2 + - 63 FROM tab1 cor0 GROUP BY cor0.col2
----
-18
-55
8

query I rowsort
SELECT - 66 AS col2 FROM tab0 cor0 GROUP BY cor0.col2
----
-66
-66
-66

query I rowsort
SELECT DISTINCT 33 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
33

query I rowsort
SELECT DISTINCT - 66 + - cor0.col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-66

query I rowsort
SELECT + - cor0.col0 FROM tab0, tab0 cor0 GROUP BY cor0.col0
----
-26
-43
-83

query I rowsort
SELECT + cor0.col0 AS col2 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + 54 AS col0 FROM tab0 GROUP BY col0
----
54

query I rowsort
SELECT ALL - - cor0.col0 AS col0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
22
28
82

query I rowsort
SELECT 56 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col2
----
56
56
56

query I rowsort
SELECT DISTINCT - cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-22
-28
-82

query I rowsort
SELECT + + cor0.col2 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT + 61 + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
140
85
99

query I rowsort
SELECT DISTINCT cor0.col0 * - cor0.col0 + cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-462
-6642
-756

query I rowsort
SELECT + 45 + + cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
128
71
88

query I rowsort
SELECT + 20 + + cor0.col1 * + 24 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col1
----
1076
1388
164

onlyif mysql # DIV for integer division: 
query I rowsort label-2103
SELECT 40 DIV + cor0.col1 col0 FROM tab1 cor0 GROUP BY cor0.col1
----
0
0
6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2103
SELECT 40 / + cor0.col1 col0 FROM tab1 cor0 GROUP BY cor0.col1
----
0
0
6

query I rowsort
SELECT DISTINCT 7 FROM tab0 AS cor0 GROUP BY cor0.col1
----
7

onlyif mysql # DIV for integer division: 
query I rowsort label-2105
SELECT ALL + + cor0.col2 DIV - cor0.col2 FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2105
SELECT ALL + + cor0.col2 / - cor0.col2 FROM tab0, tab2 AS cor0 GROUP BY cor0.col2
----
-1
-1
-1

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2106
SELECT CAST( NULL AS SIGNED ) + cor0.col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2106
SELECT CAST ( NULL AS INTEGER ) + cor0.col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

query I rowsort
SELECT 16 FROM tab1 AS cor0 GROUP BY cor0.col2
----
16
16
16

onlyif mysql # DIV for integer division: 
query I rowsort label-2108
SELECT ALL + 52 DIV + 56 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2108
SELECT ALL + 52 / + 56 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT ALL cor0.col0 * + cor0.col1 + - 30 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-30
-30
3453

query I rowsort
SELECT ALL - 79 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-79
-79

query I rowsort
SELECT DISTINCT + + tab0.col0 AS col1 FROM tab0 GROUP BY tab0.col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2112
SELECT ( col0 ) * - cor0.col1 - CAST( - 38 AS SIGNED ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0, col1
----
-3734
-5331
-877

skipif mysql # not compatible
query I rowsort label-2112
SELECT ( col0 ) * - cor0.col1 - CAST ( - 38 AS INTEGER ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0, col1
----
-3734
-5331
-877

query I rowsort
SELECT DISTINCT ( - 91 ) * - cor0.col0 * cor0.col0 AS col0 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col0
----
44044
611884
71344

query I rowsort
SELECT + cor0.col1 + + 66 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col1
----
147
66

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2115
SELECT - CAST( NULL AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2115
SELECT - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT - 6 * 82 * cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-20172
-29028
-30012

query I rowsort
SELECT ALL - + ( tab1.col0 ) AS col1 FROM tab1 GROUP BY tab1.col0
----
-22
-28
-82

query I rowsort
SELECT 21 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
21
21
21

query I rowsort
SELECT ALL + 93 FROM tab0 cor0 GROUP BY col0, cor0.col1
----
93
93
93

query I rowsort
SELECT + 27 FROM tab2 cor0 GROUP BY cor0.col2
----
27
27
27

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 35 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
35
35

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - 32 * + cor0.col0 col2 FROM tab1, tab0 AS cor0 GROUP BY cor0.col0
----
1376
2656
832

query I rowsort
SELECT DISTINCT - 1 AS col2 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0
----
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-2124
SELECT DISTINCT + 55 + - 39 DIV + cor0.col1 AS col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col1
----
55

skipif mysql # not compatible
query I rowsort label-2124
SELECT DISTINCT + 55 + - 39 / + cor0.col1 AS col1 FROM tab2, tab2 AS cor0 GROUP BY cor0.col1
----
55

query III rowsort
SELECT * FROM tab1 cor0 GROUP BY cor0.col0, cor0.col2, cor0.col1
----
9 values hashing to bbcd4a6dd8965cff3d718a5b7154e488

query I rowsort
SELECT + cor0.col0 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0
----
22
28
82

query I rowsort
SELECT DISTINCT + 32 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
32

query I rowsort
SELECT DISTINCT 39 AS col2 FROM tab2 cor0 GROUP BY cor0.col1
----
39

query I rowsort
SELECT ALL + cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col2 FROM tab1 GROUP BY tab1.col2
----
45
71
8

query I rowsort
SELECT ALL + col1 * + cor0.col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT 19 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
19
19
19

query I rowsort
SELECT ALL 94 AS col1 FROM tab0, tab1 cor0 GROUP BY cor0.col2
----
94
94
94

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 1 * cor0.col1 col0 FROM tab2 cor0 GROUP BY cor0.col1
----
-41
-59
-61

query I rowsort
SELECT + 0 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT DISTINCT - 60 * + cor0.col0 * + ( - cor0.col0 ) FROM tab0 AS cor0 GROUP BY col0, col2
----
110940
40560
413340

query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col0, col1
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 + cor0.col0 * cor0.col0 col2 FROM tab0 cor0 GROUP BY cor0.col2, col0, cor0.col1
----
1825
597
6851

query I rowsort
SELECT cor0.col0 AS col2 FROM tab1 cor0 GROUP BY cor0.col0
----
22
28
82

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY tab0.col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT cor0.col2 + - cor0.col2 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0

query I rowsort
SELECT + cor0.col1 + + cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT ( - cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-24
-38
-79

query I rowsort
SELECT 33 AS col0 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col0, cor1.col2
----
9 values hashing to 620d384286e82d1c6c8b1b2b109a7da5

query I rowsort
SELECT DISTINCT + 71 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
71

query I rowsort
SELECT + ( cor0.col2 ) AS col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2147
SELECT - cor0.col2 + cor0.col1 * - CAST( 40 AS SIGNED ) * + cor0.col1 + + 54 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-129951
-1394
-77457

skipif mysql # not compatible
query I rowsort label-2147
SELECT - cor0.col2 + cor0.col1 * - CAST ( 40 AS INTEGER ) * + cor0.col1 + + 54 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-129951
-1394
-77457

query I rowsort
SELECT ALL 70 FROM tab2 AS cor0 GROUP BY col1, col0
----
70
70
70

query I rowsort
SELECT 69 FROM tab2 AS cor0 GROUP BY cor0.col2
----
69
69
69

query I rowsort
SELECT - 34 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-34
-34
-34

query I rowsort
SELECT DISTINCT - 6 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
-6

query I rowsort
SELECT ALL + cor0.col1 * cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 56 col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
56
56

query I rowsort
SELECT DISTINCT 5 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
5

query I rowsort
SELECT ALL 6 * - cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-156
-258
-498

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - cor0.col1 col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-44
-57
-6

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2157
SELECT ALL + CAST( NULL AS SIGNED ) * - ( cor1.col1 ) AS col0 FROM tab1 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor1.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2157
SELECT ALL + CAST ( NULL AS INTEGER ) * - ( cor1.col1 ) AS col0 FROM tab1 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor1.col1
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - 35 * 17 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-595

query I rowsort
SELECT - ( 33 ) FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-33
-33
-33

query I rowsort
SELECT col0 * - 61 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-5551
-5612
-915

query I rowsort
SELECT 8 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
8
8

query I rowsort
SELECT - cor0.col2 * + cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL cor0.col0 * cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

query I rowsort
SELECT - 79 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-79
-79
-79

query I rowsort
SELECT ALL - 89 FROM tab2 cor0 GROUP BY cor0.col2
----
-89
-89
-89

query I rowsort
SELECT - cor0.col0 FROM tab2, tab0 cor0 GROUP BY cor0.col0
----
-26
-43
-83

query I rowsort
SELECT ALL + 26 AS col2 FROM tab0 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col1, cor1.col1
----
26
26
26
26
26
26

query I rowsort
SELECT + cor0.col2 + - cor0.col2 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
0
0
0

query I rowsort
SELECT - cor0.col1 * + 98 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1
----
-4312
-5586
-588

query I rowsort
SELECT DISTINCT cor0.col0 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col0
----
26
43
83

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2171
SELECT + CAST( NULL AS SIGNED ) col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2171
SELECT + CAST ( NULL AS INTEGER ) col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL 64 FROM tab2 AS cor0 GROUP BY cor0.col0
----
64
64
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 62 col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
62
62
62

query I rowsort
SELECT DISTINCT - ( + cor0.col2 ) * + cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 65 + cor0.col1 col2 FROM tab0 AS cor0 GROUP BY col1, cor0.col1
----
146
65

onlyif mysql # DIV for integer division: 
query I rowsort label-2176
SELECT - 88 DIV - 69 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2176
SELECT - 88 / - 69 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
1
1
1

query I rowsort
SELECT DISTINCT + 82 + - cor0.col1 + cor0.col1 * cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
112
1974
3274

query I rowsort
SELECT DISTINCT - - cor1.col0 AS col2 FROM tab0, tab0 AS cor0, tab0 AS cor1 GROUP BY cor1.col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( cor0.col0 ) col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
45
71
8

query I rowsort
SELECT DISTINCT ( 60 ) * cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1560
2580
4980

query I rowsort
SELECT - 17 * cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1394
-374
-476

query I rowsort
SELECT DISTINCT 28 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
110
50
56

query I rowsort
SELECT ALL - 54 * - 72 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3888
3888
3888

query I rowsort
SELECT - 88 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-88
-88
-88

query I rowsort
SELECT DISTINCT + 98 AS col0 FROM tab2 cor0 GROUP BY cor0.col2
----
98

query I rowsort
SELECT DISTINCT + - 3 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
-3

query I rowsort
SELECT ALL + 38 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
38
38

query I rowsort
SELECT ALL cor0.col2 * cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2, col2, col0
----
2025
5041
64

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2190
SELECT ALL - CAST( NULL AS SIGNED ) + - cor0.col1 * + cor0.col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2190
SELECT ALL - CAST ( NULL AS INTEGER ) + - cor0.col1 * + cor0.col1 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 52 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
52
52
52

query I rowsort
SELECT DISTINCT + 37 * cor0.col0 AS col2 FROM tab0, tab1 AS cor0 GROUP BY cor0.col0
----
1036
3034
814

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - 22 + + cor0.col1 col1 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
-16
22
35

query I rowsort
SELECT ALL - cor0.col1 * - 39 FROM tab2 AS cor0 GROUP BY cor0.col1
----
1599
2301
2379

query I rowsort
SELECT DISTINCT cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
44
57
6

query I rowsort
SELECT ALL cor0.col2 FROM tab2 cor0 GROUP BY col1, cor0.col2
----
58
79
87

query I rowsort
SELECT ALL + cor0.col0 + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
182
184
30

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT 17 FROM tab2 AS cor0 GROUP BY cor0.col2
----
17

query I rowsort
SELECT - 23 * cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-1863
0

query I rowsort
SELECT + cor0.col0 + ( 76 ) AS col2 FROM tab1 cor0 GROUP BY cor0.col0, cor0.col2
----
104
158
98

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + 11 AS col0 FROM tab2 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col1
----
11

query I rowsort
SELECT - 90 AS col1 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col0
----
-90
-90
-90

query I rowsort
SELECT DISTINCT + - 28 + + cor0.col0 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-2
15
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2206
SELECT CAST( NULL AS SIGNED ) * + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2206
SELECT CAST ( NULL AS INTEGER ) * + cor0.col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + + cor0.col1 FROM tab2, tab2 cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT - ( 78 ) * - cor1.col2 FROM tab2, tab2 AS cor0, tab0 AS cor1 GROUP BY cor1.col2
----
1872
2964
6162

query I rowsort
SELECT ALL 24 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
24
24
24

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2210
SELECT CAST( NULL AS SIGNED ) * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2210
SELECT CAST ( NULL AS INTEGER ) * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + 59 - 45 FROM tab2 AS cor0 GROUP BY cor0.col2
----
14
14
14

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 39 col2 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
-39
-39
-39

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 66 col1 FROM tab1 cor0 GROUP BY cor0.col1
----
66

query I rowsort
SELECT ALL 71 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
71
71
71

query I rowsort
SELECT + cor0.col2 * cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2, cor0.col1
----
2025
5041
64

query I rowsort
SELECT DISTINCT 51 + - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-32
25
8

onlyif mysql # DIV for integer division: 
query I rowsort label-2217
SELECT ALL + 74 DIV cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
0
0
4

skipif mysql # not compatible
query I rowsort label-2217
SELECT ALL + 74 / cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
0
0
4

query I rowsort
SELECT 32 FROM tab1 GROUP BY tab1.col1
----
32
32
32

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY tab1.col1
----
-44
-57
-6

query I rowsort
SELECT ALL + ( + cor0.col0 ) * + cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + cor0.col0 AS col2 FROM tab0 cor0 GROUP BY cor0.col0, col2
----
26
43
83

query I rowsort
SELECT ( - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
-58
-79
-87

query I rowsort
SELECT + 90 AS col1 FROM tab2 GROUP BY col2
----
90
90
90

onlyif mysql # DIV for integer division: 
query I rowsort label-2224
SELECT + 99 DIV 43 AS col2 FROM tab2 cor0 GROUP BY cor0.col2
----
2
2
2

skipif mysql # not compatible
query I rowsort label-2224
SELECT + 99 / 43 AS col2 FROM tab2 cor0 GROUP BY cor0.col2
----
2
2
2

query I rowsort
SELECT DISTINCT ( - cor0.col0 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-26
-43
-83

query I rowsort
SELECT ALL - - 76 * - col0 AS col0 FROM tab1 GROUP BY tab1.col0
----
-1672
-2128
-6232

query I rowsort
SELECT DISTINCT - tab2.col2 AS col2 FROM tab2 GROUP BY tab2.col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT cor0.col1 * cor0.col0 * cor0.col0 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col0
----
0
149850

query I rowsort
SELECT + 17 FROM tab0, tab1 AS cor0 GROUP BY tab0.col2
----
17
17
17

query I rowsort
SELECT cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
26
43
83

query I rowsort
SELECT ALL tab0.col0 FROM tab0, tab0 AS cor0 GROUP BY tab0.col0
----
26
43
83

query I rowsort
SELECT - + 48 AS col2 FROM tab0, tab2 AS cor0, tab2 AS cor1 GROUP BY cor1.col0
----
-48
-48
-48

query I rowsort
SELECT DISTINCT 94 * 35 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
3290

query I rowsort
SELECT - 15 FROM tab1 GROUP BY tab1.col1
----
-15
-15
-15

query I rowsort
SELECT ALL + ( ( cor0.col2 ) ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT - 84 AS col1 FROM tab1 GROUP BY tab1.col0
----
-84
-84
-84

query I rowsort
SELECT + - 53 AS col0 FROM tab1, tab1 AS cor0, tab2 AS cor1 GROUP BY cor0.col1
----
-53
-53
-53

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 GROUP BY tab1.col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-2239
SELECT DISTINCT col2 DIV + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
1

skipif mysql # not compatible
query I rowsort label-2239
SELECT DISTINCT col2 / + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
1

query I rowsort
SELECT DISTINCT - 16 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-16

query I rowsort
SELECT ALL + 65 AS col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col0
----
65
65
65

query I rowsort
SELECT - 81 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-81
-81
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + 13 col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
13

query I rowsort
SELECT + 32 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
32
32
32

onlyif mysql # DIV for integer division: 
query I rowsort label-2245
SELECT DISTINCT + cor0.col2 DIV - cor0.col2 FROM tab2 AS cor0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-2245
SELECT DISTINCT + cor0.col2 / - cor0.col2 FROM tab2 AS cor0 GROUP BY col2
----
-1

query I rowsort
SELECT DISTINCT + 49 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
49

query I rowsort
SELECT col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT cor0.col2 * cor0.col2 + + 99 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1543
6340
675

query I rowsort
SELECT ALL - cor0.col1 * + ( cor0.col1 ) * + 49 + cor0.col1 + + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-170451
-182207
-82287

query I rowsort
SELECT ALL - cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, col0
----
-45
-71
-8

query I rowsort
SELECT cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2, cor0.col0
----
22
28
82

query I rowsort
SELECT DISTINCT 0 FROM tab1 GROUP BY tab1.col2
----
0

query I rowsort
SELECT ALL + tab2.col0 AS col1 FROM tab2 GROUP BY tab2.col0
----
15
91
92

query I rowsort
SELECT - 13 FROM tab2 AS cor0 GROUP BY col0
----
-13
-13
-13

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2255
SELECT DISTINCT CAST( NULL AS SIGNED ) * 93 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
query I rowsort label-2255
SELECT DISTINCT CAST ( NULL AS INTEGER ) * 93 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT 27 FROM tab1 AS cor0 GROUP BY cor0.col1
----
27
27
27

query I rowsort
SELECT ALL 57 FROM tab1 AS cor0 GROUP BY cor0.col1
----
57
57
57

query I rowsort
SELECT ( - cor0.col1 ) + - 30 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-36
-74
-87

query I rowsort
SELECT DISTINCT - cor0.col1 FROM tab2 cor0 GROUP BY col2, cor0.col1
----
-41
-59
-61

query I rowsort
SELECT ALL - ( + col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-24
-38
-79

query I rowsort
SELECT 46 FROM tab2 cor0 GROUP BY cor0.col2
----
46
46
46

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2263
SELECT ALL - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2263
SELECT ALL - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT - tab0.col1 AS col1 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - cor0.col1 + - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-162
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2266
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2266
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL + ( - 40 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
-40
-40
-40

query I rowsort
SELECT ALL - 19 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col2
----
-19
-19
-19

query I rowsort
SELECT + tab2.col0 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - + cor0.col1 AS col1 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + cor0.col2 col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + cor0.col0 col1 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-2274
SELECT ALL col2 DIV cor0.col2 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2274
SELECT ALL col2 / cor0.col2 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
1
1
1

query I rowsort
SELECT + cor0.col1 * - cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
-3772
-5369
-915

query I rowsort
SELECT 39 FROM tab2 cor0 GROUP BY cor0.col2
----
39
39
39

query I rowsort
SELECT cor0.col1 + 32 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
73
91
93

query I rowsort
SELECT cor0.col0 * + cor0.col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - 59 AS col2 FROM tab0 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor0.col2
----
-59
-59
-59

query I rowsort
SELECT ALL - 86 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
-86
-86
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 27 col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-27
-27

query I rowsort
SELECT DISTINCT + - ( tab0.col2 ) + - 21 AS col0 FROM tab0 GROUP BY col2
----
-100
-45
-59

query I rowsort
SELECT + - cor0.col0 AS col2 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 96 + + 43 col1 FROM tab1 GROUP BY col2
----
-53
-53
-53

query I rowsort
SELECT ALL ( + cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - 99 + ( + cor0.col0 ) col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-7
-8
-84

query I rowsort
SELECT DISTINCT + + tab1.col2 AS col1 FROM tab1 GROUP BY tab1.col2
----
45
71
8

query I rowsort
SELECT DISTINCT 73 FROM tab0 AS cor0 GROUP BY cor0.col2
----
73

query I rowsort
SELECT ( + cor0.col0 ) + - 66 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-23
-40
17

query I rowsort
SELECT DISTINCT cor0.col1 AS col0 FROM tab2, tab0 AS cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT - - tab2.col1 AS col0 FROM tab2 GROUP BY tab2.col1
----
41
59
61

query I rowsort
SELECT ALL 75 * cor0.col1 + + 44 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
3119
4469
4619

query I rowsort
SELECT DISTINCT cor0.col2 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT ALL cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-2295
SELECT ALL + cor0.col0 DIV - 88 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2295
SELECT ALL + cor0.col0 / - 88 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT - cor0.col2 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT 55 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
55

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2298
SELECT ALL CAST( NULL AS SIGNED ) AS col1 FROM tab2, tab2 AS cor0 GROUP BY tab2.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2298
SELECT ALL CAST ( NULL AS INTEGER ) AS col1 FROM tab2, tab2 AS cor0 GROUP BY tab2.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT + tab2.col0 AS col0 FROM tab2 GROUP BY tab2.col0
----
15
91
92

query I rowsort
SELECT DISTINCT cor0.col2 - cor0.col2 * + cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1406
-552
-6162

query I rowsort
SELECT - cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-81
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2302
SELECT - 47 * - cor0.col1 / + CAST( NULL AS SIGNED ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2302
SELECT - 47 * - cor0.col1 / + CAST ( NULL AS INTEGER ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 + cor0.col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL 63 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
63
63
63

query I rowsort
SELECT ALL - 31 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-31
-31

query I rowsort
SELECT DISTINCT 88 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
88

query I rowsort
SELECT ALL 28 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
28
28
28

query I rowsort
SELECT DISTINCT - 67 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-67

query I rowsort
SELECT - cor0.col2 - 67 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-112
-138
-75

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2310
SELECT + col2 + cor0.col2 + + CAST( NULL AS SIGNED ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2310
SELECT + col2 + cor0.col2 + + CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT - - tab0.col1 FROM tab0 GROUP BY tab0.col1
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-2312
SELECT + 3 DIV + 16 AS col2 FROM tab0 GROUP BY tab0.col2
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2312
SELECT + 3 / + 16 AS col2 FROM tab0 GROUP BY tab0.col2
----
0
0
0

query I rowsort
SELECT DISTINCT - cor0.col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
-44
-57
-6

query I rowsort
SELECT 39 + - 64 AS col0 FROM tab1, tab2 cor0 GROUP BY tab1.col1
----
-25
-25
-25

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2315
SELECT ALL CAST( 4 AS SIGNED ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
4
4
4

skipif mysql # not compatible
query I rowsort label-2315
SELECT ALL CAST ( 4 AS INTEGER ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
4
4
4

query I rowsort
SELECT 6 + 30 FROM tab2 AS cor0 GROUP BY cor0.col1
----
36
36
36

query I rowsort
SELECT DISTINCT ( col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT ( cor0.col2 * + cor0.col1 ) + 42 + + cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
2067
42
42

query I rowsort
SELECT + 92 FROM tab1 AS cor0 GROUP BY cor0.col2
----
92
92
92

query I rowsort
SELECT ALL + - cor0.col0 AS col1 FROM tab2, tab0 cor0 GROUP BY cor0.col0
----
-26
-43
-83

query I rowsort
SELECT + 99 FROM tab0 AS cor0 GROUP BY cor0.col1
----
99
99

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL 21 col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
21
21
21

query I rowsort
SELECT ALL + 43 FROM tab1 cor0 GROUP BY col0
----
43
43
43

query I rowsort
SELECT 5 AS col0 FROM tab0 cor0 GROUP BY col2
----
5
5
5

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY tab2.col1
----
-41
-59
-61

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT DISTINCT cor0.col2 - + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0

query I rowsort
SELECT DISTINCT - cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col0, col0
----
-44
-57
-6

query I rowsort
SELECT 50 * + 77 + tab1.col1 AS col2 FROM tab1 GROUP BY col1
----
3856
3894
3907

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2330
SELECT CAST( 16 AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
16
16
16

skipif mysql # not compatible
query I rowsort label-2330
SELECT CAST ( 16 AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
16
16
16

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2331
SELECT + CAST( NULL AS SIGNED ) col1 FROM tab1 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2331
SELECT + CAST ( NULL AS INTEGER ) col1 FROM tab1 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT 87 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
87
87
87

query I rowsort
SELECT ALL cor0.col2 + + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
158
48
76

query I rowsort
SELECT ALL + 8 + 50 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col1
----
58
58
58

query I rowsort
SELECT 99 + - cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
18
99

query I rowsort
SELECT ALL 91 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
91
91

query I rowsort
SELECT cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0, cor0.col0
----
0
0
81

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
22
28
82

query I rowsort
SELECT ALL - cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
-81
0

query I rowsort
SELECT - cor0.col1 * - 86 FROM tab0 AS cor0 GROUP BY col1, cor0.col2, cor0.col2
----
0
0
6966

query I rowsort
SELECT - 61 AS col2 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2
----
-61
-61
-61

query I rowsort
SELECT cor0.col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1, cor0.col2, cor0.col0
----
45
71
8

query I rowsort
SELECT 41 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
41
41

query I rowsort
SELECT 44 + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
103
105
85

query I rowsort
SELECT + cor0.col1 * 49 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2156
2793
294

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + cor0.col0 col0 FROM tab1 cor0 GROUP BY cor0.col0
----
22
28
82

query I rowsort
SELECT - ( col0 ) FROM tab2 cor0 GROUP BY cor0.col0, cor0.col0
----
-15
-91
-92

query I rowsort
SELECT + 47 FROM tab0 AS cor0 GROUP BY cor0.col2
----
47
47
47

query I rowsort
SELECT DISTINCT + cor0.col0 AS col2 FROM tab0 cor0 GROUP BY cor0.col0, col0
----
26
43
83

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT cor0.col1 + cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL cor0.col0 * cor0.col0 AS col0 FROM tab2 cor0 GROUP BY cor0.col0
----
225
8281
8464

query I rowsort
SELECT ALL + cor0.col1 AS col0 FROM tab0 cor0 GROUP BY cor0.col1
----
0
81

query I rowsort
SELECT - cor0.col1 + 55 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, col0
----
-26
55
55

query I rowsort
SELECT ALL - cor0.col0 - 92 AS col0 FROM tab2, tab2 cor0 GROUP BY cor0.col0
----
-107
-183
-184

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 48 + - 25 col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
23
23
23

query I rowsort
SELECT DISTINCT 13 FROM tab2 AS cor0 GROUP BY cor0.col0
----
13

query I rowsort
SELECT + 14 FROM tab0 cor0 GROUP BY cor0.col0
----
14
14
14

query I rowsort
SELECT 95 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
95
95
95

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2360
SELECT DISTINCT + CAST( NULL AS SIGNED ) * - cor0.col0 col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2360
SELECT DISTINCT + CAST ( NULL AS INTEGER ) * - cor0.col0 col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL

query I rowsort
SELECT ALL 29 + - cor0.col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-12
-30
-32

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 71 col0 FROM tab1, tab2 cor0 GROUP BY cor0.col0
----
71
71
71

query I rowsort
SELECT DISTINCT - 77 FROM tab2 AS cor0 GROUP BY cor0.col2, col2
----
-77

query I rowsort
SELECT ALL + 54 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
54
54
54

onlyif mysql # DIV for integer division: 
query I rowsort label-2365
SELECT cor0.col0 DIV + ( 89 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2365
SELECT cor0.col0 / + ( 89 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
0
0
0

query I rowsort
SELECT ( cor0.col2 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
58
79
87

query I rowsort
SELECT cor0.col2 FROM tab2 AS cor0 GROUP BY col0, cor0.col2
----
58
79
87

query I rowsort
SELECT ALL ( col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + cor0.col1 * cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col1, col0
----
3772
5369
915

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
22
28
82

query I rowsort
SELECT DISTINCT - 17 AS col0 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
----
-17

query I rowsort
SELECT + 35 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
35
35
35

onlyif mysql # DIV for integer division: 
query I rowsort label-2373
SELECT - cor0.col1 DIV + 11 + + 93 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
88
88
90

skipif mysql # not compatible
query I rowsort label-2373
SELECT - cor0.col1 / + 11 + + 93 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
88
88
90

query I rowsort
SELECT cor0.col2 + 33 AS col2 FROM tab2 cor0 GROUP BY cor0.col2
----
112
120
91

query I rowsort
SELECT ALL 57 AS col1 FROM tab2 GROUP BY tab2.col0
----
57
57
57

query I rowsort
SELECT ALL - 95 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-95
-95
-95

query I rowsort
SELECT + 28 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
28
28
28

onlyif mysql # DIV for integer division: 
query I rowsort label-2378
SELECT DISTINCT - cor0.col2 * ( cor0.col2 ) - + cor0.col1 DIV 47 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-1444
-577
-6241

skipif mysql # not compatible
query I rowsort label-2378
SELECT DISTINCT - cor0.col2 * ( cor0.col2 ) - + cor0.col1 / 47 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-1444
-577
-6241

query I rowsort
SELECT cor0.col2 + - cor0.col0 AS col0 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0, cor0.col2
----
-11
-14
17

query I rowsort
SELECT - 87 FROM tab0, tab2 AS cor0 GROUP BY tab0.col0
----
-87
-87
-87

query I rowsort
SELECT ( 31 ) AS col1 FROM tab2 cor0 GROUP BY cor0.col1
----
31
31
31

query I rowsort
SELECT cor0.col0 * - cor0.col0 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
-484
-6724
-784

onlyif mysql # DIV for integer division: 
query I rowsort label-2383
SELECT ALL + + 0 DIV cor0.col1 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
query I rowsort label-2383
SELECT ALL + + 0 / cor0.col1 FROM tab0, tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 - cor0.col0 * + cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-462
-6642
-756

query I rowsort
SELECT - 32 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-32
-32
-32

query I rowsort
SELECT ALL + cor0.col2 + cor0.col2 * - 60 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-3422
-4661
-5133

query I rowsort
SELECT DISTINCT + cor0.col2 * col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
2025
5041
64

query I rowsort
SELECT ALL - cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-44
-57
-6

query I rowsort
SELECT - cor0.col2 FROM tab1 cor0 GROUP BY col2, cor0.col0
----
-45
-71
-8

query I rowsort
SELECT cor0.col0 * - 48 * + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-32448
-330672
-88752

query I rowsort
SELECT DISTINCT cor0.col2 + cor0.col2 * cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1482
600
6320

onlyif mysql # DIV for integer division: 
query I rowsort label-2392
SELECT - tab0.col0 - + 85 DIV + col0 FROM tab0 GROUP BY tab0.col0
----
-29
-44
-84

skipif mysql # not compatible
query I rowsort label-2392
SELECT - tab0.col0 - + 85 / + col0 FROM tab0 GROUP BY tab0.col0
----
-29
-44
-84

query I rowsort
SELECT ALL - tab0.col0 * - ( tab0.col0 ) + 94 FROM tab0 GROUP BY tab0.col0
----
1943
6983
770

query I rowsort
SELECT cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
15
91
92

query I rowsort
SELECT ALL - cor0.col0 * + cor0.col0 + - 11 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-236
-8292
-8475

onlyif mysql # DIV for integer division: 
query I rowsort label-2396
SELECT cor0.col0 DIV cor0.col0 + + cor0.col0 * cor0.col0 * - cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-10647
-21951
-551367

skipif mysql # not compatible
query I rowsort label-2396
SELECT cor0.col0 / cor0.col0 + + cor0.col0 * cor0.col0 * - cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-10647
-21951
-551367

query I rowsort
SELECT cor0.col1 * ( col1 + col1 * + 30 ) FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
100719
1116
60016

query I rowsort
SELECT ALL + cor0.col2 * 35 FROM tab2 AS cor0 GROUP BY cor0.col2
----
2030
2765
3045

query I rowsort
SELECT - cor0.col0 * + 91 + cor0.col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1980
-2520
-7380

query I rowsort
SELECT DISTINCT + 82 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
82

query I rowsort
SELECT DISTINCT - 22 * cor0.col2 AS col2 FROM tab0 cor0 GROUP BY cor0.col2
----
-1738
-528
-836

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2403
SELECT + CAST( NULL AS DECIMAL ) * ( + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2403
SELECT + CAST ( NULL AS REAL ) * ( + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col0
----
NULL
NULL
NULL

query I rowsort
SELECT cor0.col1 + - 49 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-49
32

query I rowsort
SELECT - 57 FROM tab2 AS cor0 GROUP BY col1
----
-57
-57
-57

query I rowsort
SELECT DISTINCT + 75 FROM tab0 AS cor0 GROUP BY col0
----
75

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2407
SELECT - CAST( NULL AS DECIMAL ) * - 13 AS col2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2407
SELECT - CAST ( NULL AS REAL ) * - 13 AS col2 FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT DISTINCT - cor0.col1 * 26 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-2106
0

query I rowsort
SELECT - 68 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-68
-68
-68

query I rowsort
SELECT ALL col1 * cor0.col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
6561

query I rowsort
SELECT + 87 AS col2 FROM tab1 cor0 GROUP BY cor0.col1
----
87
87
87

query I rowsort
SELECT - ( tab2.col0 ) FROM tab2, tab2 cor0 GROUP BY tab2.col0
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-2413
SELECT 67 DIV 59 AS col2 FROM tab1, tab1 AS cor0, tab1 AS cor1 GROUP BY tab1.col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2413
SELECT 67 / 59 AS col2 FROM tab1, tab1 AS cor0, tab1 AS cor1 GROUP BY tab1.col1
----
1
1
1

query I rowsort
SELECT DISTINCT - cor0.col2 * - col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1444
576
6241

query I rowsort
SELECT ALL 9 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
9
9
9

query I rowsort
SELECT 3 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
3
3
3

query I rowsort
SELECT ( - cor0.col1 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-41
-59
-61

query I rowsort
SELECT - 59 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-59
-59
-59

query I rowsort
SELECT DISTINCT - cor1.col1 FROM tab2, tab1 AS cor0, tab2 AS cor1 GROUP BY cor1.col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + 56 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 81 col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
81
81
81

query I rowsort
SELECT DISTINCT cor0.col0 * - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1849
-676
-6889

query I rowsort
SELECT - - 89 FROM tab1 GROUP BY tab1.col2
----
89
89
89

query I rowsort
SELECT + cor0.col2 AS col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT + tab0.col2 AS col1 FROM tab0 GROUP BY tab0.col2
----
24
38
79

query I rowsort
SELECT - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col0
----
-26
-43
-83

query I rowsort
SELECT 42 + cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
48
86
99

query I rowsort
SELECT ALL - cor0.col1 * col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
-1681
-3481
-3721

query I rowsort
SELECT cor0.col1 * cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
1944

query I rowsort
SELECT DISTINCT - ( tab1.col0 ) FROM tab1 GROUP BY tab1.col0
----
-22
-28
-82

query I rowsort
SELECT ALL cor0.col2 AS col2 FROM tab1 cor0 GROUP BY cor0.col0, cor0.col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-2432
SELECT - - tab0.col0 DIV col0 + - 12 AS col1 FROM tab0 GROUP BY tab0.col0
----
-11
-11
-11

skipif mysql # not compatible
query I rowsort label-2432
SELECT - - tab0.col0 / col0 + - 12 AS col1 FROM tab0 GROUP BY tab0.col0
----
-11
-11
-11

query I rowsort
SELECT DISTINCT 50 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
50

query I rowsort
SELECT DISTINCT + cor0.col1 * + cor0.col1 * 95 FROM tab1 AS cor0 GROUP BY cor0.col1
----
183920
308655
3420

query I rowsort
SELECT cor0.col1 * 37 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
1628
2109
222

query I rowsort
SELECT ALL + col2 FROM tab0 cor0 GROUP BY cor0.col2
----
24
38
79

query I rowsort
SELECT + ( - cor0.col1 ) + cor0.col1 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col1
----
0
0
0

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY tab2.col1
----
41
59
61

query I rowsort
SELECT 25 FROM tab1 GROUP BY col0
----
25
25
25

query I rowsort
SELECT cor0.col2 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
45
71
8

query I rowsort
SELECT DISTINCT - cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - cor0.col2 * cor0.col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT - 87 - - cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
-4
-44
-61

query I rowsort
SELECT ALL cor0.col0 * + 7 FROM tab1 AS cor0 GROUP BY cor0.col0
----
154
196
574

query I rowsort
SELECT - + 2 FROM tab2, tab0 cor0 GROUP BY cor0.col2
----
-2
-2
-2

query I rowsort
SELECT ALL cor0.col0 * 81 * cor0.col0 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
39204
544644
63504

query I rowsort
SELECT + cor0.col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + cor0.col1 + - cor0.col1 * cor0.col1 FROM tab0 cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT - 27 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-27
-27
-27

query I rowsort
SELECT ALL 32 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
32
32
32

query I rowsort
SELECT + cor0.col2 FROM tab0 cor0 GROUP BY col0, cor0.col2
----
24
38
79

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-2452
SELECT ALL CAST( NULL AS DECIMAL ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2452
SELECT ALL CAST ( NULL AS REAL ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
SELECT ALL - cor0.col1 * - 40 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
3240

query I rowsort
SELECT ( cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT ALL - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col2
----
-58
-79
-87

query I rowsort
SELECT - 70 AS col0 FROM tab1 AS cor0 GROUP BY col1, cor0.col1
----
-70
-70
-70

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2457
SELECT + cor0.col2 * cor0.col2 * CAST( NULL AS SIGNED ) FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2457
SELECT + cor0.col2 * cor0.col2 * CAST ( NULL AS INTEGER ) FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT ALL - 81 FROM tab0, tab2 AS cor0 GROUP BY cor0.col0
----
-81
-81
-81

query I rowsort
SELECT + 31 FROM tab0 GROUP BY tab0.col2
----
31
31
31

query I rowsort
SELECT ALL + 78 - ( + cor0.col2 ) FROM tab2 AS cor0 GROUP BY col2
----
-1
-9
20

query I rowsort
SELECT + cor0.col2 + - col0 - cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0, col2, cor0.col1
----
-100
-45
53

query I rowsort
SELECT ALL cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2, col1, cor0.col0
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 * 57 FROM tab2 AS cor0 GROUP BY cor0.col2
----
3306
4503
4959

query I rowsort
SELECT 47 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col2
----
47
47
47

query I rowsort
SELECT ALL + cor0.col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, cor0.col1
----
58
79
87

query I rowsort
SELECT - 81 AS col1 FROM tab1 cor0 GROUP BY cor0.col1
----
-81
-81
-81

query I rowsort
SELECT ALL 76 FROM tab1 AS cor0 GROUP BY cor0.col1
----
76
76
76

query I rowsort
SELECT ALL + cor0.col1 + - cor0.col1 * cor0.col1 FROM tab2, tab0 cor0 GROUP BY cor0.col1
----
-6480
0

query I rowsort
SELECT DISTINCT - 75 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2, cor0.col1
----
-75

query I rowsort
SELECT 28 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
28
28
28

query I rowsort
SELECT - cor0.col1 AS col1 FROM tab2 cor0 GROUP BY cor0.col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT 63 + cor0.col2 FROM tab2 AS cor0 GROUP BY col2
----
121
142
150

query I rowsort
SELECT ALL ( cor0.col2 ) * col2 AS col0 FROM tab1 cor0 GROUP BY cor0.col2
----
2025
5041
64

query I rowsort
SELECT - + tab0.col2 * + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT 13 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
13

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 42 col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
42
42
42

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2477
SELECT DISTINCT - CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL

skipif mysql # not compatible
query I rowsort label-2477
SELECT DISTINCT - CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
NULL

query I rowsort
SELECT 13 AS col0 FROM tab0 GROUP BY col2
----
13
13
13

query I rowsort
SELECT DISTINCT 49 - cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, cor0.col2
----
-22
4
41

query I rowsort
SELECT + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, col2
----
41
59
61

query I rowsort
SELECT ALL - ( cor0.col0 ) * - 57 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
1254
1596
4674

query I rowsort
SELECT - 40 - + 2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-42
-42
-42

query I rowsort
SELECT ALL + ( 99 ) FROM tab1, tab2 AS cor0 GROUP BY tab1.col1
----
99
99
99

query I rowsort
SELECT - 85 FROM tab0, tab0 AS cor0 GROUP BY cor0.col0
----
-85
-85
-85

query I rowsort
SELECT DISTINCT cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, cor0.col0
----
45
71
8

query I rowsort
SELECT ALL cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col2, col2
----
22
28
82

query I rowsort
SELECT DISTINCT + 67 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
67

query I rowsort
SELECT ALL - tab2.col2 AS col2 FROM tab2 GROUP BY tab2.col2
----
-58
-79
-87

query I rowsort
SELECT 68 FROM tab0 AS cor0 GROUP BY cor0.col2
----
68
68
68

query I rowsort
SELECT 87 FROM tab2 cor0 GROUP BY cor0.col0
----
87
87
87

query I rowsort
SELECT cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
58
79
87

query I rowsort
SELECT DISTINCT ( + col1 ) * 47 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2068
2679
282

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2493
SELECT DISTINCT - cor0.col2 * CAST( col2 AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1444
-576
-6241

skipif mysql # not compatible
query I rowsort label-2493
SELECT DISTINCT - cor0.col2 * CAST ( col2 AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-1444
-576
-6241

query I rowsort
SELECT + col1 * col0 + cor0.col2 FROM tab0 AS cor0 GROUP BY col1, cor0.col0, cor0.col2
----
3507
38
79

query I rowsort
SELECT - col0 AS col1 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + cor0.col1 * + 94 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
7614

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 15 col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-15
-15
-15

query I rowsort
SELECT DISTINCT - 69 FROM tab1, tab2 AS cor0 GROUP BY cor0.col1
----
-69

query I rowsort
SELECT + 0 FROM tab0, tab2 AS cor0 GROUP BY tab0.col0
----
0
0
0

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2500
SELECT + CAST( NULL AS SIGNED ) FROM tab1 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

skipif mysql # not compatible
query I rowsort label-2500
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

query I rowsort
SELECT DISTINCT cor0.col1 + 71 FROM tab0 AS cor0 GROUP BY cor0.col1
----
152
71

query I rowsort
SELECT ALL 2 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
2
2

query I rowsort
SELECT ALL + cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1, cor0.col2
----
45
71
8

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2504
SELECT DISTINCT + CAST( 88 AS SIGNED ) FROM tab2 AS cor0 GROUP BY col2
----
88

skipif mysql # not compatible
query I rowsort label-2504
SELECT DISTINCT + CAST ( 88 AS INTEGER ) FROM tab2 AS cor0 GROUP BY col2
----
88

query I rowsort
SELECT + col2 * col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
0
0
1944

query I rowsort
SELECT ALL 88 AS col0 FROM tab0 AS cor0 GROUP BY col2, cor0.col1
----
88
88
88

query I rowsort
SELECT DISTINCT - 31 FROM tab0 AS cor0 GROUP BY col0, cor0.col2
----
-31

query I rowsort
SELECT DISTINCT + 5 + cor0.col1 AS col1 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col1
----
5
86

query I rowsort
SELECT + 98 + cor0.col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
104
142
155

query I rowsort
SELECT - 73 FROM tab1, tab0 AS cor0, tab0 cor1 GROUP BY cor0.col1
----
-73
-73

query I rowsort
SELECT DISTINCT cor0.col0 * + cor0.col0 * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1
----
13725
347024
488579

query I rowsort
SELECT cor0.col1 * cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
1681
3481
3721

onlyif mysql # DIV for integer division: 
query I rowsort label-2513
SELECT + cor0.col0 DIV col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2513
SELECT + cor0.col0 / col0 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
1
1
1

query I rowsort
SELECT ALL 88 + col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
110
116
170

query I rowsort
SELECT ALL ( 85 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
85
85
85

query I rowsort
SELECT + 62 + 36 FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col1
----
98
98

query I rowsort
SELECT cor0.col2 * + 31 FROM tab2 AS cor0 GROUP BY cor0.col2
----
1798
2449
2697

query I rowsort
SELECT cor0.col0 + + 58 * cor0.col0 AS col0 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col0
----
1298
1652
4838

query I rowsort
SELECT ALL + 96 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
96
96
96

query I rowsort
SELECT cor0.col1 * - 98 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-7857
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT 37 col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
37
37

query I rowsort
SELECT 97 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
97
97

query I rowsort
SELECT col1 + - tab0.col1 FROM tab0 GROUP BY tab0.col1
----
0
0

query I rowsort
SELECT DISTINCT + 43 FROM tab2 GROUP BY tab2.col1
----
43

query I rowsort
SELECT + 43 FROM tab1, tab0 AS cor0 GROUP BY cor0.col1
----
43
43

query I rowsort
SELECT - cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL 10 FROM tab0 AS cor0 GROUP BY cor0.col2
----
10
10
10

onlyif mysql # DIV for integer division: 
query I rowsort label-2528
SELECT ALL - cor0.col1 DIV cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2528
SELECT ALL - cor0.col1 / cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col1
----
-1
-1
-1

query I rowsort
SELECT - + 95 AS col1 FROM tab1 GROUP BY tab1.col1
----
-95
-95
-95

onlyif mysql # DIV for integer division: 
query I rowsort label-2530
SELECT DISTINCT 19 DIV cor0.col1 col1 FROM tab1 cor0 GROUP BY cor0.col1
----
0
3

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2530
SELECT DISTINCT 19 / cor0.col1 col1 FROM tab1 cor0 GROUP BY cor0.col1
----
0
3

query I rowsort
SELECT ALL cor0.col0 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
22
28
82

query I rowsort
SELECT cor0.col1 * cor0.col1 + - cor0.col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

query I rowsort
SELECT ALL - - 31 AS col0 FROM tab0 GROUP BY tab0.col0
----
31
31
31

query I rowsort
SELECT tab2.col0 AS col1 FROM tab2 GROUP BY tab2.col0
----
15
91
92

query I rowsort
SELECT DISTINCT 69 FROM tab2 GROUP BY tab2.col2
----
69

query I rowsort
SELECT - ( 21 ) FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col2
----
-21
-21
-21

query I rowsort
SELECT ALL + 50 FROM tab0 GROUP BY tab0.col2
----
50
50
50

query I rowsort
SELECT ALL + 69 - + 14 * + cor0.col0 FROM tab2 AS cor0 GROUP BY col0
----
-1205
-1219
-141

query I rowsort
SELECT ALL + 41 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
41
41
41

query I rowsort
SELECT ALL - 4 * 22 FROM tab0 AS cor0 GROUP BY col0
----
-88
-88
-88

query I rowsort
SELECT + 87 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col2
----
87
87
87

onlyif mysql # DIV for integer division: 
query I rowsort label-2542
SELECT + ( cor0.col0 ) * cor0.col2 DIV + cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col2, col0
----
58
79
87

skipif mysql # not compatible
query I rowsort label-2542
SELECT + ( cor0.col0 ) * cor0.col2 / + cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT + tab1.col1 AS col2 FROM tab1 GROUP BY tab1.col1 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT tab2.col1 FROM tab2 GROUP BY tab2.col1
----
41
59
61

query I rowsort
SELECT DISTINCT cor0.col1 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT DISTINCT 68 AS col2 FROM tab0 cor0 GROUP BY col1
----
68

query I rowsort
SELECT - cor0.col2 FROM tab0, tab1 AS cor0 GROUP BY cor0.col2
----
-45
-71
-8

query I rowsort
SELECT ALL + - cor0.col0 FROM tab2, tab2 cor0 GROUP BY cor0.col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - ( - cor0.col0 ) AS col2 FROM tab1, tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
41
59
61

query I rowsort
SELECT ALL 34 FROM tab2 AS cor0 GROUP BY cor0.col0
----
34
34
34

query I rowsort
SELECT ALL - cor0.col1 FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT cor0.col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT - - col2 * + col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query II rowsort
SELECT col1 AS col0, col1 * - col1 AS col1 FROM tab0 GROUP BY col1
----
0
0
81
-6561

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 * + col2 FROM tab1 WHERE NOT ( + col2 ) IS NULL GROUP BY col2, col0
----
1260
176
5822

query II rowsort
SELECT - col2 * col2, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-3364
58
-6241
79
-7569
87

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col0 HAVING - col0 >= NULL
----

query I rowsort
SELECT + col0 FROM tab2 WHERE NULL >= - col2 GROUP BY col0, col0
----

query I rowsort
SELECT ALL - col0 FROM tab2 cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND - col1
----

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col2 * + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab0 AS cor0 WHERE NOT + col0 BETWEEN + col1 AND NULL GROUP BY col2
----
24

query I rowsort
SELECT col2 + + col2 AS col1 FROM tab1 GROUP BY col2 HAVING ( NOT ( NULL ) IS NOT NULL )
----
142
16
90

query I rowsort
SELECT ALL - + col1 FROM tab0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col1, col0
----

query I rowsort
SELECT col0 + + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 + + col1 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT DISTINCT + col2 * + col1 FROM tab2 GROUP BY col1, col1, col2
----
2378
4661
5307

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT ALL col2 * + col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - + col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
-81
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NULL NOT BETWEEN NULL AND - col2
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
0
0
81

query I rowsort
SELECT - col0 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 col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col2, col0, col0
----
-26
-43
-83

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col2 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - col1 * + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL + - col0 + col0 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col2 * - col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL - col0, - col2 * - col0 FROM tab0 GROUP BY col0, col2, col2 HAVING ( col2 IS NULL )
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 GROUP BY col2 HAVING - col2 + - col2 IS NULL
----

query I rowsort
SELECT ALL col0 + - col0 AS col1 FROM tab2 AS cor0 WHERE NOT + col0 IS NULL AND NULL IS NOT NULL GROUP BY col0
----

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 col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + + col1 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT ( NOT ( AVG ( + col0 ) ) BETWEEN ( NULL ) AND NULL )
----

query I rowsort
SELECT + col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT + + AVG ( + col1 ) IS NULL
----
45
71
8

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING ( NOT NULL IS NOT NULL )
----
58
79
87

query I rowsort
SELECT ALL + + col2 * col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT + col1 * + - col0 AS col0 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE ( ( NULL IS NULL ) ) GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT col0 * - col1 FROM tab0 GROUP BY col0, col2, col1 HAVING col2 IS NOT NULL
----
-3483
0
0

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT - + col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0, col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
15
87
91
79
92
58

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 WHERE NOT col0 > NULL GROUP BY col0
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( NOT ( NULL ) <> NULL )
----

query II rowsort
SELECT + col1 + - - col1 + + col1 - - + col1 AS col0, col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col2, - col2 AS col1 FROM tab0 GROUP BY col0, col1, col2
----
24
-24
38
-38
79
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + - col2 AS col0 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 FROM tab0 cor0 WHERE NOT col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT - + col1 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 - + - col1 * + - col0 AS col2 FROM tab0 GROUP BY col0, col1, col0
----
-3440
26
83

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query II rowsort
SELECT DISTINCT col1, col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col2, col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 AS cor0 WHERE NULL >= ( NULL ) GROUP BY col1 HAVING - AVG ( DISTINCT col1 ) IS NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL AND NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

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 DISTINCT col2 / col2 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col0 HAVING ( NULL ) IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL - col0 - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT ALL AVG ( DISTINCT + + col1 ) AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL < - col1 + + AVG ( + col0 )
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) > ( NULL ) GROUP BY col1
----

query I rowsort
SELECT col2 * + col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT - col0 - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-124
-26
-83

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE NOT ( - col2 ) IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL col0 * col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
484
6724
784

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col0, col0, col1 HAVING - col1 IS NOT NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-2665
SELECT - col1 DIV + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-2665
SELECT - col1 / + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 FROM tab0 cor0 WHERE NOT col2 + col0 IS NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT - col2 FROM tab0 WHERE NULL IS NULL GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + col2 * col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 WHERE NOT - col1 * - col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - AVG ( ALL + col1 ) FROM tab2 AS cor0 WHERE - col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 WHERE NULL NOT IN ( col2, - col2 ) GROUP BY col0
----

query I rowsort
SELECT col0 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col2 FROM tab2 WHERE NULL = - - col0 GROUP BY col2
----

query I rowsort
SELECT ALL + col1 + + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + col0 AS col2 FROM tab1 WHERE NOT NULL > NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 * - + col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col2 FROM tab2 WHERE NULL NOT IN ( - - col1 ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NULL < NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col0, col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - - col2 * - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT col2 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 ALL + - col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT ALL - col2 * col2 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0 HAVING ( NOT NULL IS NOT NULL )
----
15
91
92

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-45
-71
-8

query I rowsort
SELECT col1 * + col1 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col1 * col1 AS col0 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col0 HAVING NOT ( NULL ) <= + col0 - + - AVG ( - col2 )
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - - col1 ) FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT + col1 + - col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT IN ( col1 ) GROUP BY col2
----

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0 HAVING - col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 AS col1, col2 col0 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL col0 FROM tab2 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
15
91
92

query II rowsort
SELECT ALL + col2, + col2 FROM tab0 AS cor0 WHERE - col1 <> col0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
24
38
38
79
79

query I rowsort
SELECT DISTINCT - col1 + col1 FROM tab2 WHERE ( NULL ) IS NULL GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT - col2 * - col2 AS col0 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col0 AS col2 FROM tab0 cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 col0, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT col1 FROM tab1 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NOT ( ( NULL ) IS NOT NULL )
----
41
59
61

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 + - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL col2 + + - col2 FROM tab0 GROUP BY col2 HAVING NOT - AVG ( - col2 ) < - col2
----
0
0
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE NULL = NULL GROUP BY col0
----

query I rowsort
SELECT ALL col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1, col2
----
24
38
79

query II rowsort
SELECT col0, + col0 * + col1 AS col0 FROM tab1 GROUP BY col1, col0, col0
----
22
132
28
1596
82
3608

query I rowsort
SELECT - col0 * col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab2 WHERE NOT - col2 IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 WHERE NOT ( NOT ( NULL ) IS NOT NULL ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) <= NULL
----

query I rowsort
SELECT ALL col0 + - col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - AVG ( - col1 ) FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT col1 * - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING + + col1 IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT - col1 + col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col2 * col0 AS col0 FROM tab1 WHERE NULL <> NULL GROUP BY col0, col2, col2
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 WHERE NOT col0 = NULL GROUP BY col1
----

query I rowsort
SELECT ALL col1 * col2 AS col1 FROM tab1 GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----
2565
3124
48

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 WHERE NOT NULL > NULL GROUP BY col1, col1, col2
----

query I rowsort
SELECT col0 + col0 * + col0 AS col1 FROM tab2 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING AVG ( ALL + - col2 ) IS NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1 HAVING NOT + AVG ( - + col2 ) < NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING col1 IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-116
-158
-174

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col1
----
22
28
82

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 NULL
----
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT ( NOT ( NULL ) IS NULL )
----
26
43
83

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( + col1 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL >= - AVG ( - + col1 )
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1 HAVING ( NULL IS NULL )
----
0
81

query I rowsort
SELECT + AVG ( DISTINCT + + col2 ) FROM tab0 WHERE NOT + col0 + col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NOT NULL <> ( NULL ) GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT col2 + - + col2 = col2
----
45
71
8

query I rowsort
SELECT ALL col1 * col1 FROM tab1 AS cor0 WHERE NULL = NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2775
SELECT col1 DIV + col1 + + col1 AS col1 FROM tab1 GROUP BY col1
----
45
58
7

skipif mysql # not compatible
query I rowsort label-2775
SELECT col1 / + col1 + + col1 AS col1 FROM tab1 GROUP BY col1
----
45
58
7

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE NOT - col0 / - - col1 = NULL GROUP BY col0, col0
----

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
-24
-38
-79

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT - - col2 IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2, col0 HAVING NULL < + - AVG ( ALL + col1 ) / col0 * + + AVG ( col2 )
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 + + + col1 FROM tab1 GROUP BY col1, col2
----
102
115
14

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 DISTINCT - col2 col2 FROM tab1 GROUP BY col2, col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT - col2 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT ALL col2 * + col2 AS col1 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 WHERE NOT + col2 * + col0 IS NOT NULL GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 cor0 WHERE col0 = NULL GROUP BY col1, col0, col0
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col1, col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col2 HAVING + col2 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 WHERE + col0 * - - col1 <> NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + col2 FROM tab0 WHERE NULL <> NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col1 + - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0, col1
----
-114
-12
-88

query II rowsort
SELECT col0 AS col2, col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( + AVG ( DISTINCT + + col2 ) ) IS NOT NULL
----
0
81

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING - col2 <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1 HAVING NOT - + AVG ( - col1 ) NOT BETWEEN NULL AND + col0
----

query I rowsort
SELECT + col2 * - + col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL > NULL
----

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 - - col0 AS col2, col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query II rowsort
SELECT ALL + col1 AS col0, + col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT + - col1 AS col1 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 DISTINCT - col0 col2 FROM tab0 cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT col1 * + col1 AS col0 FROM tab1 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col1, col0 HAVING NULL NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT + col1 * - + col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 GROUP BY col1 HAVING - + AVG ( DISTINCT + col1 ) IS NULL
----

query I rowsort
SELECT ALL - + col2 + col1 FROM tab2 WHERE NOT - col0 IS NOT NULL GROUP BY col2, col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1, col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 + col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT - AVG ( ALL - - col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col0 + + + col0 AS col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT + col1 * + col2 AS col2 FROM tab2 WHERE NOT col1 * col0 IS NULL GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT DISTINCT + col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 WHERE NOT ( col1 ) IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + + AVG ( col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT ( - col2 ) IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - - col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1 HAVING NULL IS NULL
----
1444
576
6241

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL IS NOT NULL )
----
44
57
6

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT col1 IS NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab1 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col1 AS col1 FROM tab1 WHERE NOT col0 NOT BETWEEN NULL AND col2 GROUP BY col1, col2
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NULL < ( NULL )
----

query I rowsort
SELECT - AVG ( ALL col2 ) AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col1, col0 HAVING - col0 NOT IN ( col0 )
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING ( ( NOT ( NULL ) IS NULL ) )
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - AVG ( + - col1 ) FROM tab2 AS cor0 GROUP BY col1, col0 HAVING + - col0 > NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING - - col1 IS NOT NULL
----
-81
0

query I rowsort
SELECT ALL 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 - - col2 col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT - col0 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 + col2 FROM tab2 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 WHERE NOT ( NULL ) <> NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT + col0 * - col0 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN - col0 AND NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 + - col2 * + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col0 AS col0 FROM tab0 cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT col1 * + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1936
3249
36

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col2, col1
----
15
91
92

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query II rowsort
SELECT DISTINCT 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 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT - col0 BETWEEN NULL AND ( NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - + AVG ( DISTINCT col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT - col1 <= ( NULL )
----

query I rowsort
SELECT + - col2 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 WHERE NULL BETWEEN - col1 / + col1 AND NULL GROUP BY col0
----

query II rowsort
SELECT col0, - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
-26
43
-43
83
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab0 GROUP BY col0, col1 HAVING NOT ( NOT ( NULL ) IS NULL )
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT + col2 - - AVG ( ALL - col2 ) FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-2886
SELECT DISTINCT - col1 DIV - col1 FROM tab1 AS cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-2886
SELECT DISTINCT - col1 / - col1 FROM tab1 AS cor0 GROUP BY col1
----
1

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 WHERE NOT NULL < NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT col0 FROM tab1 WHERE ( + col1 ) IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - - col0 * + + col0 AS col0 FROM tab0 WHERE col1 IS NOT NULL GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL > NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT col2 * + col0 AS col2 FROM tab0 GROUP BY col2, col0 HAVING NOT + col0 IS NULL
----
1032
2054
3154

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT - + col1 * - - col1 + - col1 IS NULL
----
0
81

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT + + col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0 HAVING NOT ( NOT - AVG ( ALL + col0 ) + - + AVG ( ALL col0 ) IS NULL )
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col0, col2 + - col2 FROM tab0 GROUP BY col2, col2
----
24
0
38
0
79
0

query II rowsort
SELECT col2 AS col0, - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
-24
38
-38
79
-79

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col2 * + + col2 AS col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 WHERE NOT NULL >= NULL GROUP BY col0, col2, col1
----

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1 HAVING - col1 IS NULL
----

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 + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NULL <= NULL AND NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query II rowsort
SELECT ALL col2, + col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
45
57
71
44
8
6

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL >= col1
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + - col0 * col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-1849
-676
-6889

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col0 HAVING ( col2 + col0 ) < col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL col1 * + col1 AS col0 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0, col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 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, col2, col1 HAVING ( NULL ) IS NULL
----
26
43
83

query II rowsort
SELECT ALL + - col1, - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL NOT BETWEEN NULL AND NULL )
----

query II rowsort
SELECT + col0, - col0 AS col2 FROM tab0 GROUP BY col0 HAVING NULL < NULL
----

query II rowsort
SELECT - col0 AS col1, - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT AVG ( ALL - col0 ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-2941
SELECT ALL + col0 DIV col0 FROM tab1 cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-2941
SELECT ALL + col0 / col0 FROM tab1 cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT - + col1 AS col0 FROM tab1 WHERE NULL IS NULL OR NOT ( NULL ) IS NULL GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col2 HAVING NOT - col0 IS NOT NULL
----

query II rowsort
SELECT + col1, col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 WHERE col0 >= NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 + + - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
0

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 WHERE NOT col1 BETWEEN + col0 AND ( + col1 ) GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL + + col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + - col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
0
0
81

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING - - AVG ( col0 ) IS NULL
----

query I rowsort
SELECT - col0 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT ALL - col2 * + - col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col0, col2
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING ( + col1 ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0, col2, col0
----
26
43
83

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 col2 FROM tab0 GROUP BY col0, col2 HAVING NOT ( NULL IS NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2964
SELECT DISTINCT col2 DIV - col2 + - col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1445
-577
-6242

skipif mysql # not compatible
query I rowsort label-2964
SELECT DISTINCT col2 / - col2 + - col2 * col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1445
-577
-6242

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-22
22
-28
28
-82
82

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col0 + col0 FROM tab2 GROUP BY col0, col0
----
182
184
30

onlyif mysql # DIV for integer division: 
query I rowsort label-2968
SELECT col0 + col0 DIV - col0 col1 FROM tab1 GROUP BY col0
----
21
27
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-2968
SELECT col0 + col0 / - col0 col1 FROM tab1 GROUP BY col0
----
21
27
81

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
15
91
92

query II rowsort
SELECT ALL + + col2, + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT 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 col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
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 DISTINCT + col0 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT - col2 * - col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NULL = + col1 * - col0
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING + - col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0, col2 HAVING NULL NOT IN ( col2 )
----

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
0

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + - col2 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-2025
-5041
-64

query I rowsort
SELECT + col0 / - col0 AS col0 FROM tab0 AS cor0 WHERE + col2 IS NULL GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----

query II rowsort
SELECT - + AVG ( ALL - col0 ) AS col1, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 WHERE + col1 IS NULL GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <> NULL GROUP BY col2
----

query II rowsort
SELECT - col0, col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
0
-28
0
-82
0

query I rowsort
SELECT ALL col0 FROM tab1 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
41
59
61

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col2 * + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - AVG ( ALL col2 ) FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT ALL + col2 + - - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
142
16
90

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 cor0 WHERE NOT - col1 NOT BETWEEN ( - col2 ) AND NULL GROUP BY col2, col0
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query II rowsort
SELECT + col0, col0 AS col2 FROM tab0 WHERE NOT col0 <> NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING NOT NULL = - - col1
----

query I rowsort
SELECT + + col2 + + col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
142
16
90

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL col0 * - - col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL + col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-3027
SELECT DISTINCT col1 * + col1 DIV - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-3027
SELECT DISTINCT col1 * + col1 / - col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + - col2 + col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
-17
11
14

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 WHERE ( + col1 ) IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 WHERE - - col2 - - - col1 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT col0 + + col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL BETWEEN NULL AND ( + col2 )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 - + + col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT NULL IS NULL )
----
-58
-79
-87

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT - col2 <= col1 GROUP BY col2
----

query II rowsort
SELECT + col0 AS col0, col1 + col1 FROM tab0 GROUP BY col1, col0 HAVING NULL > col0
----

query I rowsort
SELECT - col1 + - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + + col0 AS col0 FROM tab2 cor0 WHERE col1 IS NOT NULL GROUP BY col0
----
182
184
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL < - col1 * - + AVG ( ALL + col2 )
----

query I rowsort
SELECT + col1 FROM tab1 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, col2
----
0

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

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 DISTINCT - + col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 WHERE + col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2, col2 HAVING NOT - col2 IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col0 * col0 AS col1 FROM tab0 WHERE NOT col0 IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING col2 > NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 WHERE NOT NULL BETWEEN NULL AND + col1 GROUP BY col2, col2
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL + + col0 FROM tab1 cor0 GROUP BY col0, col1, col0 HAVING NOT + col1 IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3071
SELECT DISTINCT + col0 DIV + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
1

skipif mysql # not compatible
query I rowsort label-3071
SELECT DISTINCT + col0 / + col0 AS col0 FROM tab0 GROUP BY col0, col2
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 GROUP BY col0, col1, col2 HAVING ( NULL ) IS NULL
----
24
38
79

query I rowsort
SELECT - col1 / - col1 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 * + col2 AS col0 FROM tab0 GROUP BY col1, col2
----
-1944
0
0

query I rowsort
SELECT DISTINCT - col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL = NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col2 * col0 AS col0 FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - + col2 * - col2 - - - col2 AS col1 FROM tab2 WHERE - col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT col1 + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL - col0 + - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-166
-52
-86

query I rowsort
SELECT + col1 * - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
1681
3481
3721

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + + AVG ( DISTINCT col2 ) IS NULL
----
-41
-59
-61

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 * + col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query II rowsort
SELECT - AVG ( DISTINCT col1 ), - col1 * - col1 * + col1 + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - col1 > NULL
----

query I rowsort
SELECT col2 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( col1 ) IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2, col1 HAVING NULL IS NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col2 FROM tab2 AS cor0 WHERE NOT ( NOT col0 BETWEEN NULL AND + col2 - col0 ) GROUP BY col1, col1 HAVING NOT ( ( + col1 * - col1 ) IS NOT NULL )
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING col2 >= NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

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 * - col0 AS col2 FROM tab1 GROUP BY col0
----
-462
-6642
-756

query II rowsort
SELECT col2 AS col2, + col2 AS col1 FROM tab2 GROUP BY col2, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 AS cor0 WHERE NOT + col1 IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT AVG ( ALL col1 ) FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT col2 AS col2 FROM tab2 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, col1
----
44
57
6

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 GROUP BY col1, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col1 * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
2565
3124
48

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 / + + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query II rowsort
SELECT DISTINCT + col2, - col2 * + - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
3364
79
6241
87
7569

query I rowsort
SELECT DISTINCT - col0 FROM tab2 WHERE NOT - col1 * col1 IS NULL GROUP BY col0, col1
----
-15
-91
-92

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, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT col0 + col1 FROM tab2 GROUP BY col1, col2, col0 HAVING ( NULL ) IS NULL
----
133
150
76

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col0 HAVING ( NULL ) NOT BETWEEN col0 AND ( NULL )
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL >= + col0 + col1 * + col0
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NOT NULL AND NULL > NULL
----

query I rowsort
SELECT DISTINCT - col2 * col2 AS col1 FROM tab1 AS cor0 WHERE NULL >= - col0 GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT + col2 * - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1444
-576
-6241

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2, col1, col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT - col2 - col0 * col2 FROM tab0 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col0, col2
----
-1056
-2133
-3192

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 WHERE NOT ( NOT ( ( NULL ) >= NULL ) ) GROUP BY col2 HAVING NOT ( col1 ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - 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 col2 col1 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL - - col2 + - col0 FROM tab2 cor0 GROUP BY col2, col0
----
-12
-34
72

query II rowsort
SELECT col2, col2 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * col1 AS col2 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col0, col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col2, col0, col1
----

query I rowsort
SELECT ALL - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING + col2 IS NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE ( + col0 ) BETWEEN NULL AND NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col2 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NOT - col2 IS NULL
----

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 + col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col0 HAVING NULL < NULL AND col1 <= + col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT - - col2 AS col1 FROM tab0 WHERE NOT + col0 BETWEEN NULL AND NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col2 + col2 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN col1 + + + col0 AND ( NULL ) GROUP BY col0, col2, col2
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + - col0 * + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL IS NULL )
----
484
6724
784

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 GROUP BY col1 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 - - col2 FROM tab0 cor0 GROUP BY col0, col2, col2
----
24
38
79

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 - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NOT col2 IS NOT NULL )
----
26
43
83

query I rowsort
SELECT col0 * col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT + col0 IS NULL
----
1849
676
6889

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 cor0 WHERE + col1 IS NULL GROUP BY col0
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT col2 - - col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 + + AVG ( + col2 ) FROM tab0 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * + col1 FROM tab2 GROUP BY col1, col2, col1 HAVING NULL < NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT - col0, col0 AS col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab2 WHERE NOT ( NOT - col2 IS NULL ) GROUP BY col0
----

query II rowsort
SELECT col0, col0 + - col0 FROM tab2 GROUP BY col0
----
15
0
91
0
92
0

query I rowsort
SELECT + col2 AS col1 FROM tab1 WHERE ( NULL IS NULL ) GROUP BY col2 HAVING NOT col2 IS NULL
----
45
71
8

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NULL > col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col1 - - + col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
0
162

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING NOT - col2 IS NULL
----
58
79
87

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT col0 * col0 FROM tab1 GROUP BY col0, col2
----
484
6724
784

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0, col1 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL OR NOT NULL <> NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( NULL IS NULL )
----
24
38
79

query I rowsort
SELECT ALL col1 + col1 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
118
122
82

query I rowsort
SELECT - col1 FROM tab1 WHERE NULL = - col0 GROUP BY col1
----

query II rowsort
SELECT - col1, + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2, col0
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3227
SELECT - col1 DIV - col1 + + col1 - col1 FROM tab1 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3227
SELECT - col1 / - col1 + + col1 - col1 FROM tab1 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1
----
1
1
1

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab0 WHERE NOT NULL = NULL GROUP BY col2, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3230
SELECT + col2 DIV - - col2 AS col0 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3230
SELECT + col2 / - - col2 AS col0 FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col2 + + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 WHERE NULL = ( + col1 + - col1 ) GROUP BY col2
----

query I rowsort
SELECT - col1 - col1 FROM tab2 WHERE NOT + col0 = + - col0 GROUP BY col0, col1 HAVING NOT ( NULL ) = + col0
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col1, col2
----
58
79
87

query II rowsort
SELECT - col1 AS col1, - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 WHERE NULL = NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
58
79
87

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

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 DISTINCT - + col2 FROM tab1 AS cor0 WHERE col0 <> NULL GROUP BY col2, col1
----

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
0
0
81

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2, col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL AVG ( + - col2 ) FROM tab1 GROUP BY col2 HAVING NOT NULL < NULL
----

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 DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

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 + col0 AS col1 FROM tab0 WHERE NOT ( - col0 ) IS NULL GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1, col2, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - + col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 cor0 GROUP BY col2, col0 HAVING NOT - + col2 = NULL
----

query I rowsort
SELECT + col1 FROM tab1 WHERE ( NOT ( NULL ) IS NULL ) GROUP BY col1
----

query II rowsort
SELECT - col2 AS col1, col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab1 GROUP BY col1, col2 HAVING - - col2 IS NOT NULL
----
-2025
-5041
-64

query I rowsort
SELECT col1 + - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query II rowsort
SELECT ALL col2 AS col2, col2 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL col0 * - col0 AS col1 FROM tab0 AS cor0 WHERE NOT - col1 NOT BETWEEN ( NULL ) AND - col0 GROUP BY col0
----

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
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, col1
----
-22
-28
-82

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 cor0 WHERE NULL < NULL GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col0 HAVING NOT NULL <= ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab2 AS cor0 WHERE ( NOT NULL IS NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT + col2 AS col0 FROM tab1 WHERE col1 IS NULL GROUP BY col2
----

query I rowsort
SELECT col2 + + + col2 AS col1 FROM tab0 GROUP BY col2
----
158
48
76

query II rowsort
SELECT DISTINCT - col2 AS col2, col0 FROM tab1 GROUP BY col0, col2
----
-45
28
-71
82
-8
22

query I rowsort
SELECT + + col2 FROM tab1 WHERE NOT + - col2 IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT col1 - + col1 AS col1 FROM tab1 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col1, col1
----

query II rowsort
SELECT ALL col2 AS col2, - col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

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 DISTINCT + col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query II rowsort
SELECT col0, col0 AS col1 FROM tab2 AS cor0 WHERE col2 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * - + col2 AS col0 FROM tab2 GROUP BY col1, col2
----
-3364
-6241
-7569

query I rowsort
SELECT col2 / col2 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab1 cor0 WHERE NOT - col1 + - col0 / - col0 / + col1 / col0 IS NULL GROUP BY col2 HAVING NOT NULL IN ( - col2 )
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE - col1 IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING AVG ( + col0 ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING col0 < NULL
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col1 / col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 WHERE + col2 NOT BETWEEN - + col2 AND NULL GROUP BY col2
----

query I rowsort
SELECT col1 FROM tab2 WHERE NOT NULL NOT IN ( col1 ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 * - + col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING ( ( NOT - col2 IS NULL ) )
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NOT NULL >= ( NULL ) GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 WHERE NOT + col1 * col2 + + col1 + - + col2 IS NULL GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
58
79
87

query II rowsort
SELECT col0 AS col2, + col0 FROM tab0 AS cor0 WHERE - col1 <> + col2 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT col0 FROM tab0 WHERE col1 IN ( + col1 ) GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-3364
-6241
-7569

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT col2 + + + col2 - + - col2 AS col0 FROM tab0 GROUP BY col2
----
114
237
72

query II rowsort
SELECT - col2, - col2 FROM tab2 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 - + - col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT - col1 + col1 + - col2 * - + col2 AS col0 FROM tab1 GROUP BY col1, col2
----
2025
5041
64

query I rowsort
SELECT + col0 AS 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 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT - - col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + - col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - col1 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 NULL = NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING + col0 IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL + AVG ( + + col2 ) FROM tab2 GROUP BY col2 HAVING NOT NULL >= col2
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - + col0 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + - col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 + + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-182
-184
-30

query I rowsort
SELECT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + - col0 col1 FROM tab1 GROUP BY col2, col0 HAVING NOT AVG ( ALL col1 ) IS NULL
----
0
0
0

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

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 - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE col2 > + - col1 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col2, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col2 HAVING ( NULL IS NULL )
----

query II rowsort
SELECT - col2 AS col0, - AVG ( DISTINCT - - col2 ) + + col1 FROM tab2 WHERE NULL >= NULL GROUP BY col2, col2, col1
----

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab1 GROUP BY col2, col0
----
142
16
90

query II rowsort
SELECT + col2, col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

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 col1 AS 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 cor0 GROUP BY col1, col2
----
-24
-38
-79

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 col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL <= + + col0
----

query I rowsort
SELECT DISTINCT AVG ( col0 ) + col0 AS col1 FROM tab1 cor0 WHERE NOT ( NULL ) NOT IN ( + col1 + col1 ) GROUP BY col0
----

query I rowsort
SELECT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 * + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 + col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 WHERE col1 IS NOT NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 * col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1406
-552
-6162

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NULL = - col1 * - col1
----

query I rowsort
SELECT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col1 * + AVG ( DISTINCT col1 ) + + col1 + + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) <> NULL GROUP BY col1, col2
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL = NULL )
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NULL <= col2 OR NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col2 FROM tab1 WHERE NULL 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 + - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-3405
-6300
-7630

query I rowsort
SELECT + col1 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) <= NULL GROUP BY col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 GROUP BY col1, col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-81
0
0

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col2, col1
----

query I rowsort
SELECT DISTINCT col0 + - 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
----
26
43
83

query I rowsort
SELECT col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) = NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 + - - col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT ALL col1, + col1 FROM tab0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 FROM tab2 WHERE NOT + - col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - + col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col1 / col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE NULL IS NULL GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1, col0
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col0, 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 HAVING - col0 IS NOT NULL
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-3415
SELECT DISTINCT col1 DIV - - col0 FROM tab1 GROUP BY col0, col1
----
0
2

skipif mysql # not compatible
query I rowsort label-3415
SELECT DISTINCT col1 / - - col0 FROM tab1 GROUP BY col0, col1
----
0
2

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( col0 )
----

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL - - col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL OR NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + - col2 = NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col2, col0, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 - - col2 FROM tab2 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT + col2 / + col2 * + col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col1 AS col2 FROM tab1 WHERE - + col0 NOT BETWEEN NULL AND + col1 GROUP BY col1, col1 HAVING NOT + col1 IS NULL
----

query I rowsort
SELECT col0 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 * + + col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1 HAVING + - col1 IS NOT NULL
----
26
43
83

query I rowsort
SELECT AVG ( ALL - col2 ) FROM tab2 GROUP BY col2 HAVING NOT ( + col2 ) > NULL
----

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT + + col2 < NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 WHERE NOT ( + col2 ) IS NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT + - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL > ( NULL ) )
----

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT + col1 FROM tab2 WHERE NOT + + col0 IS NULL GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT - col1 - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-118
-122
-82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

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 + col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - 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 DISTINCT col1 col0 FROM tab1 WHERE - col1 <> ( NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 WHERE NOT - col2 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----
1849
676
6889

query I rowsort
SELECT col0 * - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT col0 FROM tab2 WHERE NOT + + col0 IS NULL GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT ( + col2 ) IS NULL GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col1 * + col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
2378
4661
5307

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( ( NOT NULL IS NOT NULL ) )
----

query I rowsort
SELECT + + AVG ( - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL - col2 + - col2, + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
-142
71
-16
8
-90
45

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
58
79
87

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 IS NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT - + col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + 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 col1 col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col0 + + col0 AS col2 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + - col0 * - col0 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1, col0
----
225
8281
8464

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 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 DISTINCT col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + + col2 FROM tab2 WHERE NULL < NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col0 AS col1 FROM tab0 WHERE NOT ( NULL IS NULL ) GROUP BY col0
----

query I rowsort
SELECT + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col1 + col1 AS col2 FROM tab1 WHERE NOT + col1 IS NOT NULL GROUP BY col1, col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3489
SELECT DISTINCT + col1 DIV - col1 FROM tab1 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-3489
SELECT DISTINCT + col1 / - col1 FROM tab1 GROUP BY col1
----
-1

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 WHERE NOT col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - AVG ( - col0 ) FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col1 AS col0 FROM tab2 WHERE NULL IS NULL GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

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 DISTINCT col2 AS col0 FROM tab1 GROUP BY col2, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 * col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query II rowsort
SELECT col1 + + col1, + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
162
81

query I rowsort
SELECT DISTINCT - col2 FROM tab1 WHERE col0 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col1, col0 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab0 WHERE - col1 IS NULL GROUP BY col1, col2 HAVING NULL <> ( NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col2, col2, col0 HAVING NOT NULL > col1
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col2 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col2, col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL + col0 FROM tab2 WHERE NULL > NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col2, col0, col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 * col2 AS col2 FROM tab1 WHERE - col2 IS NOT NULL GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL + - col1 + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS 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 col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2 HAVING NOT NULL > - col0
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 + - - col0 FROM tab0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 WHERE NOT + col0 <> col0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 WHERE - col0 IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT col1 + AVG ( - col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 WHERE NOT col1 IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 AS cor0 GROUP BY col1, col0, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col1 FROM tab1 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 col1 col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1 HAVING + col2 >= ( NULL )
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT + col1 IS NULL
----
41
59
61

query I rowsort
SELECT - + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 FROM tab2 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col2, col2, col1
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
-22
-28
-82

query II rowsort
SELECT DISTINCT col1, + col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL col0 - col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING + col0 >= + col2
----
12
34

query I rowsort
SELECT ALL + col0 FROM tab1 WHERE ( NULL ) >= NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT col1 - - col1 FROM tab2 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 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - col1 FROM tab1 WHERE col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 FROM tab0 WHERE NOT NULL <= - col2 * + col2 GROUP BY col0, col2
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab1 GROUP BY col2, col0 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
44
57
6

query II rowsort
SELECT ALL col0, - 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 FROM tab0 AS cor0 WHERE ( col2 * col1 ) IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING ( NOT ( NOT - - col2 < NULL ) )
----

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < col1
----

query I rowsort
SELECT col1 * + + col1 - + col1 AS col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT 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 ALL + col2 col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col2
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 WHERE NOT ( NULL ) <> NULL GROUP BY col2
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT ( NOT ( ( NULL ) > ( NULL ) ) )
----

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 * - - col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 WHERE NULL = NULL GROUP BY col0, col1, col2 HAVING NULL >= - col1
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col0 / + col2 / - col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT col2 - - col2 + - col2 AS col1 FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col1 + + col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
126
28
85

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col2 FROM tab0 cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col2, col1 HAVING NOT - col2 IS NULL
----
-22
-28
-82

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT + col1 * - col1 + + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT + + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT col1 * + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1681
3481
3721

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 FROM tab2 cor0 WHERE + col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NOT NULL >= ( NULL )
----

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 AS col0 FROM tab1 WHERE col0 - col1 NOT BETWEEN col2 AND NULL GROUP BY col2, col0
----
142
90

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 AS col2, col1 FROM tab1 GROUP BY col1, col0
----
22
6
28
57
82
44

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL col1 * col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
0
6561

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query II rowsort
SELECT ALL + col0, col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL col0 FROM tab2 WHERE NULL IN ( - col1 ) GROUP BY col0 HAVING NOT ( col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT + + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 WHERE NOT NULL > ( NULL ) GROUP BY col1, col1
----

query I rowsort
SELECT col1 + + + col1 AS col0 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + AVG ( ALL col0 ) FROM tab1 WHERE NULL > + - col0 GROUP BY col0, col1 HAVING - col0 IS NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab0 cor0 GROUP BY col1, col2, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 + col0 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 + + col0 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1, col2 HAVING col0 IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT col1 AS col2 FROM tab2 WHERE NOT NULL = NULL GROUP BY col1, col1, col1
----

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col2 * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL + col0 - - col0 AS col0 FROM tab1 GROUP BY col0, col2
----
164
44
56

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 WHERE NOT col0 <> col2 GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col0 + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
164
44
56

query II rowsort
SELECT - + col0 AS col1, col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - AVG ( col2 ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3648
SELECT col0 DIV col0 FROM tab1 GROUP BY col0, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3648
SELECT col0 / col0 FROM tab1 GROUP BY col0, col1
----
1
1
1

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col1 + - + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
-118
-122
-82

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NULL < - col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2 HAVING - col2 >= NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL >= - + col0
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + col1 * - - col1 + + + col1 FROM tab2 GROUP BY col1
----
1722
3540
3782

query I rowsort
SELECT ALL col0 FROM tab0 WHERE col0 + - col2 > ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT col1 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( - col1 <= NULL )
----

query I rowsort
SELECT + col0 AS col0 FROM tab0 WHERE - col1 NOT BETWEEN NULL AND NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT + col1 * + - col1 + col2 FROM tab0 GROUP BY col2, col1
----
-6537
38
79

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 * + col2 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

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 + col2 AS col1 FROM tab1 AS cor0 WHERE col0 IS NULL GROUP BY col2
----

query II rowsort
SELECT + col0 * col0 AS col0, col2 FROM tab1 GROUP BY col2, col0 HAVING NULL <> - col0 AND NULL BETWEEN NULL AND ( col0 )
----

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 col2 col1 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

query II rowsort
SELECT ALL + col0, + col0 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
22
22
28
28
82
82

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT - col0 AS col0 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 WHERE - col1 NOT IN ( + col1 ) GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT col1 + col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL + - col1 + - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 WHERE NOT NULL < ( - col1 ) GROUP BY col0
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col0 + + col0 AS col1 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 * + col0 + + col0 + + + col0 AS col1 FROM tab0 GROUP BY col0
----
-1763
-624
-6723

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT col1 + + + col1 + - - col1 FROM tab1 AS cor0 GROUP BY col1
----
132
171
18

onlyif mysql # DIV for integer division: 
query I rowsort label-3697
SELECT ALL - col1 DIV + col1 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3697
SELECT ALL - col1 / + col1 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
-1
-1
-1

query I rowsort
SELECT col0 * + col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
1849
676
6889

query I rowsort
SELECT + col1 - + col1 AS col2 FROM tab0 GROUP BY col1
----
0
0

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 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + - col2 / + - col2 AS col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col2 * + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
3364
6241
7569

query I rowsort
SELECT ALL col1 * + - col1 + + col1 AS col0 FROM tab0 GROUP BY col1
----
-6480
0

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 * - col1 - + col1 * - col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-1888
-2091
2806

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT + - col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query II rowsort
SELECT - col2 AS col0, col2 * - - col0 AS col1 FROM tab0 GROUP BY col0, col2
----
-24
1032
-38
3154
-79
2054

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + + col2 * + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT + col2 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
0

query I rowsort
SELECT - - col1 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) = ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col1 * col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab1 cor0 WHERE NOT col2 IS NULL GROUP BY col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-3725
SELECT + col2 DIV - col2 AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-3725
SELECT + col2 / - col2 AS col0 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT col2 - - col2 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT ALL + AVG ( + col1 ) FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

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 - col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING - AVG ( col1 ) IS NULL
----

query II rowsort
SELECT ALL col0, col1 FROM tab0 GROUP BY col0, col1, col1
----
26
0
43
81
83
0

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 + col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 + + - col0 FROM tab0 GROUP BY col0
----
-166
-52
-86

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING + + col1 IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 WHERE + col0 * - col1 = - - col2 GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT + col1 * - + col1 AS col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + + col2 * - + col2 FROM tab2 cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT col2 AS col0 FROM tab1 WHERE NOT ( col0 IS NULL ) GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1 HAVING ( NULL <> ( AVG ( - col2 ) ) )
----

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 * col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 col0 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab1 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT col1 + col0 FROM tab0 GROUP BY col0, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col1, col1, col0
----
26
43
83

query I rowsort
SELECT - col2 + col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 WHERE col1 IS NULL GROUP BY col1, col0 HAVING NULL < NULL
----

query I rowsort
SELECT + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL < - col0
----

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab1 WHERE NULL IS NULL GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL <= NULL
----

query I rowsort
SELECT AVG ( ALL - - col1 ) AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT - col0 * - - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL col1 + - col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NOT NULL <> NULL )
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 * + col1 FROM tab2 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3780
SELECT DISTINCT + col0 DIV - - col0 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-3780
SELECT DISTINCT + col0 / - - col0 FROM tab0 GROUP BY col0
----
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT col2 * col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
2025
5041
64

onlyif mysql # DIV for integer division: 
query I rowsort label-3783
SELECT DISTINCT col0 DIV - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-1

skipif mysql # not compatible
query I rowsort label-3783
SELECT DISTINCT col0 / - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-1

query I rowsort
SELECT + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT col1 * - col1 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IN ( - + col0 ) GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

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 col2 * - - col2 col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING + - col2 IS NOT NULL
----
-81
0

query I rowsort
SELECT col2 + + col2 AS col0 FROM tab2 GROUP BY col0, col2
----
116
158
174

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT ALL col0 * - col0 AS col1 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 GROUP BY col1 HAVING ( NULL ) NOT BETWEEN + AVG ( ALL + col0 ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab2 GROUP BY col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * + col0 col2 FROM tab1 GROUP BY col0, col2
----
484
6724
784

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col0, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col2 * - col2 AS col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT col2 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT - col2 + + col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 - + - col1 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 AS cor0 WHERE - col2 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + - col1 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT + col0 IS NULL
----
44
57
6

query I rowsort
SELECT + col0 * - col0 AS col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-484
-6724
-784

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col2 * - + col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL + + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col0, col2 HAVING NOT ( col0 ) > NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab2 GROUP BY col1
----
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 NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col0 col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL col2 * + col2 * col2 FROM tab2 GROUP BY col2, col1
----
195112
493039
658503

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab2 GROUP BY col0, col1
----
225
8281
8464

query I rowsort
SELECT DISTINCT - col1 + - + col1 FROM tab0 cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col1 HAVING + - col1 IS NOT NULL
----
22
28
82

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col1, col0, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 * - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-1681
-3481
-3721

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL <= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT - + col2 * - + col1 * - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
-157464
0

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2, col0, col1
----
0
0
81

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col0 * + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT ALL + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE NULL NOT BETWEEN - col0 AND col1 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col0 * - col0 * + col0 FROM tab0 GROUP BY col0
----
-17576
-571787
-79507

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( col2 ) <= NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 FROM tab0 cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col0 / col1 FROM tab1 GROUP BY col1, col0 HAVING NOT ( col0 <> NULL )
----

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
44
57
6

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab0 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query II rowsort
SELECT DISTINCT col0 AS col1, col0 FROM tab0 GROUP BY col2, col0 HAVING col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 * col0 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
3483

query I rowsort
SELECT ALL col0 * col0 AS col2 FROM tab0 cor0 WHERE NULL >= NULL GROUP BY col0
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT NULL < NULL GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col0, col1
----
15
91
92

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 col2 FROM tab0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
0

query I rowsort
SELECT + AVG ( - col1 ) FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col0, col1, col1
----
-41
-59
-61

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 * - - col0 * - col2 FROM tab1 GROUP BY col0, col2
----
35280
3872
477404

query II rowsort
SELECT - - col1 AS col1, + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
26
0
83
81
43

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col0 col1 FROM tab2 cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT + + col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

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 + AVG ( - col2 ) * + col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 / col0 col0 FROM tab1 AS cor0 GROUP BY col1, col0, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING ( AVG ( DISTINCT col2 ) ) > NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 * + col1 + - + col1 / + col1 col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 * + - col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + - col0 * - col0 - col0 FROM tab2 AS cor0 GROUP BY col0
----
210
8190
8372

onlyif mysql # DIV for integer division: 
query I rowsort label-3903
SELECT - col2 * - col2 DIV col2 + + col2 * - col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
-13800
-492960
-54834

skipif mysql # not compatible
query I rowsort label-3903
SELECT - col2 * - col2 / col2 + + col2 * - col2 * col2 FROM tab0 AS cor0 GROUP BY col2
----
-13800
-492960
-54834

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL col1 + - col0 / col0 / - col1 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 FROM tab0 cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT AVG ( DISTINCT + col0 ) FROM tab1 AS cor0 WHERE NOT NULL > ( NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + col0 + + col0 + + col0 FROM tab0 cor0 GROUP BY col0
----
129
249
78

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2, col0 HAVING NOT col2 IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 + - col1 + - + col1 col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT - - col0 + col0 + + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
246
66
84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab1 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT - - 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 ALL col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 GROUP BY col1, col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) BETWEEN + col0 AND - + col0 GROUP BY col1, col2
----

query I rowsort
SELECT col1 * + + col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col2 * - - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT col2 - - col0 AS col0 FROM tab2 GROUP BY col0, col0, col2
----
102
150
170

query I rowsort
SELECT DISTINCT + col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2, col1, col0
----
-58
-79
-87

query I rowsort
SELECT + col0 * col1 - - col1 FROM tab2 GROUP BY col2, col1, col0
----
3813
5428
976

query I rowsort
SELECT DISTINCT - col0 * + + col0 AS col0 FROM tab2 GROUP BY col1, col0
----
-225
-8281
-8464

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * + + col2 * col2 AS col2 FROM tab2 GROUP BY col1, col2
----
195112
493039
658503

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col0, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT - col2 + + col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT - col2 + + + col1 IS NOT NULL
----

query II rowsort
SELECT + col0, col0 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
26
26
43
43
83
83

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 WHERE ( col2 ) IS NULL GROUP BY col0
----

query I rowsort
SELECT - AVG ( - col2 ) FROM tab1 WHERE NOT + col2 > NULL GROUP BY col2
----

query I rowsort
SELECT col1 - - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND AVG ( DISTINCT col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 AS col1, + col2 col1 FROM tab0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 AS col2, col2 col1 FROM tab2 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + - col1 NOT BETWEEN + + AVG ( - col1 ) AND NULL
----

query I rowsort
SELECT + col0 * + - col0 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-478
-6680
-727

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col1, col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT - col0 / col0 FROM tab2 AS cor0 WHERE NULL <> ( NULL ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 * + col1 col2 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT col1 * - col1 + col1 FROM tab0 GROUP BY col1, col0
----
-6480
0
0

query I rowsort
SELECT ALL col1 / col2 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3959
SELECT + col2 DIV + col2 FROM tab0 GROUP BY col0, col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3959
SELECT + col2 / + col2 FROM tab0 GROUP BY col0, col2, col2
----
1
1
1

query I rowsort
SELECT col1 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT + + col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + col2 * - col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col1, col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-3967
SELECT ALL + col0 DIV col0 FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-3967
SELECT ALL + col0 / col0 FROM tab0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + + col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
0
81

query II rowsort
SELECT col1 / col2 AS col2, + col2 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 / - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + AVG ( DISTINCT col1 ) + - col1 FROM tab0 AS cor0 WHERE NULL > ( NULL ) GROUP BY col1
----

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 * - col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
-6561
0

query I rowsort
SELECT + + AVG ( col2 ) FROM tab1 cor0 GROUP BY col2, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 + + col0 * col0 FROM tab1 AS cor0 GROUP BY col0
----
506
6806
812

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 + + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
133
150
76

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 * - col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
1944

query I rowsort
SELECT + + col2 FROM tab2 cor0 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 GROUP BY col1, col1 HAVING ( NULL > col2 )
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL col1 - + col1 FROM tab0 GROUP BY col1, col0
----
0
0
0

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + col0 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + + col1 col2 FROM tab0 GROUP BY col1, col2
----
105
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IN ( col2 )
----

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT + col1 * col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col0 / - col0 AS col0 FROM tab2 WHERE NOT NULL IS NULL OR - col2 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
24
38
79

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 DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col1, col1, col0 HAVING NOT ( NULL NOT BETWEEN NULL AND ( NULL ) )
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + - col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col0 * - + col0 AS col0 FROM tab1 GROUP BY col2, col0
----
-484
-6724
-784

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col0 * - col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT col0 * col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col1 / + col0 AS col2, col1 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT + col1 + + col1 AS col0 FROM tab1 WHERE NOT + col1 IS NULL GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

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 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - + AVG ( + col2 ) IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 GROUP BY col1 HAVING + col1 <> NULL
----

query I rowsort
SELECT col2 * + col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) < NULL
----

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 col2 * + col1 FROM tab1 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

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 col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 cor0 GROUP BY col2, col1 HAVING ( NULL ) = NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
24
38
79

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col1, col0, col2 HAVING col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col2 + - - col2 + col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col0, col0, col1
----
0
0
81

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
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 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 + + col1 * col1 AS col1 FROM tab0 GROUP BY col1
----
0
6480

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col1, 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 col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 + - + col2 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + col2 FROM tab1 WHERE NOT - + col1 IS NOT NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4051
SELECT col0 DIV - + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-1
-1
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4051
SELECT col0 / - + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 WHERE + col0 + + col0 IN ( + col2 * col2 ) GROUP BY col2
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col0, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 + col2 AS col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col1, 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
----
0
81

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT - - col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT + + col2 * + + col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col1 + - + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-114
-12
-88

query I rowsort
SELECT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT col0 + + col0 - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT col2 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - col2 * + col2 + col2 FROM tab0 GROUP BY col2
----
-1406
-552
-6162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col1, + col1 col2 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col0 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * col2 col0 FROM tab2 GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col1 * + + col1 FROM tab0 GROUP BY col1, col1 HAVING ( NULL ) <= NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <= ( - col2 + col0 )
----

query I rowsort
SELECT ALL - - 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 ALL - col1 col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query II rowsort
SELECT + col0 AS col1, + col0 FROM tab2 cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT col2 - + col2 AS col2 FROM tab2 GROUP BY col2
----
0

query I rowsort
SELECT - 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 ALL + - 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 DISTINCT col0 col2 FROM tab0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + col0 col2 FROM tab0 cor0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col2, col0
----
22
28
82

query II rowsort
SELECT DISTINCT col2 AS col2, col1 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2, col1
----
45
57
71
44
8
6

onlyif mysql # DIV for integer division: 
query I rowsort label-4098
SELECT col0 DIV - col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4098
SELECT col0 / - col0 AS col2 FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col0 AS col0 FROM tab1 cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col1, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + col1 + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query II rowsort
SELECT col1 AS col2, col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT AVG ( - + col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

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 + col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT + + col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col0 AS col0 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 col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

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 AS col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col0 - + col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING - col1 IN ( - AVG ( ALL + col0 ) - + - col1 )
----

query I rowsort
SELECT DISTINCT - + 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 NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab2 GROUP BY col0, col1
----
1681
3481
3721

query I rowsort
SELECT ALL - col1 + + col1 + - + col2 * - - col2 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL - col0 * + + col2 AS col1 FROM tab2 GROUP BY col0, col2, col2
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT col2 FROM tab1 WHERE NULL <= ( NULL ) GROUP BY col0, col2
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT col2 * + col2 FROM tab0 GROUP BY col2
----
1444
576
6241

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 I rowsort
SELECT DISTINCT - col1 - - - col1 col2 FROM tab1 cor0 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT AVG ( DISTINCT + col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 * - - col0 AS col2 FROM tab1 GROUP BY col0, col2
----
484
6724
784

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
0
0
81

query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE NOT NULL < NULL GROUP BY col2
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col1 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT ( + col0 ) IS NOT NULL
----

query I rowsort
SELECT col1 - - + col1 - - - col1 * + col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT + - col1 IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col2, col2, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 WHERE NOT NULL <> NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL col2 * - col2 * - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 - + col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 * + col0 + + + col0 FROM tab2 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 WHERE - col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-4161
SELECT + col2 * - + col2 DIV + col2 FROM tab0 GROUP BY col2
----
-24
-38
-79

skipif mysql # not compatible
query I rowsort label-4161
SELECT + col2 * - + col2 / + col2 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-4163
SELECT col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4163
SELECT col1 / + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
1
1
1

query II rowsort
SELECT ALL - col1 AS col1, col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 - + col0 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
-124
-26
-83

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - - col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query II rowsort
SELECT + col1 AS col1, col1 + - col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
0
0
81
0

query I rowsort
SELECT DISTINCT + col1 * col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 AS col0 FROM tab0 cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL > col0
----

query I rowsort
SELECT DISTINCT - col1 * - - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 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 ALL col0 AS col0 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col2 - - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT + col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL col0 * col0 AS col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 + col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL + - col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - col0 * col0 + col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
-210
-8190
-8372

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col0 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
0

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL <= ( NULL )
----

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( NULL ) = NULL
----

query II rowsort
SELECT - col2 AS col0, col2 FROM tab1 GROUP BY col2
----
-45
45
-71
71
-8
8

query I rowsort
SELECT ALL + - col0 * col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
-1849
-676
-6889

query II rowsort
SELECT col0 AS col0, col0 AS col0 FROM tab0 GROUP BY col1, col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT - - col2 * + + col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2 HAVING ( NOT ( col2 ) IS NOT NULL )
----

query I rowsort
SELECT + col1 FROM tab1 WHERE + col1 IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE ( NULL ) <> NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT col2 AS col0 FROM tab2 cor0 GROUP BY col2, col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL col0 * - col0 AS col1 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col1, col0 HAVING ( + - col0 ) IS NULL
----

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col0, + col0 * + 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 col1 HAVING NOT + + col1 IS NOT NULL
----

query I rowsort
SELECT + col0 + + col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
182
184
30

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query I rowsort
SELECT - + col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + - col1 * - - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING + col0 IS NOT NULL
----
22
28
82

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 DISTINCT col2 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT + + AVG ( ALL col1 ) FROM tab0 AS cor0 GROUP BY col1, col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col2 FROM tab0 WHERE NOT col1 / - col0 IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT - col2 / + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col0, - col0 AS col1 FROM tab1 GROUP BY col1, col1, col0
----
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col2 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + - col1 - col1 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 + - - col0 FROM tab2 GROUP BY col0
----
182
184
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT + col0 AS col1, - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT DISTINCT - - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-4241
SELECT + col1 DIV + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4241
SELECT + col1 / + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-4242
SELECT ALL + + col1 DIV col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4242
SELECT ALL + + col1 / col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

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 DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + col0 + - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
182
184
30

query I rowsort
SELECT - col0 + col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 - - col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT ALL + AVG ( DISTINCT + + col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0, col2, col2 HAVING NOT NULL <> + col2
----

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col2, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 + + col0 AS col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col0, + col0 AS col2 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query II rowsort
SELECT col0, + col0 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT + col0 * - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col0, col0
----
0
0
81

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query II rowsort
SELECT ALL col0 AS col1, col2 FROM tab1 GROUP BY col0, col2
----
22
8
28
45
82
71

query I rowsort
SELECT + - col0 - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

query II rowsort
SELECT DISTINCT col1 AS col0, col1 FROM tab1 cor0 GROUP BY col0, col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-4272
SELECT + col1 DIV col1 AS col0 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4272
SELECT + col1 / col1 AS col0 FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
-28
-82

query II rowsort
SELECT + col2, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col0, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col0 HAVING NOT - col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col0, col1
----
-45
-71
-8

query I rowsort
SELECT ALL col2 * col1 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL >= ( - col2 )
----

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT + col2 ) * + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + AVG ( DISTINCT - - col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 cor0 GROUP BY col2, col0, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

query II rowsort
SELECT col1, + col1 FROM tab0 GROUP BY col1, col2
----
0
0
0
0
81
81

query II rowsort
SELECT + col2, col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( - + col2 IS NULL )
----
24
24
38
38
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 AS col0, col0 col1 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col0 + col0 AS col1 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col0 * col0 AS col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

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 ALL + col2 * + col0 * + col0 AS col0 FROM tab0 GROUP BY col0, col2, col1
----
261782
44376
53404

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2, col0
----
58
79
87

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 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 col0 col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT + + col0 FROM tab0 cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + AVG ( + col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT col1 > ( NULL )
----

query I rowsort
SELECT + col2 + + col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + - col2 col1 FROM tab2 GROUP BY col2
----
-116
-158
-174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 - + col1 col0 FROM tab0 GROUP BY col1, col1
----
0
0

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT - + col1 AS 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 tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col2 + - col2 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col0, col2
----
45
71
8

query I rowsort
SELECT + col1 * - col1 AS col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query II rowsort
SELECT ALL + col1, - col1 * + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
6561

query I rowsort
SELECT AVG ( - - col0 ) FROM tab0 GROUP BY col1, col0 HAVING ( NULL <> NULL )
----

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 * - - col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 WHERE col2 * + + col2 IS NOT NULL GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

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 NULL
----
-58
-79
-87

query I rowsort
SELECT - col0 AS col0 FROM tab0 WHERE NULL > NULL GROUP BY col0
----

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT col0 - - - col0 AS col1 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col2, col0 HAVING NULL < NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT - col1 + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL + col2 * col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col2
----
0
81

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 ALL col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + - col1 * + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT ( ( NULL IS NOT NULL ) )
----
24
38
79

query I rowsort
SELECT - - col1 * - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col2 * + + col2 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col0 + + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING col1 > NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
41
59
61

query II rowsort
SELECT - col0 * col0, col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-225
15
-8281
91
-8464
92

query I rowsort
SELECT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT col2 + + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT + col1 + + col1 AS col2 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 * - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT - - col2 AS col1 FROM tab0 WHERE ( NOT - col0 IS NOT NULL ) GROUP BY col2
----

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, - col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-24
-38
-38
-79
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col1, col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col0 * - col0 * + - col0 + + col0 AS col2 FROM tab0 GROUP BY col0
----
17602
571870
79550

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 col2, - col0 col0 FROM tab0 GROUP BY col1, col0, col1
----
26
-26
43
-43
83
-83

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 FROM tab0 WHERE NULL IN ( + + col2 * - col1 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= ( - AVG ( - col0 ) )
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 col0, + col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL col2 - col2 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT + - col0 FROM tab2 cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

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-4392
SELECT DISTINCT col1 DIV - col1 FROM tab2 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-4392
SELECT DISTINCT col1 / - col1 FROM tab2 GROUP BY col1
----
-1

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col0, col2, col0
----
58
79
87

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 ALL + col1 * col0 - + 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 ALL - col1 col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT col2 - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT + col1 AS 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 - col2 + + - col2 col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + col0 - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col0, col0 col1 FROM tab0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL - col1 * - col1 * col1 AS col1 FROM tab2 GROUP BY col1
----
205379
226981
68921

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL 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 col1 - + col1 + col1 * - + col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT - col0 * - col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + - col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0 HAVING NOT + - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 * + col1 AS col2, col1 + col0 col2 FROM tab1 GROUP BY col0, col1
----
1936
126
3249
85
36
28

query I rowsort
SELECT - + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL + + col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col1 FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-4420
SELECT col0 DIV + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4420
SELECT col0 / + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col2, col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + col2 + + col2 col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
174
237
261

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL col1 FROM tab2 WHERE NOT NULL > NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col1 + + - col1 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

onlyif mysql # DIV for integer division: 
query I rowsort label-4428
SELECT col0 DIV - - col0 FROM tab1 cor0 GROUP BY col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4428
SELECT col0 / - - col0 FROM tab1 cor0 GROUP BY col0, col0
----
1
1
1

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1
----
0
81

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + col2 + - + col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col2 * + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col0, col2, col1
----
0
0
81

query I rowsort
SELECT + col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col0 + + col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - + col2 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT - col1 + col1, - col1 FROM tab2 WHERE NOT + col2 IS NOT NULL GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col0 + - col0 FROM tab2 cor0 GROUP BY col0, col0
----
0

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE NULL = NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + - col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-124
-26
-83

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col2 + + - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0 HAVING NOT NULL IS NOT NULL
----
-81
0
0

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col1, col1
----
15
91
92

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col2, col1, col0
----
22
28
82

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 + + col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 * - col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col2, col1
----
-81
0
0

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

query I rowsort
SELECT col1 * col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col2, 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 col1, col0, col2
----
22
28
82

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT + col0 IS NULL
----
45
71
8

query I rowsort
SELECT col1 + + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
133
150
76

onlyif mysql # DIV for integer division: 
query II rowsort label-4469
SELECT col1, - col1 * - col1 DIV + col1 AS col2 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

skipif mysql # not compatible
query II rowsort label-4469
SELECT col1, - col1 * - col1 / + col1 AS col2 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT + 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 DISTINCT col1 col1 FROM tab0 GROUP BY col1, col2
----
0
81

query II rowsort
SELECT - col2, - col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-24
-38
-38
-79
-79

query II rowsort
SELECT DISTINCT + col1 * + col1, + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
1936
44
3249
57
36
6

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 * - + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-6561
0

query I rowsort
SELECT - - col1 FROM tab0 cor0 GROUP BY col1
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-4483
SELECT DISTINCT col1 DIV + col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
42
60
62

skipif mysql # not compatible
query I rowsort label-4483
SELECT DISTINCT col1 / + col1 + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
42
60
62

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - - col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING - + AVG ( ALL + + col1 ) IS NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col0 * col1 * + col1 FROM tab0 GROUP BY col1, col0 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 WHERE NULL NOT BETWEEN + col0 AND NULL GROUP BY col1, col2
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 cor0 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 WHERE NOT col2 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT - - col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - + AVG ( + col1 ) * - col1 * + - col1 FROM tab0 AS cor0 WHERE col2 <= NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + + col0 + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4500
SELECT DISTINCT - - col1 DIV col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1

skipif mysql # not compatible
query I rowsort label-4500
SELECT DISTINCT - - col1 / col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1, col1, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col1, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0
----
-22
-28
-82

query II rowsort
SELECT - col2, col2 AS col2 FROM tab0 cor0 WHERE col0 IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 * + col2 AS col0 FROM tab2 GROUP BY col2 HAVING + col0 >= ( NULL )
----

query I rowsort
SELECT + col2 + - col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
0
0
0

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 * - + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + col0 + + + col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 WHERE col1 IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 WHERE NOT NULL > col1 GROUP BY col1
----

query I rowsort
SELECT DISTINCT col1 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - + col0 + - col0 FROM tab1 cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2, col0
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab1 GROUP BY col0 HAVING NOT - col0 <= NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 + + + col2 col2 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col0, col2, col1
----
0
0
81

query I rowsort
SELECT - col1 AS 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 DISTINCT col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT + col0 + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col2 * + col2 FROM tab1 GROUP BY col2, col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT + col1 - + col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
0

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2
----
-24
-38
-79

query II rowsort
SELECT DISTINCT - col2 AS col0, + col2 FROM tab2 cor0 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT ALL + col1 * - col1 FROM tab0 GROUP BY col1
----
-6561
0

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 + col2 col1 FROM tab1 GROUP BY col2, col2, col0 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 WHERE ( NULL ) NOT BETWEEN NULL AND NULL GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col2 FROM tab0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col0 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * + col2 AS col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col0 * - col0 FROM tab1 AS cor0 WHERE col0 IS NOT NULL GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - + col1 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 col0 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 WHERE NOT col1 * - col2 <> NULL GROUP BY col2
----

query I rowsort
SELECT + - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1
----
-22
-28
-82

query II rowsort
SELECT + col1, col1 FROM tab0 WHERE col1 IS NOT NULL GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0, col2
----
15
91
92

query II rowsort
SELECT DISTINCT + col1, - col1 + - col2 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NULL ) <= NULL
----

query I rowsort
SELECT - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NOT col1 IS NULL
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE ( NULL IS NULL ) GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT ( col0 ) = NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 WHERE NULL = NULL GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NOT ( NOT NULL < NULL )
----

query I rowsort
SELECT - col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 WHERE - col0 IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col1, col2 HAVING - + col2 >= NULL
----

query I rowsort
SELECT col1 * col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
-45
-71
-8

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 cor0 GROUP BY col1, col2
----
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-4576
SELECT DISTINCT - col2 DIV - - col2 AS col2 FROM tab2 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-4576
SELECT DISTINCT - col2 / - - col2 AS col2 FROM tab2 GROUP BY col2
----
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-4578
SELECT ALL + col0 DIV + - col0 FROM tab1 GROUP BY col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-4578
SELECT ALL + col0 / + - col0 FROM tab1 GROUP BY col1, col0
----
-1
-1
-1

query I rowsort
SELECT 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 ALL + col0 col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + col0 - AVG ( - + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 * + - col0 col1 FROM tab1 GROUP BY col1, col0
----
-484
-6724
-784

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - - col1 - - col0 IS NOT NULL
----
-15
-91
-92

query II rowsort
SELECT ALL - col0 AS col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
15
-91
91
-92
92

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col1 * col1 AS col2 FROM tab2 GROUP BY col1, col2
----
1681
3481
3721

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL BETWEEN + col1 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - col2 * - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT col0 + - col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 + col0 * col0 AS col2 FROM tab0 GROUP BY col0
----
1892
6972
702

query I rowsort
SELECT ALL col1 * col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col2 + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT AVG ( + col0 ) FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + col2 AS col0, - col2 * + col2 AS col2 FROM tab2 GROUP BY col2
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT col1 + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
162

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING AVG ( DISTINCT - col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 + + col2 FROM tab1 GROUP BY col2, col2
----
0

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
15
91
92

query I rowsort
SELECT + col1 * - + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-1936
-3249
-36

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT AVG ( ALL - col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING + - col2 <= NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 WHERE NOT col1 IS NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL - col2 AS col0, + col2 AS 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 DISTINCT + col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

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 + col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
-26
-43
-83

query II rowsort
SELECT + col1, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 col1, col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 WHERE ( NULL ) IS NULL GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 - - col2 FROM tab0 GROUP BY col1, col2
----
158
48
76

query I rowsort
SELECT - col0 * - col2 AS col2 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - - col1 AS col2 FROM tab2 WHERE NOT NULL <= - col1 GROUP BY col1
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query II rowsort
SELECT DISTINCT col2 AS col1, + 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 + col1 col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col2 * col2 AS col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL < NULL
----

query I rowsort
SELECT col2 + - col2 * - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
1968
38
79

query I rowsort
SELECT + col1 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col0 AS col2 FROM tab1 WHERE NOT - + col2 IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col0, col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 * + + col2 col0, col0 col0 FROM tab1 GROUP BY col2, col0
----
2025
28
5041
82
64
22

query I rowsort
SELECT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col1 * - col1 + + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL >= - col1
----

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col0
----
-58
-79
-87

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING - col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT col1 + - col1 FROM tab2 GROUP BY col1, col1
----
0

query I rowsort
SELECT col2 FROM tab0 GROUP BY col1, 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, col2
----
-24
-38
-79

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) = NULL GROUP BY col1, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT - col2 * - col2 FROM tab1 cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS 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 + + col2 col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + + col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query II rowsort
SELECT ALL col0 AS col2, col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab2 GROUP BY col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT - col0 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

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 col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query II rowsort
SELECT col1 AS col0, col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT col1 >= NULL GROUP BY col0, col0
----

query I rowsort
SELECT + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query II rowsort
SELECT ALL + - col2, - col2 * - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
3364
-79
6241
-87
7569

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT col1 * + col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT col1 + + col0 AS col0 FROM tab2 GROUP BY col0, col1, col1
----
133
150
76

query II rowsort
SELECT + col0 * col0 AS col2, col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
43
676
26
6889
83

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * + - col1 * - + col2 col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4682
SELECT DISTINCT col0 DIV + col0 AS col0 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-4682
SELECT DISTINCT col0 / + col0 AS col0 FROM tab0 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT + col0 * col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NULL IN ( - col1 + col0 )
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 * + col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab2 AS cor0 WHERE col0 >= NULL GROUP BY col0, col2, col0
----

query I rowsort
SELECT DISTINCT col1 * + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING - + col1 IS NULL
----

query I rowsort
SELECT ALL - col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0, col2, col2
----
15
91
92

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 WHERE NULL = NULL GROUP BY col1, col1
----

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 - col0 * col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT col2 * - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-3364
-6241
-7569

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT + AVG ( + col1 ) IS NULL
----
22
28
82

query I rowsort
SELECT ALL col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 + - col1 AS col1 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col0, col0
----
-22
-28
-82

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

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 WHERE NOT NULL = + col0 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 + + col0 col2 FROM tab0 GROUP BY col0, col0, col0
----
166
52
86

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-81
0
0

query I rowsort
SELECT + + col0 FROM tab2 cor0 GROUP BY col0, col0
----
15
91
92

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 - col1 AS col2 FROM tab1 cor0 GROUP BY col1, col0, col2
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col2, col1, col0 HAVING NOT - col2 IS NULL
----
22
28
82

query I rowsort
SELECT col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( NULL ) <= col2
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col2 * - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - col1 + + col0 AS col2 FROM tab0 GROUP BY col1, col0, col1 HAVING NOT - col0 <> ( NULL )
----

query I rowsort
SELECT - + col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING + col1 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab2 AS cor0 WHERE ( NULL ) > NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col1, col2, col2 HAVING + col1 IS NULL
----

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col0, col1 HAVING + col0 >= AVG ( DISTINCT + col0 ) * + col0
----

query I rowsort
SELECT - col0 * - col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query II rowsort
SELECT DISTINCT col1 AS col2, - col1 AS col1 FROM tab0 GROUP BY col0, col1
----
0
0
81
-81

query I rowsort
SELECT DISTINCT col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT + AVG ( ALL + col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 WHERE NOT ( NOT + col0 + + col1 >= NULL ) GROUP BY col1, col0, col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 col2, - col0 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col1, col2, col2
----
58
79
87

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + + col1 AS col2 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-4751
SELECT + col2 DIV - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-4751
SELECT + col2 / - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT - col2 * + + col2 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col2 col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL + col1 AS col2 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 col1 + col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
162

query I rowsort
SELECT ALL col0 * - + col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT - + AVG ( DISTINCT + + col0 ) IS NULL
----
44
57
6

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1 HAVING ( ( NULL ) < NULL )
----

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT col1 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 - + col0 col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

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 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
15
91
92

query II rowsort
SELECT DISTINCT col2, col0 * - - col0 AS col2 FROM tab2 GROUP BY col0, col2
----
58
8464
79
8281
87
225

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query II rowsort
SELECT ALL - col2, col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT + col2 * col2 AS col2 FROM tab0 GROUP BY col0, col2, col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NOT 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 NOT NULL
----
22
28
82

query I rowsort
SELECT ALL - col0 * + col0 * - col2 AS col1 FROM tab0 GROUP BY col2, col0
----
261782
44376
53404

query II rowsort
SELECT ALL col0, + col2 FROM tab0 GROUP BY col0, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) >= ( NULL )
----

query I rowsort
SELECT ALL - col2 - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col1, col2 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 * - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3364
-6241
-7569

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 + + col1 / + col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col1 * + col1 * - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
-185193
-216
-85184

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - - col2 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 FROM tab1 WHERE ( - col2 ) > NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col0, col1, col0
----
0
81

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NOT NULL > NULL )
----

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * - col0 / - col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) <> AVG ( DISTINCT col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col0 FROM tab1 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col0
----
41
59
61

query II rowsort
SELECT ALL col1 AS col1, col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col0, col2, col1 HAVING - col2 IS NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - - col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING - - col1 IS NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - AVG ( ALL + col1 ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT + col1 + col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1892
-30
-3192

query I rowsort
SELECT DISTINCT col0 * - col0 + col0 FROM tab1 GROUP BY col2, col0
----
-462
-6642
-756

query I rowsort
SELECT + + col1 * - col1 FROM tab2 cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col2 + - col2 FROM tab1 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 + + col1 IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2 HAVING + - col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT col1 * + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
110
1568
3526

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 * col2 + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1406
-552
-6162

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col1 * - col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
1936
3249
36

query I rowsort
SELECT + col2 AS col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IN ( - col0 ) GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col0, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT 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 DISTINCT + col1 * col1 col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT col2 * + col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 * col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
6561

query I rowsort
SELECT - col2 * - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
3364
6241
7569

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 - - + col0 col0 FROM tab0 GROUP BY col2, col0
----
105
121
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col2
----
26
43
83

query I rowsort
SELECT DISTINCT col1 + - col1 FROM tab2 GROUP BY col1 HAVING NOT ( NOT ( NOT ( NULL IS NOT NULL ) ) )
----
0

query I rowsort
SELECT + + 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 + - col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL > - + col0
----

query I rowsort
SELECT DISTINCT + 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 col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT + 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 DISTINCT col1 col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 * - + col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
185193
216
85184

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col1, col0, col2
----
26
43
83

query I rowsort
SELECT ALL - col0 + - col2 + + col2 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT col1 + - col1 FROM tab0 WHERE NULL >= ( + - col2 ) GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + col2 col2 FROM tab1 WHERE NOT col1 IN ( - col2 ) GROUP BY col2
----
142
16
90

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 * - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 cor0 WHERE NOT NULL > NULL GROUP BY col2, col2, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 GROUP BY col1, col0
----
-81
0

query II rowsort
SELECT DISTINCT col0 + col0 + col0 AS col2, - col0 FROM tab0 AS cor0 GROUP BY col0
----
129
-43
249
-83
78
-26

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col2 AS col1, col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) <> NULL
----

query I rowsort
SELECT ALL AVG ( DISTINCT - col0 ) FROM tab2 WHERE col1 > NULL GROUP BY col0
----

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 col1 FROM tab0 AS cor0 GROUP BY col0, col1, col2
----
24
38
79

query I rowsort
SELECT col2 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col2, col0
----
58
79
87

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 - col1 AS col1 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + col0 > NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT AVG ( ALL - col2 ) + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col2 * col1 AS col2 FROM tab1 GROUP BY col1, col2
----
2565
3124
48

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL = NULL
----

query I rowsort
SELECT - col1 FROM tab2 GROUP BY col2, col2, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0
----

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 + col0 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - col1 + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col0 col1, col0 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
-22
22
-28
28
-82
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NOT ( - col0 ) > ( NULL )
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col1 HAVING col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING col0 IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col1 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT + col2 + + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL <> 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 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT - + col2 FROM tab1 cor0 GROUP BY col2, col2, col0
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + AVG ( ALL col0 ) FROM tab1 GROUP BY col0, col2 HAVING NOT NULL > - col0
----

query I rowsort
SELECT DISTINCT + + col2 * - col2 * col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col0 * + col0 AS col2 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + + col0 AS col1 FROM tab2 WHERE NOT col2 IS NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL OR NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 WHERE NOT NULL IN ( col0 ) GROUP BY col0
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT - col1 + + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-29
16
38

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 WHERE NOT NULL BETWEEN NULL AND ( - col1 ) GROUP BY col0, col1
----

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 WHERE col0 IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2, col0, col0
----
45
71
8

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col1 * - col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2 HAVING NULL IS NULL
----

query II rowsort
SELECT col1, + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
44
57
57
6
6

query I rowsort
SELECT + - col2 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query II rowsort
SELECT ALL + col0, + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT col1 + + col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL <= - col2
----

query I rowsort
SELECT ALL + - col2 FROM tab2 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1, col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

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 col1 + col1 AS col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + col0 + + col0 FROM tab2 cor0 GROUP BY col0, col1
----
182
184
30

query I rowsort
SELECT DISTINCT + col2 / - col2 + + + col1 AS col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT + col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1
----
41
59
61

query II rowsort
SELECT DISTINCT col2 AS col0, - col2 AS col1 FROM tab0 GROUP BY col2, col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL - col2, + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
45
-71
71
-8
8

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col0 * col0 AS col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT + + col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0 HAVING AVG ( - col2 ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL >= ( NULL )
----

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col0 AS col0, col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NULL
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT col0 * - - col0 AS col0 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT - - col2 AS col1, col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
24
38
38
79
79

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 + + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
-58
-79
-87

query I rowsort
SELECT col0 * + + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT - col2 FROM tab0 WHERE NULL <= col0 GROUP BY col1, col2
----

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
45
71
8

query I rowsort
SELECT ALL + col1 - + + col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NULL NOT BETWEEN NULL AND - - AVG ( DISTINCT - col0 )
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col0, col1 HAVING - + col0 IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - - col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT AVG ( - col0 ) FROM tab2 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2, - col2 col1 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 - col0 col0 FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

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 + - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
-45
-71
-8

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col2, col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
45
71
71
8
8

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-26
-43
-83

query II rowsort
SELECT ALL - col0 AS col0, col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + col0 ) IS NOT NULL
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING col0 + - col0 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT + col2 * - col1 AS col1 FROM tab1 GROUP BY col2, col1
----
-2565
-3124
-48

query I rowsort
SELECT - - col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * + + col2 col0 FROM tab0 cor0 GROUP BY col0, col2, col2
----
1032
2054
3154

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT - col2 * col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
-2378
-4661
-5307

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING ( col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 * col1 + + col1 FROM tab2 AS cor0 GROUP BY col1
----
1722
3540
3782

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL > col2
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NULL >= NULL )
----

query I rowsort
SELECT col1 + + col0 AS col0 FROM tab1 GROUP BY col1, col1, col0
----
126
28
85

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT ALL 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 - col2 col1 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT + - col1 + + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-124
-26
-83

query I rowsort
SELECT ALL - col1 / col1 FROM tab1 GROUP BY col1 HAVING NOT NULL >= - col1
----

query I rowsort
SELECT ALL + col1 * + col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
6561

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col0, + col0 * + col0 FROM tab2 AS cor0 GROUP BY col0
----
15
225
91
8281
92
8464

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0, col0 HAVING col0 BETWEEN ( - col1 * - col0 ) AND NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

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 AS col0 FROM tab0 GROUP BY col0, col0, col1
----
26
43
83

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col1 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 HAVING NOT + col0 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT - col2 - - - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-153
-30
-73

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING + col0 * - col0 IS NOT NULL AND NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT col0 * + col0 FROM tab0 AS cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT - - col2 IS NOT NULL
----

query I rowsort
SELECT ALL + - AVG ( - + col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0, col0
----
58
79
87

query I rowsort
SELECT ALL + col2 * col2 FROM tab2 cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NULL ) <> ( NULL )
----

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col2 + col2 AS col0 FROM tab2 GROUP BY col2, col1
----
116
158
174

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + - col1 >= NULL
----

query I rowsort
SELECT ALL - + col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col1 * - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col2 + + col2, col2 FROM tab0 GROUP BY col2
----
158
79
48
24
76
38

query I rowsort
SELECT col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING NOT ( NULL ) >= NULL
----

query I rowsort
SELECT AVG ( - col2 ) FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 * - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 + - - col2 + + col2 * - - col2 - + col2 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT col0 - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
164
44
56

query I rowsort
SELECT + + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NOT + + col2 IS NULL
----
41
59
61

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT + col1 AS col2 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + col1 + col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
162

query I rowsort
SELECT ALL col0 - - col1 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NOT - col1 IS NULL
----
126
28
85

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

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 col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 * + col0 AS col0 FROM tab0 GROUP BY col0, col0, col2
----
1849
676
6889

query I rowsort
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL + col0 * + col0 AS col1 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT col1 * + - col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL <= ( NULL )
----

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 ALL + col2 * col1 + - + col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NOT - + col2 IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - AVG ( - col2 ) AS col1 FROM tab1 WHERE - - col2 IS NULL GROUP BY col2
----

query I rowsort
SELECT + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 + - col2 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col2 IS NOT NULL
----
-105
-38
-79

query I rowsort
SELECT - - col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + + col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 WHERE + col2 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
-81
0
0

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT - col1 + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

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 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT - col2 * col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

query I rowsort
SELECT + col0 * - col2 AS col1 FROM tab0 GROUP BY col2, col0
----
-1032
-2054
-3154

query I rowsort
SELECT col1 * col1 AS col2 FROM tab1 WHERE col2 * + col2 IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING + AVG ( - col1 ) IS NULL
----

query I rowsort
SELECT + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query II rowsort
SELECT DISTINCT + col0 AS col0, col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
26
43
43
83
83

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0, col2, col0, col0
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - + AVG ( DISTINCT col0 ) / + col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 WHERE - - col1 > NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL = NULL
----

query I rowsort
SELECT + col1 - - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab2 GROUP BY col1, col1
----
-118
-122
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab0 AS cor0 GROUP BY col0, col0, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col2 * - - col2 * - col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT + col2 / col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NOT 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 DISTINCT + col2 + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col0
----
-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
----
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 col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab0 WHERE ( col1 ) IS NOT NULL GROUP BY col1, col2, col2, col2
----
158
48
76

query I rowsort
SELECT - + col0 + col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col2 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 + - col2 FROM tab2 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT col2 - - col2 + + - col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT col2 * - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT col0 * + - col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query II rowsort
SELECT ALL col0 AS col2, col1 FROM tab0 GROUP BY col0, col1, col1 HAVING NULL IS NOT NULL OR NOT AVG ( + + col1 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT ( + col0 ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL - col2 + - + col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col2, col1, col0 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT col2 * - col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 AS col0 FROM tab2 GROUP BY col1, col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 * - + col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL >= + - col2 * + col0
----

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col1
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL IS NOT NULL )
----

query II rowsort
SELECT - - col0 AS col0, - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT + col1 * - col1 * - col1 AS col1 FROM tab2 GROUP BY col1
----
205379
226981
68921

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL 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
----
-24
-38
-79

query I rowsort
SELECT + col0 AS col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 + - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col0 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
1849
676
6889

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab2 cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query II rowsort
SELECT - col2, - col2 AS col1 FROM tab1 GROUP BY col2
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT ALL + col0 + - col0 AS col2 FROM tab1 WHERE NULL >= ( - col0 ) GROUP BY col0, col0, col1
----

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL <> col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT col1 * col0 FROM tab2 cor0 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT ALL col0 * col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
132
1596
3608

query II rowsort
SELECT DISTINCT + col2 AS col1, col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL - - col1 * col1 FROM tab2 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - + col1 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 col0, + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT NULL <> + col1
----

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 ALL + - col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 WHERE NULL = col2 GROUP BY col2 HAVING NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 - + col2 * - col1 col0 FROM tab0 GROUP BY col1, col2
----
1968
38
79

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - - col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col1 * + - col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL - col2 * col1 AS col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING NOT - col2 + - col2 IS NULL
----
-2565
-3124
-48

query I rowsort
SELECT ALL col2 * col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query II rowsort
SELECT + col0, - col0 + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
0
43
0
83
0

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col1, col0, col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
-44
-57
-6

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query II rowsort
SELECT DISTINCT - col2 AS col1, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-58
-92
-79
-91
-87
-15

onlyif mysql # DIV for integer division: 
query I rowsort label-5260
SELECT DISTINCT - col1 DIV + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-5260
SELECT DISTINCT - col1 / + + col1 FROM tab1 AS cor0 GROUP BY col1
----
-1

query I rowsort
SELECT ALL col1 * col1 AS col1 FROM tab2 GROUP BY col0, col1, col1
----
1681
3481
3721

query I rowsort
SELECT ALL + col0 + + col1 FROM tab2 GROUP BY col0, col1
----
133
150
76

query II rowsort
SELECT ALL col0, col0 * col0 FROM tab2 GROUP BY col0, col0
----
15
225
91
8281
92
8464

onlyif mysql # DIV for integer division: 
query I rowsort label-5264
SELECT + col2 DIV - - col2 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5264
SELECT + col2 / - - col2 FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col0 - + col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-166
-52
-86

query I rowsort
SELECT ALL - col1 + - col1 FROM tab1 GROUP BY col0, col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query II rowsort
SELECT + col2, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
58
79
79
87
87

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING NOT AVG ( - - col1 ) > NULL
----

query I rowsort
SELECT col1 AS col2 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 + col1 col2 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL + col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT col0 + + col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0, col0
----

query I rowsort
SELECT - + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT ALL col1 + - col2 FROM tab2 GROUP BY col1, col2
----
-17
-20
-26

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL - + col1 FROM tab1 cor0 GROUP BY col2, col1 HAVING ( NULL ) <> ( NULL )
----

query I rowsort
SELECT ALL - - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
79
87

query II rowsort
SELECT col1 * - col1, col1 AS col0 FROM tab2 GROUP BY col1, col1
----
-1681
41
-3481
59
-3721
61

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1 HAVING AVG ( DISTINCT col0 ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + + col2 * - col2 * - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
-357911
-512
-91125

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING - col0 <> NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT col1 * + col1 * col1 * + col1 AS col2 FROM tab2 GROUP BY col1, col1
----
12117361
13845841
2825761

query I rowsort
SELECT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT DISTINCT + + col2 AS col2, - col2 AS col1 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 col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col2, col2, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL col1 * - col1 AS col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query II rowsort
SELECT DISTINCT + col1, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) BETWEEN NULL AND col2 GROUP BY col2, col0 HAVING NOT ( NOT - col2 IS NOT NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND - col2 * col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 + col0 + - - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT AVG ( ALL + col1 ) IS NULL
----
246
66
84

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + AVG ( ALL + - col0 ) + col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NULL BETWEEN NULL AND - AVG ( + col1 )
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING - col0 <> NULL
----

query II rowsort
SELECT ALL + col1 AS col2, col1 AS col2 FROM tab0 WHERE NOT NULL < NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE ( NULL ) IN ( + - col0, - col1 + + col0 ) GROUP BY col2, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT AVG ( + - col1 ) FROM tab0 GROUP BY col0, col1 HAVING NOT col0 IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 - col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) NOT BETWEEN NULL AND + col1 * - col0
----

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 col2, col0 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 + - - col2 + - col2 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 + + col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT col2 * + col2 AS col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT - col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 AS col0 FROM tab0 AS cor0 WHERE NOT ( + col0 ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - - col0 + - - col0 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT ALL col1 FROM tab0 cor0 GROUP BY col2, col1, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col2 + + + col2 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2
----
158
79
48
24
76
38

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT - col1 AS col1 FROM tab1 cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col0, col2
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * + col1 col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT - col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 WHERE NOT NULL = NULL GROUP BY col2
----

query I rowsort
SELECT col1 FROM tab2 cor0 WHERE NULL IS NULL GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL col1 AS col2, - col1 AS col1 FROM tab1 GROUP BY col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT col1 FROM tab1 GROUP BY col0, col0, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT + - col1 AS col0, - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
-81
0
0

query I rowsort
SELECT DISTINCT - col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - AVG ( ALL + col2 ) FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND ( AVG ( DISTINCT - col2 ) )
----

query I rowsort
SELECT - col1 * + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT + col0 - - col0 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-462
-6642
-756

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + - col1 * + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
-1936
-3249
-36

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
0
0
0

query II rowsort
SELECT DISTINCT - col0, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-22
22
-28
28
-82
82

query I rowsort
SELECT - + col0 * + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT - + col2 * - col0 * - col0 FROM tab2 AS cor0 GROUP BY col2, col2, col0
----
-19575
-490912
-654199

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + + col0 col2 FROM tab2 AS cor0 WHERE col0 / + col2 > + + col0 / col1 GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 WHERE col2 IS NULL GROUP BY col0, col0
----

query II rowsort
SELECT ALL + col2 AS col2, + col2 FROM tab1 AS cor0 WHERE - col1 IS NOT NULL GROUP BY col2
----
45
45
71
71
8
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-5377
SELECT ALL - col1 DIV + col1 AS col2 FROM tab1 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-5377
SELECT ALL - col1 / + col1 AS col2 FROM tab1 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT ALL - col2 * + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT - - col1 AS col1 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <> + col0 GROUP BY col2, col2
----

query I rowsort
SELECT + col1 + - col0 FROM tab1 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT ( NULL ) > ( NULL )
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT - col0 + col2 AS col2 FROM tab1 GROUP BY col2, col0
----
-11
-14
17

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col2 HAVING NOT ( col2 ) <> NULL
----

query I rowsort
SELECT + - col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL <= ( NULL ) AND NOT + col1 <> - + col1
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL col0 + + AVG ( + col0 ) FROM tab2 GROUP BY col0, col0, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * + + col0 + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
240
8372
8556

query I rowsort
SELECT ALL + col2 FROM tab1 cor0 WHERE - col2 IS NOT NULL GROUP BY col0, col0, col2
----
45
71
8

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col2, col2
----
41
59
61

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
41
59
61

query I rowsort
SELECT - + col0 * + col0 * col0 + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
-3360
-753480
-778596

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 ALL - - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-81
0

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab1 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
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col1 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 + col2 FROM tab0 cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
105
121
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

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 + col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

query II rowsort
SELECT DISTINCT col0, + col0 * + col0 FROM tab2 GROUP BY col0 HAVING NOT col0 IS NULL
----
15
225
91
8281
92
8464

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab1 cor0 GROUP BY col0, col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL = - col0
----

query I rowsort
SELECT + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT ALL - col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

query II rowsort
SELECT DISTINCT + + col2, col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
58
3364
79
6241
87
7569

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query II rowsort
SELECT - - col0 AS col0, + col0 * + col0 + col0 - + - col0 FROM tab1 AS cor0 GROUP BY col0
----
22
528
28
840
82
6888

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 AS cor0 WHERE NULL = NULL GROUP BY col1
----

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 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + + 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 - col2 + + - col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
-142
-16
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col0 + - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-164
-44
-56

query I rowsort
SELECT ALL - col2 - col2 AS col2 FROM tab1 AS cor0 WHERE NOT col1 NOT IN ( col0 ) GROUP BY col2
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2, col1, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + col0 * - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT - col1 FROM tab2 cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT + col0 * - - col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL = NULL
----

query II rowsort
SELECT DISTINCT - col2, + col2 AS col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 - - col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - + col2 + - + col2 FROM tab1 AS cor0 WHERE NOT NULL > ( NULL ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
-15
-91
-92

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 WHERE NOT NULL >= NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT col0 + + col0 + col0 * col0 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0 HAVING NOT - - col0 BETWEEN NULL AND NULL
----

query II rowsort
SELECT ALL + col0 AS col2, col0 - - col0 AS col1 FROM tab2 GROUP BY col1, col0
----
15
30
91
182
92
184

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT DISTINCT + - col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT DISTINCT col0 + + + col0 AS col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - col2 + - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col1 + + + col1 AND + + col0
----

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab0 GROUP BY col1, col0, col1
----
0
6561

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query II rowsort
SELECT - col2, + col0 AS col2 FROM tab1 GROUP BY col0, col2
----
-45
28
-71
82
-8
22

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col2 + - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT + + col0 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
3772
5369
915

query I rowsort
SELECT ALL col1 * col1 * + col2 FROM tab0 GROUP BY col2, col1
----
0
0
157464

query I rowsort
SELECT ALL col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + - col2 FROM tab0 WHERE NOT ( ( NULL ) IS NOT NULL ) GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query II rowsort
SELECT DISTINCT + col1, col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT AVG ( ALL - col0 ) AS col1 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col1 * + col1 * + - col1 + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
185136
210
85140

query I rowsort
SELECT ALL + col2 * col2 AS col0 FROM tab2 cor0 GROUP BY col1, col2
----
3364
6241
7569

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-81
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL BETWEEN - col1 AND NULL
----

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col1, col2, col0
----
-81
0
0

query I rowsort
SELECT col2 - + col2 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab0 GROUP BY col1, col1, col2
----
0
0
81

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT AVG ( DISTINCT - - col1 ) FROM tab1 GROUP BY col1 HAVING NOT - - col1 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT col1 * + - col1 AS col2 FROM tab0 GROUP BY col1
----
-6561
0

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 + col1 col0 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col1 + + + col0 FROM tab2 GROUP BY col0, col1
----
133
150
76

query I rowsort
SELECT DISTINCT col2 + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
-45
-71
-8

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 DISTINCT col2 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + AVG ( col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - AVG ( + + col0 ) * - col0 col1 FROM tab0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT col1 + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col2 HAVING NULL < col2
----

query II rowsort
SELECT ALL - col0, col2 FROM tab1 GROUP BY col2, col0
----
-22
8
-28
45
-82
71

query I rowsort
SELECT col0 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col2 * col2 FROM tab2 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 tab0 GROUP BY col2, col2, col0
----
26
43
83

query I rowsort
SELECT - col0 + col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-26
-83
38

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col2, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-5528
SELECT col1 DIV col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5528
SELECT col1 / col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
1
1
1

query I rowsort
SELECT ALL - - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query II rowsort
SELECT ALL col2, + col0 * - col0 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col0 FROM tab0 WHERE NOT - - col1 IS NULL GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col0 * col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

onlyif mysql # DIV for integer division: 
query I rowsort label-5535
SELECT DISTINCT - col2 DIV + col2 AS col2 FROM tab2 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-5535
SELECT DISTINCT - col2 / + col2 AS col2 FROM tab2 GROUP BY col2
----
-1

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - - col1 * + col1 AS col2 FROM tab1 cor0 WHERE NOT col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-5539
SELECT ALL - col2 DIV + col2 + + col2 FROM tab2 cor0 GROUP BY col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-5539
SELECT ALL - col2 / + col2 + + col2 FROM tab2 cor0 GROUP BY col2
----
57
78
86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col0 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col2, col0 HAVING ( NULL ) IS NULL
----
45
71
8

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col2 AS col2 FROM tab2 cor0 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 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT col2, col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
45
71
71
8
8

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN + col0 AND col0
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING AVG ( - col0 ) > NULL
----

query I rowsort
SELECT col1 + col1 AS col0 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT DISTINCT - col0 * - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL + col1 / + col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 WHERE NOT NULL >= NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT - col0 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab0 AS cor0 GROUP BY col0, col1, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col2 * + + col2 FROM tab2 GROUP BY col2 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, col0 HAVING NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT DISTINCT - col0 * - - col0 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - - col0 AS 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 DISTINCT col0 + + col1 col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
133
150
76

query I rowsort
SELECT ALL - col1 + + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
-46
32
51

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 WHERE NOT - col2 * - col0 >= NULL GROUP BY col1
----

query I rowsort
SELECT + col1 * + col1 + + col1 AS col0 FROM tab0 GROUP BY col1
----
0
6642

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL <= NULL
----

query II rowsort
SELECT + + col1, col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING col0 IS NOT NULL
----
0
26
0
83
81
43

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL - + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT col1 - + - col1 FROM tab1 GROUP BY col1, col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT + col0 * col0 * + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
3375
753571
778688

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab1 GROUP BY col1 HAVING ( NULL ) IS NULL
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-5583
SELECT col1 DIV col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5583
SELECT col1 / col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1
1
1

onlyif mysql # DIV for integer division: 
query I rowsort label-5584
SELECT ALL col2 DIV + col2 AS col0 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5584
SELECT ALL col2 / + col2 AS col0 FROM tab2 GROUP BY col2
----
1
1
1

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 - col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * + col1 col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + + col0 * + col0 * + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-10648
-21952
-551368

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL OR NOT NULL IS NULL
----

query I rowsort
SELECT col2 * - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL col1 * + col2 FROM tab1 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
22
28
82

query II rowsort
SELECT ALL col0, + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
22
28
28
82
82

query II rowsort
SELECT DISTINCT - col1, + col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
-41
41
-59
59
-61
61

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col1, col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col2 + + - col1 FROM tab0 GROUP BY col2, col1
----
-105
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + - col2 * col2 - + col2 col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

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 ALL col0 * + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT - col1 <> NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT col1 IS NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1 HAVING NOT - AVG ( - col1 ) IS NOT NULL
----

query I rowsort
SELECT + col1 * col2 * - + col2 FROM tab0 GROUP BY col2, col1
----
-46656
0
0

query I rowsort
SELECT col2 + + col1 AS col1 FROM tab0 GROUP BY col1, col2, col1
----
105
38
79

query I rowsort
SELECT ALL + - AVG ( + col1 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NULL NOT IN ( col1 )
----

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
0

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL = ( NULL )
----

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 DISTINCT col0 FROM tab1 GROUP BY col1, col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col0 * + col0 col0 FROM tab1 cor0 GROUP BY col0, col0
----
-484
-6724
-784

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0 HAVING - col0 IS NOT NULL
----
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 ALL col0 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT - col2 + - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL < - + col2
----

query I rowsort
SELECT ALL + col0 + col0 FROM tab0 cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col0 + - + col0 AS col0 FROM tab2 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT DISTINCT + col2 * + col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT col0 - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
105
121
67

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * - - col0 col1 FROM tab0 GROUP BY col1, col0, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

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 AS col0 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT ALL col0 * col0 AS col1 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab0 cor0 GROUP BY col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - - col2 IS NOT NULL
----

query I rowsort
SELECT - col1 + - col1 AS col0 FROM tab0 GROUP BY col1
----
-162
0

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL AND NOT ( NOT ( NULL ) IS NOT NULL )
----

query I rowsort
SELECT ALL + col0 / - col2 FROM tab0 GROUP BY col2, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col2 + col1 AS col0 FROM tab0 WHERE ( col2 ) IS NOT NULL GROUP BY col1, col2 HAVING NOT - col1 IS NULL
----
-38
-79
57

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0, col2
----
26
43
83

query II rowsort
SELECT col0, col0 AS col0 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 WHERE + col0 - - - col1 IS NULL GROUP BY col1
----

query II rowsort
SELECT col1, + col1 AS col0 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, 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 DISTINCT - col1 + + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT - col2 + + col1 AS col1 FROM tab1 GROUP BY col1, col1, col2
----
-2
-27
12

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 NOT BETWEEN NULL AND + col0
----

query I rowsort
SELECT ALL + col1 * col1 * - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
185193
216
85184

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col2, col2, col2
----
-24
-38
-79

query I rowsort
SELECT - col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 WHERE ( + col1 ) <> col2 + - + col2 * + col0 GROUP BY col2, col0
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + - col2 * col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 WHERE NOT ( col1 ) IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 GROUP BY col1, col1 HAVING NOT ( - col1 ) IS NULL
----
-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 col1 >= NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2 HAVING - - col2 IS NULL
----

query I rowsort
SELECT + col0 * + col0 AS col1 FROM tab2 cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + col2 - col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-57
38
79

query I rowsort
SELECT - col2 + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-116
-158
-174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 * - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col0 * - col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT col1 * col0 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

query I rowsort
SELECT DISTINCT - col2 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-72
12
34

onlyif mysql # DIV for integer division: 
query I rowsort label-5676
SELECT + col2 DIV col2 AS col1 FROM tab2 GROUP BY col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-5676
SELECT + col2 / col2 AS col1 FROM tab2 GROUP BY col2, col2
----
1
1
1

query I rowsort
SELECT DISTINCT - col0 FROM tab0 cor0 GROUP BY col0, col1, col1
----
-26
-43
-83

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL col1 FROM tab2 WHERE NOT NULL = NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col1, col0, col2
----
15
91
92

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

query II rowsort
SELECT col1 + + col1, + col1 AS col1 FROM tab1 GROUP BY col1
----
114
57
12
6
88
44

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + col0 * + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT 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 - col0 / - col1 + - col1 col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN + col2 AND NULL
----

query I rowsort
SELECT + col0 * col0 AS col2 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT col0 * - col0 FROM tab2 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT col2 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2 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 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col2 HAVING NOT + col1 IS NULL
----
-81
0
0

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

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 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col1 / col1 FROM tab2 GROUP BY col1, col1 HAVING NOT + AVG ( col0 ) IS NOT NULL
----

query II rowsort
SELECT + col0 AS col2, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT col1 * col1 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - - AVG ( - col2 ) + + col2 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 col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT col2 + + col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col2 - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT - col0 - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-164
-44
-56

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col2, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0, col2, col1
----
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 - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 * + col2 IS NOT NULL
----

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 * - - col2 FROM tab0 GROUP BY col2
----
1444
576
6241

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 DISTINCT + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0, col0
----
26
43
83

query II rowsort
SELECT - 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 col2 col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IN ( - - col0 )
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab1 cor0 GROUP BY col0, col1
----
22
28
82

onlyif mysql # DIV for integer division: 
query I rowsort label-5734
SELECT ALL - col0 * + col0 DIV col0 AS col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

skipif mysql # not compatible
query I rowsort label-5734
SELECT ALL - col0 * + col0 / col0 AS col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col2 + col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL - - col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-2025
-5041
-64

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 tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - - col0 + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
0

query I rowsort
SELECT + + col1 + col1 * - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1640
-3422
-3660

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= - col2
----

query II rowsort
SELECT ALL + - col1, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
-81
0
0

query II rowsort
SELECT DISTINCT col1, col1 AS col0 FROM tab1 GROUP BY col0, col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT ALL - - col1 * - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL - 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 col0 - col2 col0 FROM tab2 cor0 GROUP BY col2, col0
----
-72
12
34

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT col0 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col0, col0 HAVING NULL IS NULL
----

query I rowsort
SELECT - 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, col1
----
26
43
83

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND + col0
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT + col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT - - col2 + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
158
48
76

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col1, col2
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col0 - + col0 col2, + col0 * - + col0 FROM tab2 AS cor0 GROUP BY col0
----
-182
-8281
-184
-8464
-30
-225

query I rowsort
SELECT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col2, col0 HAVING - - col0 IS NOT NULL
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT - + col0 FROM tab0 cor0 GROUP BY col0, col2, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col2 + + + col0 FROM tab0 GROUP BY col0, col2
----
105
121
67

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0, col2, col2
----
-15
-91
-92

query I rowsort
SELECT ALL col2 + col2 + - + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col1 + + - col1 - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - col2 - - + col0 FROM tab0 GROUP BY col0, col2
----
-53
19
45

query III rowsort
SELECT ALL col2 AS col1, - AVG ( - col2 ) AS col1, - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
9 values hashing to 783727379615b8f9ae967fb1ef978f27

query I rowsort
SELECT - col0 + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS 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 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + + col0 * - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col1 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL <= ( + col2 )
----

query I rowsort
SELECT + col2 - col2 FROM tab2 GROUP BY col2, col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * + col0 col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
1305
5336
7189

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NULL = NULL
----

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 + col2 FROM tab1 GROUP BY col2, col2 HAVING ( NOT NULL IS NOT NULL )
----
45
71
8

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL - col0 FROM tab2 cor0 GROUP BY col2, col0, col2, col1
----
-15
-91
-92

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL BETWEEN col2 AND + col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL col0 / col0 AS col0 FROM tab0 WHERE NOT ( NOT NULL <= ( - col2 ) ) GROUP BY col0
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + AVG ( ALL col0 ) FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 WHERE ( NULL ) IS NULL GROUP BY col0, col1 HAVING ( - col1 ) <> col1
----
81

query I rowsort
SELECT DISTINCT col0 * col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
3483

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2, col2
----
-58
-79
-87

query II rowsort
SELECT ALL col1 AS col1, - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING ( col2 IS NULL )
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT + col1 * - col1 FROM tab0 cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT ALL col2 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
24
38
79

query I rowsort
SELECT ALL col0 * - + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col1 * + col0 AS col2 FROM tab1 GROUP BY col2, col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col1, 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 col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

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 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + col2 col1 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT col1 AS col2 FROM tab0 WHERE NULL <= NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 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 + col2 col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query II rowsort
SELECT ALL col2, col0 AS col0 FROM tab1 GROUP BY col2, col0
----
45
28
71
82
8
22

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 DISTINCT + - col2 col2 FROM tab1 AS cor0 WHERE NULL < + col0 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT ( col1 ) = + col0
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT - col2 * col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT + AVG ( ALL - col2 ) * + col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col0, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-5841
SELECT + col1 DIV - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

skipif mysql # not compatible
query I rowsort label-5841
SELECT + col1 / - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-2
0
0

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col0 HAVING + + col2 IS NULL
----

query I rowsort
SELECT DISTINCT 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 col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - col1 / col1 AS col1 FROM tab2 AS cor0 WHERE + col0 >= NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT 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 ALL - col1 col1 FROM tab2 cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT + - col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 + + + col2 FROM tab1 GROUP BY col2
----
142
16
90

query I rowsort
SELECT col0 FROM tab1 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col1 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-58
-79
-87

query I rowsort
SELECT + + col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1, col1 col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

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 NULL
----

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 NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND - AVG ( - col0 )
----

query I rowsort
SELECT ALL - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab0 cor0 GROUP BY col0, col2, col1
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 WHERE NOT ( col2 * - col1 ) IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 FROM tab2 WHERE ( NULL ) < NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 WHERE NULL = NULL GROUP BY col0, col2
----

query II rowsort
SELECT + + col0 AS col0, col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0 HAVING NULL < + col0 * col2 * col1
----

query II rowsort
SELECT - col0, col0 AS col2 FROM tab1 GROUP BY col0, col0
----
-22
22
-28
28
-82
82

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 col1 * - - col1 * + - AVG ( + col1 ) FROM tab0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 GROUP BY col2 HAVING NOT - + col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0, col0 col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
15
91
91
92
92

onlyif mysql # DIV for integer division: 
query I rowsort label-5882
SELECT DISTINCT - col0 DIV + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
-1
-2
0

skipif mysql # not compatible
query I rowsort label-5882
SELECT DISTINCT - col0 / + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
-1
-2
0

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab2 AS cor0 WHERE NOT - col0 * col0 * + col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT + + col2 * col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col0 + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
164
44
56

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT - col2 * - + col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
-357911
-512
-91125

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2 col1, - col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-24
-38
-38
-79
-79

query I rowsort
SELECT DISTINCT + col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col2 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col1, col2, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, 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 col2
----
45
71
8

query I rowsort
SELECT - - col0 AS col0 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col0 + + - col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
44
57
6

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 col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
-81
0
0

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT ( NULL ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING + + col2 IS NULL
----

query I rowsort
SELECT DISTINCT + col1 + - - col0 * col1 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
138
1653
3652

query I rowsort
SELECT + col2 AS col1 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col2 - - col2 FROM tab2 GROUP BY col2, col1
----
116
158
174

query I rowsort
SELECT - - col1 AS col1 FROM tab2 WHERE NULL < - col2 GROUP BY col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT AVG ( col0 ) AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + col0 - - - col1 AS col1 FROM tab2 GROUP BY col0, col1
----
-46
32
51

query I rowsort
SELECT DISTINCT - col1 + - + col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col2 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL col2 * + - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL - col0 + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT + + col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT + col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT ( ( NULL <= NULL ) ) OR NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT + + col2 * col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0 HAVING - col2 IS NOT NULL
----
3364
6241
7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - col2 col0 FROM tab2 WHERE NOT + col0 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT - col0 - - + col0 AS col1 FROM tab2 GROUP BY col0, col1
----
0

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE NOT NULL = - col0 GROUP BY col1
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 * + col2 col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT col0 - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT + col1 * + col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + - col1 + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL - + col1 / - col1 FROM tab0 WHERE NOT NULL < - - col0 GROUP BY col1, col0
----

query I rowsort
SELECT col1 + - - col1 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col0 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query II rowsort
SELECT - col1, col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-81
81
0
0

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-44
-57
-6

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING - - AVG ( + col0 ) IS NULL
----

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col2
----
-81
0

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + - col2 * - col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT col2 >= - AVG ( + col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT ALL + col2 * + col2 * + col2 AS col0 FROM tab0 GROUP BY col2
----
13824
493039
54872

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT col1 - col1 AS col1 FROM tab0 GROUP BY col0, col1
----
0
0
0

query I rowsort
SELECT col2 + - + col2 AS col0 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - + col2 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL < - col1
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + + col0 col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - 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 + col1 col2 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
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 ALL + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT - - col0 + + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
126
28
85

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col0, col2, col1
----
24
38
79

query II rowsort
SELECT - col0, + col0 FROM tab0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT + AVG ( - col0 ) FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL - + col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + + col1 - - - col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab0 GROUP BY col0 HAVING NULL > col0
----

query II rowsort
SELECT ALL col1 AS col2, + col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col0, col1, col2
----
-58
-79
-87

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col1 HAVING NOT - AVG ( col1 ) IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * - col1 col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, 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 HAVING NULL IS NULL
----
182
184
30

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0, col0
----
26
43
83

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + col2 < NULL
----

query I rowsort
SELECT - col0 + col0 FROM tab1 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT AVG ( + col0 ) AS col1 FROM tab0 WHERE NOT NULL <= NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - + col0 / col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 + col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col1 FROM tab1 WHERE NOT ( NULL ) >= ( + col2 ) GROUP BY col1, col1 HAVING NOT ( col1 ) NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT + col1 * col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT col0 FROM tab0 GROUP BY col1, col0 HAVING NULL = + + col1
----

query I rowsort
SELECT DISTINCT - col1 - col1 FROM tab1 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT col1 AS col2 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 * + - col1 + + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
6480

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING + col0 IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, col0 AS col1 FROM tab1 GROUP BY col0 HAVING ( + col0 NOT BETWEEN NULL AND NULL )
----

query I rowsort
SELECT + col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0, col1, col1
----
26
43
83

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 * col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab2 AS cor0 WHERE col2 + - col0 IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col0 * + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
1260
176
5822

query I rowsort
SELECT + - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
45
71
8

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT NULL NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT ALL + col1 + - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
79
87

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 - - col0 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 WHERE NULL > NULL GROUP BY col2
----

query I rowsort
SELECT ALL + - col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT + - col0 * col0 FROM tab1 WHERE col2 + col0 = NULL GROUP BY col0, col1, col2
----

query I rowsort
SELECT DISTINCT - col0 + + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT + col2 + - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2, col0
----

query I rowsort
SELECT + col2 + - col2 FROM tab0 cor0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL + - col0 + + col0 AS col0 FROM tab2 AS cor0 WHERE + col1 IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT + col0 * - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) BETWEEN NULL AND NULL GROUP BY col0 HAVING NULL >= NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NOT NULL
----
-81
0
0

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col1, col2, col1
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 WHERE NULL IS NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 WHERE NULL <> - col2 * - col0 GROUP BY col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL < col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-6051
SELECT + + col1 DIV - col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-6051
SELECT + + col1 / - col1 + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
43
5
56

query I rowsort
SELECT DISTINCT - col1 + col1 AS col2 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT col0 - - col0 + col0 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
273
276
45

query I rowsort
SELECT col0 AS col2 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL - + col1 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 WHERE NULL <> NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 * - + col0 AS col2 FROM tab2 GROUP BY col0, col1
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 cor0 WHERE ( NULL IS NULL ) GROUP BY col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT - col1 * + - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col0, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 - + col1 FROM tab2 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT + col1 * - + col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT AVG ( col2 ) FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT + col2 + col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col1, col0, col2
----
45
71
8

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-15
-91
-92

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - + col2 ) FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL AND NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col2, col2, col0
----
15
91
92

query I rowsort
SELECT + + col2 * - + col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + col2 col0, col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
48
-38
76
-79
158

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL <= - col1
----

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 - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT - + col2 AS col1 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 + - col1 FROM tab2 GROUP BY col0, col0, col2, col1
----
17
20
26

query I rowsort
SELECT ALL + col2 + - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
17
20
26

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT - col1 IS NULL
----
-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 ALL col2 * - + col2 AS col0 FROM tab0 WHERE NOT + col2 NOT BETWEEN - col1 * + - col1 + + col1 AND col2 GROUP BY col2, col2
----
-1444
-6241

query I rowsort
SELECT ALL + col2 * - col2 FROM tab1 GROUP BY col1, col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col2 * col2 - col2 FROM tab0 GROUP BY col2, col2, col1
----
1406
552
6162

query I rowsort
SELECT + col0 AS col0 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col2 * + col2 * col2 FROM tab0 cor0 GROUP BY col2
----
13824
493039
54872

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col0 * - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col0 FROM tab0 cor0 GROUP BY col2, col0, col1
----
26
43
83

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-6112
SELECT DISTINCT + + col2 DIV col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1

skipif mysql # not compatible
query I rowsort label-6112
SELECT DISTINCT + + col2 / col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
1

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col1, col0, col2
----
22
28
82

query II rowsort
SELECT col2 AS col2, + col2 AS col1 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0, col1 HAVING NULL = NULL
----

query I rowsort
SELECT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col1 HAVING col0 IS NOT NULL
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 + - col0 FROM tab2 GROUP BY col0, col2
----
-182
-184
-30

query I rowsort
SELECT + + col0 FROM tab2 cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - - col1 * - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col2 + + col2 FROM tab2 GROUP BY col0, col2
----
116
158
174

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col0 >= NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col2 HAVING + col1 / col2 >= NULL
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 + + col0 FROM tab2 GROUP BY col1, col0
----
182
184
30

query I rowsort
SELECT col0 * + col0 AS col2 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 / col1 + + - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE NOT NULL = ( col2 ) GROUP BY col1
----

query I rowsort
SELECT - 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 + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6147
SELECT col1 DIV - col1 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6147
SELECT col1 / - col1 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT ALL + - col2 FROM tab2 cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT - - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

onlyif mysql # DIV for integer division: 
query I rowsort label-6151
SELECT DISTINCT col0 DIV + + col0 AS col1 FROM tab1 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-6151
SELECT DISTINCT col0 / + + col0 AS col1 FROM tab1 GROUP BY col0
----
1

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col2 - col0 - + col2 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL + col2 * - col2 FROM tab2 cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

onlyif mysql # DIV for integer division: 
query I rowsort label-6160
SELECT - col2 DIV - col2 FROM tab2 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6160
SELECT - col2 / - col2 FROM tab2 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + AVG ( col1 ) col0 FROM tab1 WHERE NULL < NULL GROUP BY col1
----

query I rowsort
SELECT - + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col1, col2, col2
----
44
57
6

query I rowsort
SELECT ALL col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1
----

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 + col1 * + + col1 FROM tab2 GROUP BY col1, col2
----
1681
3481
3721

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL col0 + - + col0 FROM tab1 GROUP BY col0, col2, col1
----
0
0
0

query I rowsort
SELECT col2 FROM tab0 AS cor0 WHERE + col0 IS NOT NULL GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( NULL ) <> col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col2 * - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
2025
5041
64

query II rowsort
SELECT DISTINCT + + col1, col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81
81

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT col0 + - col2 FROM tab1 GROUP BY col2, col0 HAVING NULL = NULL
----

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 * + col1 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col1, col2
----
41
59
61

query I rowsort
SELECT - col0 AS col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6183
SELECT col0 DIV - - col0 AS col2 FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6183
SELECT col0 / - - col0 AS col2 FROM tab0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1
----
24
38
79

query I rowsort
SELECT DISTINCT col2 + col2 FROM tab2 cor0 GROUP BY col2
----
116
158
174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT ALL col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT DISTINCT + col1 * - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - - col2 + + - col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col1 * - col1 AS col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 - col2 + + col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT col2 * + - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query II rowsort
SELECT - col0, - col0 AS col1 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
-92
-92

query II rowsort
SELECT - col1 AS col0, + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
71
-57
45
-6
8

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 + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT + - col1 FROM tab0 cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col2, col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING AVG ( - + col0 ) < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6208
SELECT DISTINCT col0 DIV col0 AS col0 FROM tab0 GROUP BY col0
----
1

skipif mysql # not compatible
query I rowsort label-6208
SELECT DISTINCT col0 / col0 AS col0 FROM tab0 GROUP BY col0
----
1

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 GROUP BY col2, col1, col2, col2
----
45
71
8

query I rowsort
SELECT col1 AS col0 FROM tab2 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 ALL - col0 * col0 col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2 HAVING NULL >= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6213
SELECT ALL + col0 DIV col0 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6213
SELECT ALL + col0 / col0 FROM tab1 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col2, col0
----
41
59
61

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2, col2, col2
----
58
79
87

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0, col1, col0
----
22
28
82

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 WHERE NOT NULL <= NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 * + - col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2 HAVING NULL IS NULL
----
0
1944

query II rowsort
SELECT DISTINCT col1 AS col0, + col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 * AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 * + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
484
6724
784

query I rowsort
SELECT - - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 * + col2 FROM tab2 cor0 GROUP BY col0, col2
----
3364
6241
7569

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1, col0, col2
----
24
38
79

query I rowsort
SELECT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT col0 * + col1 AS col1 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT + + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
0

query I rowsort
SELECT col0 * + - col0 FROM tab1 GROUP BY col0, col2
----
-484
-6724
-784

query I rowsort
SELECT - col0 FROM tab1 AS cor0 WHERE NOT NULL <= ( NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 WHERE NOT NULL > NULL GROUP BY col2
----

query I rowsort
SELECT col2 + + - col1 AS col2 FROM tab2 cor0 GROUP BY col2, col1
----
17
20
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 + col2 + - col2 col2, + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT - col1 * + col1 * + - col1 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1, col1, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 WHERE NOT NULL <> NULL GROUP BY col2
----

query I rowsort
SELECT col0 * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col2 AS col1 FROM tab2 WHERE NOT col0 IS NULL GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col2 + - + col2 + - col2 - + + col2 + col2 * + + col2 FROM tab1 GROUP BY col2
----
1845
32
4757

query I rowsort
SELECT - + col2 FROM tab2 cor0 GROUP BY col2, col1
----
-58
-79
-87

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 col1 + col1 AS col1 FROM tab1 GROUP BY col1
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col0 AS col1, + col0 AS col1 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query II rowsort
SELECT DISTINCT + col0, - col0 FROM tab0 GROUP BY col0, col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + col2 * - + col2 + - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col2 FROM tab2 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 col1, + col2 FROM tab2 GROUP BY col1, col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT - col1 * + col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
-531441
0

query I rowsort
SELECT + col0 * - + col2 FROM tab2 GROUP BY col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL = ( col0 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query II rowsort
SELECT DISTINCT col0, + col0 FROM tab2 GROUP BY col0, col1
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col0, col1
----
0
81

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

onlyif mysql # DIV for integer division: 
query I rowsort label-6272
SELECT col2 DIV - col2 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6272
SELECT col2 / - col2 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

onlyif mysql # DIV for integer division: 
query I rowsort label-6273
SELECT col1 DIV col1 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

skipif mysql # not compatible
query I rowsort label-6273
SELECT col1 / col1 * + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT ( + - col0 ) IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 WHERE NOT - + col1 IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 + - - col1 + col1 FROM tab2 GROUP BY col1
----
123
177
183

query I rowsort
SELECT ALL + col1 * col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 + col1 col2 FROM tab1 GROUP BY col1
----
0

query I rowsort
SELECT ALL + col0 + - col0 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT + AVG ( DISTINCT col2 ) AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query II rowsort
SELECT ALL + col0 AS col1, - col0 AS col0 FROM tab2 GROUP BY col0, col2
----
15
-15
91
-91
92
-92

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT - - col2 * col2 FROM tab1 cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( + col2 )
----

query I rowsort
SELECT ALL + - col2 FROM tab2 cor0 GROUP BY 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 col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col2 AS col1 FROM tab0 AS cor0 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 - - - col1 + + - col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE - col2 = NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT - col0 AS col0, + col0 + - + col0 + + col0 col2, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
9 values hashing to 0b527db12eb8fdd5b9d58ecebd6857eb

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 - col1 col0 FROM tab1 GROUP BY col1 HAVING NOT ( - - col1 ) IS NOT NULL
----

query I rowsort
SELECT + - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING + AVG ( col1 ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 + col1 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6311
SELECT - col1 DIV col1 AS col0 FROM tab1 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6311
SELECT - col1 / col1 AS col0 FROM tab1 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab1 WHERE + col0 IS NOT NULL GROUP BY col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6315
SELECT + col0 - - col0 DIV - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
90
90

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-6315
SELECT + col0 - - col0 / - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
90
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - - col1 + + col1 FROM tab0 cor0 GROUP BY col0, col1
----
0
162

query II rowsort
SELECT ALL + col0, col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING 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 col2 FROM tab2 GROUP BY col2, col0 HAVING - col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT col2 * + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL <= NULL
----

query II rowsort
SELECT DISTINCT - col1, - col1 FROM tab2 GROUP BY col1, col1
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT col0 * + + col0 FROM tab0 WHERE - + col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col2, col0, col0
----
24
38
79

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col2, col1 HAVING NOT - col1 IS NOT NULL
----

query II rowsort
SELECT col2, col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
24
38
38
79
79

query I rowsort
SELECT + AVG ( + col2 ) - col1 FROM tab2 AS cor0 WHERE NOT NULL <= + col2 GROUP BY col1, col2, col2
----

query I rowsort
SELECT DISTINCT + - col0 FROM tab0 AS cor0 GROUP BY col0, col1, col0 HAVING - col0 IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col0 FROM tab2 cor0 WHERE + col0 > + - col1 * col1 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-6344
SELECT DISTINCT - col1 DIV - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
1

skipif mysql # not compatible
query I rowsort label-6344
SELECT DISTINCT - col1 / - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
1

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col2, col1
----
41
59
61

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 - + col2 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 col2, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT - col1 * + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col2 * col2 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - col2 * - col2 - col2 FROM tab1 cor0 GROUP BY col2
----
1980
4970
56

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - - col0 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
105
121
67

query I rowsort
SELECT + col2 - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL AVG ( + col1 ) col2 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
-41
-59
-61

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
26
43
83

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 * col2 FROM tab2 cor0 GROUP BY col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT ALL col0 * - - col0 FROM tab1 GROUP BY col0, col0
----
484
6724
784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 AS cor0 GROUP BY 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
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col0 * - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT - col2 + - - col2 AS col0 FROM tab1 GROUP BY col1, col2
----
0
0
0

query I rowsort
SELECT ALL col1 * + col1 AS col2 FROM tab2 AS cor0 WHERE col0 IS NOT NULL GROUP BY col1 HAVING NOT col1 IS NULL
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab2 GROUP BY col0 HAVING NOT NULL < ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6374
SELECT - - col0 DIV - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6374
SELECT - - col0 / - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
0

query I rowsort
SELECT + col2 * col2 FROM tab1 GROUP BY col1, col2, col0
----
2025
5041
64

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1, col0, col2
----
44
57
6

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
22
28
82

query II rowsort
SELECT DISTINCT col2 * - col2 AS col2, - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1
----
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
----
44
57
6

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT - + col0 AS col1 FROM tab2 WHERE + col1 = + col2 GROUP BY col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + col1 AS col0 FROM tab0 cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col1 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL <= NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 * + col0 FROM tab1 GROUP BY col0, col1
----
132
1596
3608

query I rowsort
SELECT DISTINCT col0 + - + col0 FROM tab1 GROUP BY col0, col0, col1
----
0

query I rowsort
SELECT - - col2 * - + col2 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * col0 col1 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT IN ( - col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab2 cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL > - + AVG ( col2 )
----

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 NOT NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( - + col0 ) < NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1, col1 HAVING - col1 * col2 IS NOT NULL
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col0 AS col1, - col0 AS col2 FROM tab0 GROUP BY col0
----
-26
-26
-43
-43
-83
-83

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT col1 + + col1 FROM tab2 GROUP BY col1, col1
----
118
122
82

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NOT NULL IS NOT NULL )
----
26
43
83

query I rowsort
SELECT ALL col2 FROM tab1 GROUP BY col2, col0 HAVING ( NULL ) IS NULL
----
45
71
8

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2, col0 HAVING - col2 NOT BETWEEN NULL AND - col2
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT col1 * - col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2, col0 HAVING NULL IS NULL
----
-6561
0
0

query I rowsort
SELECT ALL - - col0 * col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab0 cor0 WHERE NULL IS NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 cor0 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT + col1 + + - col1 FROM tab0 GROUP BY col1
----
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - - col0 - + col0 AS col2, - col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
0
-15
0
-91
0
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 + + + col2 AS col2 FROM tab1 GROUP BY col2, col0 HAVING NULL <= - + col0
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col2 HAVING NOT NULL >= - - col2
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT + col0 + - col0 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
0

query I rowsort
SELECT ALL col2 + - - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 GROUP BY col1, col2
----
44
57
6

query II rowsort
SELECT DISTINCT + col1 AS col2, col1 + col1 AS col0 FROM tab1 GROUP BY col1, col2
----
44
88
57
114
6
12

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col1, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query II rowsort
SELECT DISTINCT col2, col2 FROM tab2 cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - AVG ( DISTINCT + - col0 ) FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT col0 - + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
0

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT - col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT + col1 - + col1 FROM tab1 GROUP BY col1 HAVING NOT - col1 IS NULL
----
0

query I rowsort
SELECT - col2 + col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
0
0
0

query I rowsort
SELECT - - col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6455
SELECT - col2 DIV - col2 - - + col2 FROM tab0 AS cor0 GROUP BY col2
----
25
39
80

skipif mysql # not compatible
query I rowsort label-6455
SELECT - col2 / - col2 - - + col2 FROM tab0 AS cor0 GROUP BY col2
----
25
39
80

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col1 * + + col1 + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT - col0 + + col0 FROM tab2 GROUP BY col0, col0, col1 HAVING NOT + col1 <> NULL
----

query I rowsort
SELECT - 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 ALL col1 col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query II rowsort
SELECT ALL - col0, col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT col2 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col1 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0, col0, col1
----
44
57
6

query I rowsort
SELECT - col2 + - - col1 AS col0 FROM tab1 GROUP BY col2, col1 HAVING col2 IS NOT NULL
----
-2
-27
12

query I rowsort
SELECT col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( col2 ) IS NULL
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col1 * + col1 FROM tab0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab1 GROUP BY col1, col0, col0, col1
----
22
28
82

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT - col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-142
-16
-90

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 WHERE NOT col2 - + col2 IS NOT NULL GROUP BY col2, col1 HAVING col2 IS NOT NULL
----

query II rowsort
SELECT ALL - col2, col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT ALL col1 + - - col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-6489
SELECT ALL col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6489
SELECT ALL col0 / col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col0 + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
182
184
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 GROUP BY col2 HAVING ( NULL ) NOT IN ( col1 )
----

query II rowsort
SELECT col2, - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL col0 * + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + col1 * - col1 + col0 AS col0 FROM tab0 GROUP BY col1, col0
----
-6518
26
83

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( ( NULL ) IS NOT NULL )
----
0
81

query I rowsort
SELECT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT col2 + + col2 + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
135
213
24

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL > ( col2 )
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col1, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE NOT col0 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 GROUP BY col2, col0
----
-58
-79
-87

query II rowsort
SELECT ALL + col0 AS col0, - col0 FROM tab1 GROUP BY col0, col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT + col2 IS NULL
----
-58
-79
-87

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 * col1 FROM tab1 GROUP BY col1, col0
----
132
1596
3608

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING - AVG ( + col1 ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT col0 * - col0 FROM tab0 cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2 HAVING ( NULL IS NULL )
----
24
38
79

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
0
0
81

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT + + col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL - col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 + + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - + col1 * + col0 + col0 > NULL
----

query I rowsort
SELECT ALL col0 + col0 FROM tab2 GROUP BY col0, col2
----
182
184
30

query II rowsort
SELECT DISTINCT + col0 AS col1, col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT col2 * + + col1 * col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
137456
146205
288

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 WHERE NULL IS NULL GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT + + col2 * + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
0
81

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col2, col1 HAVING NULL < col2
----

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 * col0 AS col0 FROM tab0 GROUP BY col2, col0
----
1849
676
6889

query I rowsort
SELECT ALL + col1 * - col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT DISTINCT - - col2 + + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0, col0, col1
----
26
43
83

query II rowsort
SELECT ALL col1, - col1 AS col0 FROM tab2 GROUP BY col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT col2 + + col2 AS col1 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT DISTINCT col0 + + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col0 * - - col0 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1, col0 HAVING NULL NOT BETWEEN + col0 - col1 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + AVG ( - col2 ) AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT col1 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING + - col0 IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 WHERE NOT NULL > - col1 GROUP BY col0
----

query I rowsort
SELECT ALL - col0 + + - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL > NULL
----

query II rowsort
SELECT DISTINCT col1 AS col0, - col1 FROM tab2 AS cor0 GROUP BY col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT DISTINCT col2 * col2 - - + col2 FROM tab1 AS cor0 GROUP BY col2
----
2070
5112
72

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT + + col0 < ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6554
SELECT DISTINCT - col0 DIV - - col2 AS col1 FROM tab0 GROUP BY col0, col2
----
-1
-2
0

skipif mysql # not compatible
query I rowsort label-6554
SELECT DISTINCT - col0 / - - col2 AS col1 FROM tab0 GROUP BY col0, col2
----
-1
-2
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT - col0 AS col2 FROM tab1 WHERE NOT ( NOT NULL IS NULL ) GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL - col1 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT - col1 * + + col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0, col0
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 * + col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT col0 * col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT + - AVG ( ALL col1 ) IS NULL
----
1849
676
6889

query I rowsort
SELECT ALL + col1 * + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0, col0
----
26
43
83

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 + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 * - col2 * + col2 AS col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2
----
-13824
-493039
-54872

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 + col0 col1 FROM tab1 GROUP BY col0, col1
----
126
28
85

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2, col0, col2
----

query I rowsort
SELECT DISTINCT col1 * col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT col0 FROM tab1 WHERE NULL NOT IN ( - col2 * - col0 ) GROUP BY col0
----

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING ( NULL ) IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL - col2 FROM tab2 AS cor0 WHERE + col2 IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL OR ( col0 ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col1, col1, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 col0 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - 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 - col0 col2 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query II rowsort
SELECT DISTINCT + col1, col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT col1 * col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 cor0 GROUP BY col1, col2, col1
----
-58
-79
-87

query I rowsort
SELECT + AVG ( + col2 ) FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT ( NULL ) < ( NULL )
----

query I rowsort
SELECT + col2 * + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL col1 * - - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 - col1 AS col0 FROM tab0 GROUP BY col1, col2
----
-105
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + - col1 col2, col1 * col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
68921
-59
205379
-61
226981

query II rowsort
SELECT ALL col1 AS col1, col1 FROM tab0 GROUP BY col1, col1
----
0
0
81
81

query I rowsort
SELECT ALL col0 + + col0 * col0 AS col1 FROM tab2 GROUP BY col0, col2
----
240
8372
8556

query I rowsort
SELECT + col0 + col2 AS col0 FROM tab2 GROUP BY col2, col0
----
102
150
170

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col0 + col0 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 WHERE + col0 * - col0 IS NOT NULL GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 FROM tab0 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab2 GROUP BY col0 HAVING - col0 IS NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
-24
-38
-79

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col0, col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT - col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
-6561
0

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 + col0 col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - col2 + - col2 AS col0 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT col0 * + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT + col2 / + col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col1 * + col1 - - + col1 AS col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT NULL < - col1
----

query I rowsort
SELECT col2 * + - col1 * - + col1 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 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 col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 * col2 * + col2 + col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
-13781
-493013
-54789

query I rowsort
SELECT ALL - col2 * + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT + col2 = NULL
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col2, col1, col0 HAVING NOT NULL IS NOT NULL
----
41
59
61

query II rowsort
SELECT + col2 AS col1, col2 AS col1 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
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 WHERE NULL <> NULL GROUP BY col2
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col2 FROM tab0 GROUP BY col0
----
-26
-43
-83

onlyif mysql # DIV for integer division: 
query I rowsort label-6647
SELECT DISTINCT + col1 * col1 DIV - col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

skipif mysql # not compatible
query I rowsort label-6647
SELECT DISTINCT + col1 * col1 / - col1 FROM tab2 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col2 + + col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING + + col0 IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL col0 FROM tab1 cor0 WHERE ( col1 ) IS NOT NULL GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT ( + col1 ) <= col2
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col1 * col0 AS col2 FROM tab2 GROUP BY col1, col0
----
3772
5369
915

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col2
----
-81
0

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + col0 > col0
----
26
43
83

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col2 AS col0 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col0, col2, col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

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 col1 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT col0 - - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
166
52
86

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL - col1 * - col2 AS col0 FROM tab0 GROUP BY col2, col1, col1
----
0
0
1944

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2 HAVING NULL IS NOT NULL AND NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING col0 + + col2 IS NOT NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col0 + + col0 - col2 AS col2 FROM tab1 GROUP BY col0, col2
----
11
36
93

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col1 * col1 * - - col1 AS col2 FROM tab2 GROUP BY col1
----
205379
226981
68921

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL <> + col0 * + col0
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
41
59
61

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT col0 * col1 FROM tab0 GROUP BY col0, col1
----
0
0
3483

query I rowsort
SELECT ALL col0 + col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 AS col2 FROM tab2 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 ALL - col1 col2 FROM tab2 GROUP BY col0, col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col1 * col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
58
79
87

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 I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0, col2 HAVING NOT ( NULL ) >= NULL
----

query I rowsort
SELECT col1 * col0 AS col1 FROM tab0 GROUP BY col1, col0
----
0
0
3483

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT NULL >= NULL GROUP BY col2, col0
----

query II rowsort
SELECT - col2 AS col0, col2 AS col2 FROM tab2 GROUP BY col2
----
-58
58
-79
79
-87
87

query I rowsort
SELECT DISTINCT - + col2 - col2 FROM tab2 AS cor0 WHERE - col2 IS NULL GROUP BY col2
----

query II rowsort
SELECT col0, + col0 + - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
0
43
0
83
0

query I rowsort
SELECT + col1 AS col0 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL BETWEEN - col1 AND NULL
----

query I rowsort
SELECT DISTINCT - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - AVG ( - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT 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 - col2 col2 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + - col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT + + col0 + - col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( - + col1 ) 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 - col0 FROM tab2 GROUP BY col1, col0 HAVING NOT + - col0 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) BETWEEN col1 AND col1 GROUP BY col0, col0
----

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 cor0 GROUP BY col0, col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab0 AS cor0 WHERE NOT col2 IS NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 + - col2 AS col0 FROM tab2 GROUP BY col1, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 * - col2 + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col0
----
24
38
79

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING col1 IS NOT NULL
----
44
57
6

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2, col0
----
45
71
8

query I rowsort
SELECT + col0 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

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 * + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-1849
-676
-6889

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 AS col0 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 - col0 * col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
-484
-6724
-784

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 - + col2 AS col0 FROM tab0 GROUP BY col2
----
0

query I rowsort
SELECT + + col1 AS col1 FROM tab2 AS cor0 WHERE ( NOT NULL >= NULL ) GROUP BY col1
----

query I rowsort
SELECT DISTINCT col0 * - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS 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 col1 col1 FROM tab0 GROUP BY col0, col0, col1
----
0
0
81

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT + col1 <> NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col2, col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col0, col0
----
26
43
83

query I rowsort
SELECT ALL col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-81
0

query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 GROUP BY col2, col0 HAVING ( col2 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 - - col0 FROM tab1 GROUP BY col0, col2, col0
----
164
44
56

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col2, col0
----
22
28
82

query I rowsort
SELECT col1 + col1 FROM tab1 GROUP BY col1, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT - col0 + - col0 FROM tab2 GROUP BY col0
----
-182
-184
-30

onlyif mysql # DIV for integer division: 
query I rowsort label-6771
SELECT + col1 * - col1 + col1 DIV + col1 FROM tab1 GROUP BY col1
----
-1935
-3248
-35

skipif mysql # not compatible
query I rowsort label-6771
SELECT + col1 * - col1 + col1 / + col1 FROM tab1 GROUP BY col1
----
-1935
-3248
-35

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab1 AS cor0 WHERE NULL NOT IN ( col0 ) GROUP BY col1
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( + col1 ) IS NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col0 HAVING NULL = col0
----

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab0 AS cor0 WHERE NOT - col2 * col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 WHERE ( NULL ) NOT BETWEEN ( NULL ) AND ( col2 ) GROUP BY col2
----

query I rowsort
SELECT ALL - + col0 + + + col0 FROM tab1 cor0 WHERE ( NULL ) <> - col0 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * col0 col2 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * - col1 AS col1 FROM tab1 GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT + col2 * + + col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col2 FROM tab2 AS cor0 WHERE NULL = col1 GROUP BY col1, col1
----

query I rowsort
SELECT + col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2, col0, col1, col2
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-6792
SELECT ALL col1 DIV + - col1 FROM tab2 GROUP BY col0, col1, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6792
SELECT ALL col1 / + - col1 FROM tab2 GROUP BY col0, col1, col0
----
-1
-1
-1

query I rowsort
SELECT col2 FROM tab2 WHERE NULL > NULL GROUP BY col2, col2
----

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 IS NULL
----
15
91
92

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query II rowsort
SELECT ALL + col0 AS col1, col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col1 + col1 col2 FROM tab0 cor0 GROUP BY col1
----
0
162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < + + col2
----

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2, col1, col2, col2 HAVING NOT - col1 IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + col0 col1 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col2, col0
----
41
59
61

query I rowsort
SELECT + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT - col0 + + col0 AS col1 FROM tab1 GROUP BY col0, col0, col0
----
0

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT - + 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 - col0 * - col0 col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 + + col0 AS col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT ALL AVG ( + col2 ) + + col2 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
-162
0

query II rowsort
SELECT DISTINCT + col1 AS col1, - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * - col2 col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + 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 - col1 col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

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 DISTINCT + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
24
38
79

query II rowsort
SELECT - col1, - col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL col1 AS col1 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 - + col1 FROM tab1 WHERE NOT col1 NOT BETWEEN NULL AND - col0 GROUP BY col1
----

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 DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL BETWEEN NULL AND + col2 / col1
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 * - col2 + col2 col0 FROM tab0 GROUP BY col2
----
1482
600
6320

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

query I rowsort
SELECT - col0 + - col0 AS col2 FROM tab2 GROUP BY col0
----
-182
-184
-30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0, - col0 col1 FROM tab2 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT - col1 AS col1 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 WHERE NULL = - col1 GROUP BY col1
----

query I rowsort
SELECT - + 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 col2 col0 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT col0 * - - col0 FROM tab1 GROUP BY col0, col2
----
484
6724
784

query I rowsort
SELECT DISTINCT col1 * - col0 AS col2 FROM tab0 GROUP BY col1, col0
----
-3483
0

query I rowsort
SELECT DISTINCT + col0 - - col0 AS col2 FROM tab2 GROUP BY col0
----
182
184
30

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + AVG ( + col1 ) AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL <> col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6844
SELECT - col0 DIV + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6844
SELECT - col0 / + col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL - col2 + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col2 * col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - col1 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

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 DISTINCT col2 AS col0 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

query II rowsort
SELECT DISTINCT col1 AS col2, - col2 FROM tab1 GROUP BY col1, col2
----
44
-71
57
-45
6
-8

query I rowsort
SELECT ALL - col0 + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL AVG ( + col0 ) AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) > NULL
----

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 DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
81

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL NOT BETWEEN NULL AND + AVG ( DISTINCT col0 )
----

query I rowsort
SELECT col1 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 col1 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 + - col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-133
-150
-76

query I rowsort
SELECT DISTINCT col2 FROM tab0 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
24
38
79

query I rowsort
SELECT col1 + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
114
12
88

query I rowsort
SELECT ALL + - col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT + - col1 - col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT - col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NOT - col2 * - col2 IS NULL
----
-81
0
0

query I rowsort
SELECT ALL - - col1 FROM tab1 cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT col0 + + col0 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NULL
----
166
52
86

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + + col2 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING ( NOT NULL >= NULL )
----

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT - col1 AS col2 FROM tab1 cor0 WHERE NOT NULL <= NULL GROUP BY col0, col1
----

query I rowsort
SELECT - - col2 AS col1 FROM tab1 AS cor0 WHERE col0 / col0 IS NULL GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 * + + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT col0 + - - col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT - col1 * col1 FROM tab2 AS cor0 WHERE + col2 / + - col1 IS NULL GROUP BY col0, col1 HAVING + AVG ( ALL - col1 ) IN ( + AVG ( - - col0 ) )
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT AVG ( ALL + col0 ) <> NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

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 DISTINCT + col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + + col0 col0 FROM tab1 GROUP BY col2, col0
----
164
44
56

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL <> ( - col1 - col0 )
----

query I rowsort
SELECT ALL + col1 + + col1 AS col0 FROM tab1 GROUP BY col0, col1
----
114
12
88

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - AVG ( ALL - col0 ) FROM tab2 AS cor0 GROUP BY col0 HAVING NULL >= + col0
----

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE ( NULL ) BETWEEN NULL AND - col2 GROUP BY col2, col1
----

query I rowsort
SELECT ALL col2 * + col2 AS col1 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT col1 * + col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2, col0 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 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL <> NULL
----

query II rowsort
SELECT DISTINCT + col0, col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
8
28
45
82
71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + - col2 col0 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL - AVG ( DISTINCT + col1 ) FROM tab0 WHERE - + col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT - + col0 FROM tab1 WHERE NOT ( NOT + col0 IS NOT NULL ) GROUP BY col2, col0
----
-22
-28
-82

query II rowsort
SELECT - col1, col1 FROM tab0 cor0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT ALL + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

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 - col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2, col2
----
-58
-79
-87

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 tab2 AS cor0 WHERE NOT col1 >= ( col0 ) GROUP BY col2
----
-58
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT - col2 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( + col1 ) IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col0
----
0
0
81

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 + col2 * + + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
1305
5336
7189

query I rowsort
SELECT + col2 + + + col2 FROM tab2 GROUP BY col2, col2
----
116
158
174

query I rowsort
SELECT col0 + - col0 AS col2 FROM tab2 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT col1 AS col1 FROM tab1 GROUP BY col2, col1, col0 HAVING ( + col2 ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + col0 * - col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col1 - col1 FROM tab1 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT col0 AS col0 FROM tab1 WHERE col2 IS NULL GROUP BY col0, col1 HAVING NOT + col0 + + AVG ( DISTINCT + col0 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query II rowsort
SELECT DISTINCT - col0 AS col0, col2 AS col0 FROM tab1 GROUP BY col2, col0
----
-22
8
-28
45
-82
71

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL AND NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 AS col1, + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
44
57
57
6
6

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT - col1 * - col1 AS col1 FROM tab1 GROUP BY col1
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6934
SELECT DISTINCT + col0 DIV - col1 - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-45
-57
-9

skipif mysql # not compatible
query I rowsort label-6934
SELECT DISTINCT + col0 / - col1 - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-45
-57
-9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 GROUP BY col2, col1, col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-6936
SELECT + col2 DIV col1 FROM tab2 GROUP BY col1, col2, col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-6936
SELECT + col2 / col1 FROM tab2 GROUP BY col1, col2, col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL + - AVG ( ALL + col2 ) FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL < 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 I rowsort
SELECT + + col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-6942
SELECT ALL - col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-6942
SELECT ALL - col0 / col0 FROM tab0 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col2, col1
----
45
71
8

query II rowsort
SELECT DISTINCT col0 AS col2, - col0 FROM tab1 GROUP BY col0
----
22
-22
28
-28
82
-82

query I rowsort
SELECT + col2 * - col0 AS col2 FROM tab0 GROUP BY col0, col2
----
-1032
-2054
-3154

query I rowsort
SELECT DISTINCT - col2 * - - col2 AS col1 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 * - - col1 col0 FROM tab0 GROUP BY col1 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 col0, col1
----
26
43
83

query I rowsort
SELECT ALL col0 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 + + col0 AS col1 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query II rowsort
SELECT ALL + + col0 AS col1, - col0 + col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL - col2 * + col2 * col2 * + + col2 AS col1 FROM tab2 GROUP BY col2 HAVING ( NULL ) <> NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 cor0 GROUP BY col1 HAVING + col1 IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING + - col0 IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL + - col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING - col0 <= NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT + col1 * + col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1980
3306
42

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT + col1 AS col0 FROM tab1 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 DISTINCT - col2 col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT + - col1 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - - col1 AS col0 FROM tab0 cor0 GROUP BY col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT col0 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 / - AVG ( ALL + col0 ) FROM tab2 cor0 GROUP BY col2, col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1, col2
----
44
57
6

query I rowsort
SELECT - - col2 + - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab2 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 <= NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT - col1 IS NOT 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 - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( ( ( NOT NULL BETWEEN NULL AND NULL ) ) )
----

query I rowsort
SELECT + col2 * col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL = - col0
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab2 GROUP BY col2, col2, col1
----
116
158
174

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NULL <= - col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 AS col0 FROM tab0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col2, col1
----
45
71
8

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 tab1 AS cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING + col0 IS NOT NULL
----
15
91
92

query I rowsort
SELECT col2 * - col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( col1 )
----

query I rowsort
SELECT ALL - col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT ALL - col0 * col1 FROM tab2 GROUP BY col1, col0, col1
----
-3772
-5369
-915

query I rowsort
SELECT ALL + col2 + - - col2 FROM tab1 GROUP BY col2
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab1 GROUP BY col0 HAVING ( NULL IS NULL )
----
22
28
82

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab2 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 + - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING ( col1 >= NULL )
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

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 col1 FROM tab0 GROUP BY col1 HAVING NOT NULL <= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <= col2 * col2
----

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-7022
SELECT - col0 DIV - - col0 FROM tab0 cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7022
SELECT - col0 / - - col0 FROM tab0 cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + col1 * col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT col0 + - col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
-38
26
83

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
26
43
83

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT col0 * + col1 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2
----
-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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NULL ) NOT BETWEEN NULL AND ( col2 )
----

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT + col0 AS col0 FROM tab1 cor0 GROUP BY 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 tab1 GROUP BY col2, col0 HAVING - col1 NOT BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL = NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7037
SELECT + col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7037
SELECT + col0 / col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-44
-57
-6

query II rowsort
SELECT ALL col1, col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
6561

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 + - col0 col0 FROM tab2 GROUP BY col0, col1, col0
----
0
0
0

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 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query II rowsort
SELECT col2, - col2 FROM tab0 GROUP BY col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN + + col2 AND NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7048
SELECT ALL col2 * col2 DIV + col1 + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
24
26
37

skipif mysql # not compatible
query I rowsort label-7048
SELECT ALL col2 * col2 / + col1 + - col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
24
26
37

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * col2 col2 FROM tab1 GROUP BY col0, col2 HAVING col2 IS NOT NULL
----
1260
176
5822

query I rowsort
SELECT DISTINCT col2 + + col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + + col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 + + col0 col2 FROM tab1 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( NULL ) AND col0
----

query I rowsort
SELECT DISTINCT - col1 * - - AVG ( - + col1 ) AS col2 FROM tab2 WHERE ( NULL ) > NULL GROUP BY col1
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT ( col1 ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING 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
----
-15
-91
-92

query I rowsort
SELECT col0 FROM tab1 WHERE NOT - + col2 - col0 IS NULL GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 GROUP BY col0, col1, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query II rowsort
SELECT col1, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT - col1 + - - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL <> + col1
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 + - col0 AS col2 FROM tab1 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query II rowsort
SELECT ALL + col1 AS col0, - col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
-41
59
-59
61
-61

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query II rowsort
SELECT ALL col1 AS col1, col1 - col1 - - col1 AS col0 FROM tab1 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT ALL col0 * - col0 FROM tab2 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-225
-8281
-8464

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2, col0
----
45
71
8

query I rowsort
SELECT ALL + - col2 AS col0 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 col0 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col2 * - col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT 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 * + col1 FROM tab1 GROUP BY col1, col0
----
132
1596
3608

query I rowsort
SELECT ALL - 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 col2, col0
----
22
28
82

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT + col1 AS col1, col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col2 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col0, col1
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 GROUP BY col1 HAVING NOT ( NOT NULL = NULL )
----

query I rowsort
SELECT DISTINCT + 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 col1 col0 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 * + + col0 * + - col0 col1, col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
10648
22
21952
28
551368
82

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 DISTINCT col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT col0 * col0 AS col1 FROM tab1 GROUP BY col0, col1
----
484
6724
784

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab0 WHERE + col0 < NULL GROUP BY col2
----

query I rowsort
SELECT col0 * + - col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col1 - + col1 FROM tab1 AS cor0 GROUP BY col1
----
0

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 AS cor0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL + col0 * - - col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT DISTINCT - col1 + col1 AS col2 FROM tab0 GROUP BY col1
----
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

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2 HAVING ( ( NULL ) IS NULL )
----
-45
-71
-8

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
58
79
87

query I rowsort
SELECT - col1 + - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - 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 ALL - + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT NULL >= NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col2 + col2 AS col1, - col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
-45
0
-71
0
-8

query I rowsort
SELECT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT col2 - + + col2 AS col1 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col1 AS col2 FROM tab2 cor0 GROUP BY col0, col1 HAVING NULL >= NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
41
59
61

query II rowsort
SELECT ALL col0, col0 + + - 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 DISTINCT col0 col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + col2 AS col0 FROM tab2 GROUP BY col2, col2, col2
----
58
79
87

query I rowsort
SELECT - col2 AS col1 FROM tab1 WHERE + + col1 IS NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL - + col0 AS col2 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + + col1 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col1 * - col1 AS col0 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT col2 + + - col2 AS col1 FROM tab2 GROUP BY col0, col2, col2
----
0
0
0

query II rowsort
SELECT col2 * + col2 + + col2, col2 FROM tab2 GROUP BY col2
----
3422
58
6320
79
7656
87

query I rowsort
SELECT DISTINCT - col0 * + - col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + col2 * - col1 * col2 AS col1 FROM tab2 GROUP BY col2, col1
----
-137924
-368219
-461709

query I rowsort
SELECT DISTINCT + col2 * - - col2 AS col2 FROM tab1 GROUP BY col2, col0
----
2025
5041
64

query I rowsort
SELECT ALL col0 * + col0 FROM tab0 GROUP BY col0, col2, col2
----
1849
676
6889

query I rowsort
SELECT - col1 * col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col2, col0, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col2 * col0 AS col2 FROM tab2 GROUP BY col0, col2, col2
----
1305
5336
7189

query II rowsort
SELECT - col1, - 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 col1 col0 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL - col1 * col1 AS col2 FROM tab0 GROUP BY col1, col1
----
-6561
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 col1, - col1 col1 FROM tab0 GROUP BY col1
----
0
0
81
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - - col1 AS col0 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + + 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 ALL + - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL AVG ( ALL - + col1 ) AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 WHERE NULL <> NULL GROUP BY col2, col0
----

query I rowsort
SELECT - - col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 cor0 GROUP BY col0, col1, col0 HAVING - col0 > NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT - col2 NOT IN ( col0 ) GROUP BY col2
----

query I rowsort
SELECT + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2, col0, col1
----
15
91
92

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
15
91
92

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING - col1 IS NULL
----

query I rowsort
SELECT - + col2 * - + col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 * + col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 - - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
182
184
30

query I rowsort
SELECT - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 + - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col0 AS col2 FROM tab1 cor0 GROUP BY col1, col0, col0
----
22
28
82

query I rowsort
SELECT col2 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 - - + col2 IS NOT NULL
----
58
79
87

query II rowsort
SELECT ALL col0, + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
22
22
28
28
82
82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query II rowsort
SELECT ALL col0, + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL - col2 * - - col2 FROM tab1 cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT + col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NOT - col1 IS NOT NULL )
----

query I rowsort
SELECT - - col0 AS col2 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + AVG ( col0 ) FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 * - col0 AS col0 FROM tab0 GROUP BY col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col0, col1
----
58
79
87

query I rowsort
SELECT ALL col0 - + col1 AS col1 FROM tab0 WHERE NULL NOT BETWEEN ( NULL ) AND NULL GROUP BY col1, col0 HAVING ( NULL ) IS NULL
----

query I rowsort
SELECT col1 - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 + col2 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NOT NULL
----
142
16
90

query I rowsort
SELECT - col2 + - col2 AS col0 FROM tab1 GROUP BY col2
----
-142
-16
-90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + + AVG ( ALL - col2 ) IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col1, col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT - AVG ( ALL + - col2 ) + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col2 HAVING - + col1 IS NULL
----

query I rowsort
SELECT ALL + col0 * - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col1, col2, col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col2, col2, col1
----
41
59
61

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0, col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + + col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT - AVG ( + col2 ) FROM tab0 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 + - col2 FROM tab0 GROUP BY col2, col1
----
0
0
0

query I rowsort
SELECT + + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT - col1 + - col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col1, col0 HAVING NULL <= - AVG ( + + col1 )
----

query I rowsort
SELECT ALL col2 * + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NOT NULL
----
22
28
82

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT col1 + - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-17
-20
-26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col1 col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col2 + col2 AS col2 FROM tab0 GROUP BY col2, col1
----
0

query I rowsort
SELECT col0 FROM tab1 cor0 WHERE NOT NULL <= NULL GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query II rowsort
SELECT - col0, - col0 FROM tab1 AS cor0 GROUP BY col0
----
-22
-22
-28
-28
-82
-82

query I rowsort
SELECT ALL - col0 AS col1 FROM tab0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col0 - - - col0 FROM tab0 cor0 GROUP BY col0, col0
----
-166
-52
-86

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col1 * - col1 * - + col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
282123

query I rowsort
SELECT + col0 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
91
92

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7239
SELECT - col1 DIV - col1 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7239
SELECT - col1 / - col1 FROM tab1 GROUP BY col1
----
1
1
1

query II rowsort
SELECT + col0 * + - col0 AS col2, col0 FROM tab2 GROUP BY col0, col2
----
-225
15
-8281
91
-8464
92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - col2 - col2 FROM tab2 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NULL > NULL
----

query I rowsort
SELECT + col1 + + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 + + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
142
16
90

query I rowsort
SELECT DISTINCT col0 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-225
-8281
-8464

query I rowsort
SELECT - - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col0 * - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col1 - - col1 AS col0 FROM tab0 GROUP BY col1, col1, col1
----
0
162

onlyif mysql # DIV for integer division: 
query I rowsort label-7253
SELECT col2 DIV - col2 AS col1 FROM tab0 GROUP BY col1, col1, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7253
SELECT col2 / - col2 AS col1 FROM tab0 GROUP BY col1, col1, col2
----
-1
-1
-1

query I rowsort
SELECT ALL col1 + + col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 + + col0 AS col2 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT ALL col2 AS col1 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1 HAVING + col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 col2, + col0 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
15
15
91
91
92
92

query I rowsort
SELECT - - col0 + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
-29
16
38

query I rowsort
SELECT DISTINCT col2 * col2 AS col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + col1 * - col1 AS col1 FROM tab0 GROUP BY col1
----
-6561
0

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 + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

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 II rowsort
SELECT + + col0 col1, col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col1, col2, col1
----
0
0
81

query I rowsort
SELECT + col0 FROM tab0 cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT + col1 AS col0 FROM tab2 WHERE NOT - col2 IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT + + col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
41
59
61

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col1, col0, col1
----
22
28
82

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 FROM tab2 GROUP BY col0, col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col2 * col1 FROM tab0 GROUP BY col1, col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT ALL col1 FROM tab0 WHERE NOT - - col2 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL BETWEEN col2 AND ( NULL )
----

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

query I rowsort
SELECT ALL col0 + - col1 FROM tab0 AS cor0 WHERE NULL < NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col2 * col2 AS col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col2 AS col1 FROM tab2 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1 HAVING - col1 IS NOT NULL
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-7287
SELECT ALL col2 DIV - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7287
SELECT ALL col2 / - col2 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT + col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col0, col2, col0 HAVING NULL IS NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col0 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + col1 + col1 FROM tab2 GROUP BY col1
----
118
122
82

query I rowsort
SELECT col0 - col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL = col0
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1, col2 HAVING ( NOT NULL IS NOT NULL )
----
26
43
83

query I rowsort
SELECT - col1 * - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
1936
3249
36

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col2 * - col2 AS col1 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT col0 + - col0 + + + col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query II rowsort
SELECT ALL col0 AS col2, + col0 AS col2 FROM tab2 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL + col1 * - col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT + + col1 AS col1 FROM tab0 cor0 GROUP BY col1 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col0 * - col0 * col0 + - col0 AS col2 FROM tab0 GROUP BY col0
----
-17602
-571870
-79550

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1 HAVING NOT NULL > NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-7310
SELECT DISTINCT + col2 DIV - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1

skipif mysql # not compatible
query I rowsort label-7310
SELECT DISTINCT + col2 / - col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-1

query I rowsort
SELECT ALL - col2 + col0 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + col1 + - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 * - col0 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query II rowsort
SELECT + col1, col1 AS col0 FROM tab2 GROUP BY col1
----
41
41
59
59
61
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col2 FROM tab1 cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query II rowsort
SELECT DISTINCT - col0, + col0 FROM tab1 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT + - col1 * col1 FROM tab2 cor0 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col1 * col1 + - col1 FROM tab1 GROUP BY col1, col1
----
1892
30
3192

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * - + col0 col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
225
8281
8464

query I rowsort
SELECT + col0 FROM tab0 GROUP BY col0, col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 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 + col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

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 + - col0 * + col0 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 + - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT ALL col1 + - col1 * + - col1 FROM tab1 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
-81
0

query I rowsort
SELECT ALL - 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 col1 FROM tab1 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT + - col0 * - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-225
-8281
-8464

query I rowsort
SELECT col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1, col1, col1
----
0
81

query I rowsort
SELECT - - col2 + + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NOT - col2 IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col2 + - col1 FROM tab1 cor0 GROUP BY col1, col2
----
-12
2
27

query I rowsort
SELECT - col0 AS col0 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 DISTINCT col2 col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT col2 * col2 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 - col0 col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1, col0
----
-126
-28
-85

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0 HAVING col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT - col0 AS col1 FROM tab0 GROUP BY col1, col0, col2
----
-26
-43
-83

query I rowsort
SELECT - col0 * col0 + - col0 AS col1 FROM tab0 GROUP BY col0
----
-1892
-6972
-702

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
45
71
8

query I rowsort
SELECT + col0 AS col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT + - col1 * col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) <> ( NULL )
----

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL col2 - - + col2 + col2 FROM tab1 GROUP BY col2
----
135
213
24

query I rowsort
SELECT DISTINCT - col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT NULL = ( NULL )
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * - - col2 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL <= - col1
----

query II rowsort
SELECT - - col0 AS col1, + col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
6
28
57
82
44

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING + AVG ( DISTINCT + col0 ) IS NULL
----

query I rowsort
SELECT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
44
57
6

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2
----
24
38
79

query I rowsort
SELECT ALL col0 + + col2 FROM tab2 AS cor0 GROUP BY col1, col2, col0
----
102
150
170

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 AS cor0 WHERE - col2 <> ( col2 ) GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT col2 - + col2 FROM tab1 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col0 HAVING NOT col0 IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col0, col1
----
22
28
82

query II rowsort
SELECT ALL col1, - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
-41
59
-59
61
-61

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query II rowsort
SELECT DISTINCT - col0 AS col1, + col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT ALL - col2 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT + - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

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-7394
SELECT col1 + + - col1 DIV col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
43
5
56

skipif mysql # not compatible
query I rowsort label-7394
SELECT col1 + + - col1 / col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
43
5
56

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 IS NOT NULL
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col2, col1, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * - - col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col0 * col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
1849
676
6889

query I rowsort
SELECT ALL - col2 - - col2 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col2 * col1 FROM tab2 GROUP BY col1, col1, col2, col1
----
2378
4661
5307

query I rowsort
SELECT ALL col1 + col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
118
122
82

query I rowsort
SELECT + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT NULL IS NULL )
----
-45
-71
-8

query I rowsort
SELECT + col0 * + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

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 tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL + col2 + col2 AS col0 FROM tab2 GROUP BY col1, col2
----
116
158
174

query I rowsort
SELECT DISTINCT + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT NULL IS NULL )
----
58
79
87

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-81
0
0

query I rowsort
SELECT ALL + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT - col1 * col1 AS col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query II rowsort
SELECT - - col2, + col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT ALL + col0 AS col2 FROM tab1 GROUP BY 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 - col1 + - col1 FROM tab0 GROUP BY col1
----
-162
0

query I rowsort
SELECT ALL col1 + - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0 HAVING NOT ( NULL ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL <= NULL
----

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 GROUP BY col2, col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - - col2 ) FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING + col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT - col1 AS col0 FROM tab0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 WHERE NULL = NULL GROUP BY col2
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7442
SELECT - col0 DIV - + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0
1
2

skipif mysql # not compatible
query I rowsort label-7442
SELECT - col0 / - + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
0
1
2

query I rowsort
SELECT col0 + + col1 AS col2 FROM tab1 GROUP BY col0, col1
----
126
28
85

onlyif mysql # DIV for integer division: 
query I rowsort label-7444
SELECT col2 * - col2 DIV col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

skipif mysql # not compatible
query I rowsort label-7444
SELECT col2 * - col2 / col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

query II rowsort
SELECT DISTINCT - col0, col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - col0 * - col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col0, col2, col1 HAVING NOT - col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 WHERE NULL IS NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7451
SELECT col1 DIV - - col1 FROM tab1 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7451
SELECT col1 / - - col1 FROM tab1 GROUP BY col1
----
1
1
1

query I rowsort
SELECT DISTINCT + - col1 + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
0

query I rowsort
SELECT DISTINCT + - 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-7454
SELECT - col1 DIV col1 AS col0 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7454
SELECT - col1 / col1 AS col0 FROM tab2 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT col0 AS col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 * - col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT - col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 * + col1 FROM tab0 cor0 GROUP BY col1, col0
----
0
0
6561

query I rowsort
SELECT + + col2 AS col1 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING - col1 IS 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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - col2 * + col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL <> col1 GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
44
57
6

query I rowsort
SELECT + col2 + - col2 AS col1 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL = NULL
----

query I rowsort
SELECT ALL - - col2 + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
142
16
90

query II rowsort
SELECT col1, col1 FROM tab2 AS cor0 GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

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 - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - + col0 )
----

query I rowsort
SELECT ALL - col0 * - - col0 - + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-462
-6642
-756

query II rowsort
SELECT ALL + col1, - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT ALL + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 * col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col2 * + - col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT col1 * - col1 FROM tab2 GROUP BY col2, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - + col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT col1 + - - col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col1, col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab1 AS cor0 GROUP BY col1, col1, col2
----
45
71
8

query I rowsort
SELECT + col0 + + + col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT ALL - + col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING + + col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 WHERE NOT col1 < + col0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT - col0 AS col0, col0 * - col0 FROM tab0 cor0 GROUP BY col0
----
-26
-676
-43
-1849
-83
-6889

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col0, col1 HAVING NOT - col0 IS NULL
----
-81
0

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 + col0 AS col2 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + + col0 + + col0 AS col0 FROM tab1 cor0 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col0 HAVING AVG ( col0 ) * + col0 IS NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT - col1 AS col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab0 WHERE NOT - - col2 IS NULL GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT + 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 col2, col2 + col2 col0 FROM tab1 GROUP BY col2
----
45
90
71
142
8
16

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query II rowsort
SELECT col2, - col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col0 FROM tab1 GROUP BY col0, col2 HAVING NOT - col0 < ( col2 )
----

query I rowsort
SELECT + col1 + - col1 FROM tab1 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1, col0 col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
43
0
26
0
83

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NULL > + - col2
----

query I rowsort
SELECT ALL - col1 * + col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT - col1 + - + col1 FROM tab1 cor0 GROUP BY col1, col1, col1 HAVING NOT ( NOT ( NOT NULL BETWEEN NULL AND NULL ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7522
SELECT ALL - col1 DIV - col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1
1
1

skipif mysql # not compatible
query I rowsort label-7522
SELECT ALL - col1 / - col1 AS col2 FROM tab2 GROUP BY col2, col1
----
1
1
1

query I rowsort
SELECT ALL + col1 * col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * + col2 col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2, col1, col2, col1
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 GROUP BY col2, col2, col1
----
-45
-71
-8

query I rowsort
SELECT col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 * - col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT ALL - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT col1 IS NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT ALL col1 * + col1 / - - col1 FROM tab1 AS cor0 WHERE NOT NULL < NULL GROUP BY col1
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab0 cor0 GROUP BY col0, col2
----
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 col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT AVG ( ALL col2 ) * - col2 + + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT - - col1 + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col0 FROM tab2 GROUP BY col2, col2, col0
----
15
91
92

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY col1, col1, col2
----
58
79
87

query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 * + - col2 + - col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1288
-198
-5904

query I rowsort
SELECT ALL + - col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT col0 + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col1, col0, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab2 GROUP BY col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT col0 + + col0 - col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-57
103
126

query I rowsort
SELECT - col2 * - col2 + col2 FROM tab2 GROUP BY col2, col1
----
3422
6320
7656

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7558
SELECT DISTINCT col2 - - col2 DIV - col2 FROM tab0 GROUP BY col0, col2
----
23
37
78

skipif mysql # not compatible
query I rowsort label-7558
SELECT DISTINCT col2 - - col2 / - col2 FROM tab0 GROUP BY col0, col2
----
23
37
78

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT + col0 + + - col0 FROM tab1 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 * + col2 col0 FROM tab0 GROUP BY col2
----
1444
576
6241

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 tab1 GROUP BY col0
----
22
28
82

query I rowsort
SELECT col2 * + + col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT - - col0 + - + col0 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT ALL col1 AS col2, col1 FROM tab2 GROUP BY col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL - + col1 + - col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-133
-150
-76

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + + + col2 FROM tab2 GROUP BY col1, col2
----
138
148
99

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NOT NULL > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col2 * col2 col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT col2 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 + col1 col1 FROM tab0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col1 - + col1 + - col1 AS col1 FROM tab1 cor0 GROUP BY col1
----
-132
-171
-18

query I rowsort
SELECT DISTINCT + col0 FROM tab1 GROUP BY col2, col0, col0, col0
----
22
28
82

query I rowsort
SELECT col1 FROM tab1 WHERE NOT ( col2 ) IS NULL GROUP BY col1
----
44
57
6

query II rowsort
SELECT DISTINCT - col1 AS col0, + col1 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT col2 FROM tab1 GROUP BY col1, col2, col1
----
45
71
8

query I rowsort
SELECT ALL - col2 + + col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT ( NOT NULL >= - AVG ( ALL col1 ) )
----

query I rowsort
SELECT ALL - col1 FROM tab2 cor0 GROUP BY col0, col1, col1
----
-41
-59
-61

query II rowsort
SELECT DISTINCT - col2 AS col0, col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2, col1
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 + col1 col2 FROM tab1 GROUP BY col1
----
114
12
88

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 DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT ALL col1 * - col1 AS col0 FROM tab1 GROUP BY col1, col1
----
-1936
-3249
-36

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 / AVG ( ALL + col0 ) FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2, col0, col2
----
-45
-71
-8

query II rowsort
SELECT ALL - col2 AS col0, - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - + col0 FROM tab1 cor0 GROUP BY col0, col0 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - col2 + + col2 AS col0 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col2 AS col1 FROM tab1 cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT col0 * + - col0 + + + col0 + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1763
-624
-6723

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query II rowsort
SELECT DISTINCT + + col1 + - col1, - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
-81
0
0

query I rowsort
SELECT ALL - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 FROM tab0 AS cor0 WHERE NOT col2 = ( NULL ) GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
58
79
87

query II rowsort
SELECT ALL + col0 * - - col0, col0 * - col0 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL col1 / - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 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 ALL col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + col0 * + - col0 FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) IS NOT NULL
----
-240
-8372
-8556

query I rowsort
SELECT col0 + - col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 * - + col1 AS col0 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query II rowsort
SELECT + col0, + col0 AS col2 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT DISTINCT - col0 - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0
----
0

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col0 * col0 FROM tab2 cor0 GROUP BY col1, col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + - col2 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 GROUP BY col1, col1, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col2 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col0 + + col0 FROM tab2 GROUP BY col0, col2
----
182
184
30

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT + + col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0
162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col1 col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT col2 + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT + col0 - - - col0 FROM tab2 AS cor0 WHERE NOT NULL <> NULL GROUP BY col0
----

query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col2, col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT col2 - col2 AS col2 FROM tab1 GROUP BY col2
----
0

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 * col2 AS col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT col0 * + col2 FROM tab1 GROUP BY col0, col2
----
1260
176
5822

query I rowsort
SELECT col0 - + - col0 + - col0 AS col1 FROM tab0 GROUP BY col1, col0 HAVING ( ( NULL BETWEEN NULL AND - col0 ) )
----

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col1 + + col0 FROM tab0 cor0 GROUP BY col1, col0, col1
----
124
26
83

query I rowsort
SELECT DISTINCT - - col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL col0 AS col0 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 col2, col1
----
45
71
8

query I rowsort
SELECT + col1 + + col1 + col1 AS col1 FROM tab1 GROUP BY col1
----
132
171
18

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + col1 col0 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT DISTINCT + + col1 - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL - col0 - col0 FROM tab0 GROUP BY col2, col0
----
-166
-52
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab2 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

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 col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query II rowsort
SELECT - col1 AS col1, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-41
-59
-59
-61
-61

query I rowsort
SELECT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
45
71
8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING + + col1 * col2 + + + col2 * + - col2 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col1 * + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT col1 * + - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 - - col1 col0 FROM tab0 cor0 GROUP BY col1, col2, col1 HAVING NOT col1 BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE NOT ( NULL ) < ( col2 * - col1 ) GROUP BY col2 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT + + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT + - col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT ( NOT NULL < NULL )
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT - col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT + col1 * + col1 AS col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL + col0 + + col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 - + + col2 AS col1 FROM tab0 cor0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col0, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
45
71
8

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col2 FROM tab0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + + col2 IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 * + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT col2 FROM tab0 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT - - col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL + col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT - col0 IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 cor0 GROUP BY col0, col1
----
-22
-28
-82

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 + col2 col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT + - col2 IS NOT NULL
----

query I rowsort
SELECT - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING ( - col2 ) >= col2
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT col2 * col2 AS col2, col2 FROM tab0 GROUP BY col2 HAVING NOT + col2 = NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col0 HAVING NOT ( + col0 ) < NULL
----

query II rowsort
SELECT + col2 AS col2, col2 + col2 AS col1 FROM tab0 GROUP BY col2
----
24
48
38
76
79
158

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1, col1
----
-41
-59
-61

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab1 AS cor0 WHERE NOT - col2 IS NULL GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - + col1 AS col1 FROM tab1 cor0 GROUP BY col1, col0
----
-44
-57
-6

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL < NULL
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING + col1 = NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7720
SELECT DISTINCT col2 DIV + col2 - - col2 FROM tab0 GROUP BY col2, col2
----
25
39
80

skipif mysql # not compatible
query I rowsort label-7720
SELECT DISTINCT col2 / + col2 - - col2 FROM tab0 GROUP BY col2, col2
----
25
39
80

query I rowsort
SELECT col0 + col0 AS col2 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT col1 * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
1936
3249
36

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 + - - col2 + col2 col0 FROM tab1 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING + - col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT - col0 - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2, col1 HAVING NULL IS NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + - - col2 + col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

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 col0 * + col0 col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * - col0 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col0, col0 HAVING NOT ( NOT ( NULL <> NULL ) )
----

query II rowsort
SELECT ALL col2, col2 FROM tab0 cor0 GROUP BY col0, col2
----
24
24
38
38
79
79

query I rowsort
SELECT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL >= - AVG ( ALL + + col1 )
----

query I rowsort
SELECT - col1 * - col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT + + col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
15
91
92

query I rowsort
SELECT - col1 * col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT DISTINCT col1 * col2 FROM tab0 WHERE ( NOT NULL IS NULL ) GROUP BY col2, col1
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
58
79
87

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1, col1, col0
----
0
0
6561

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 cor0 GROUP BY col1, 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 col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 - + col2 AS col1 FROM tab1 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS 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 DISTINCT col2 col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col1 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

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 + col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
126
28
85

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 * col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT + + AVG ( - + col1 ) * + col0 >= NULL
----

query I rowsort
SELECT ALL - col2 - - col2 + + col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - AVG ( ALL - col0 ) * col0 * - col0 + - + col0 FROM tab0 AS cor0 WHERE NOT NULL = ( NULL ) GROUP BY col0
----

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + - col2 col0 FROM tab2 GROUP BY col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - col0 * - + col0 AS col2 FROM tab1 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT col0 + col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col1, col2, col0
----
0
0
81

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 col1 FROM tab0 GROUP BY col1 HAVING NOT ( NOT NULL IS NULL )
----
0
81

query I rowsort
SELECT ALL col0 + - col2 FROM tab2 GROUP BY col0, col2
----
-72
12
34

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT col1 * - + col1 FROM tab0 GROUP BY col0, col2, col1
----
-6561
0
0

query I rowsort
SELECT col0 * - col0 * col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 * - col2 - + col2 + - + col2 FROM tab2 GROUP BY col2, col2
----
3248
6083
7395

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING ( + col2 - + col0 IS NOT NULL )
----
15
91
92

query I rowsort
SELECT col0 - + - col0 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT col1 + - + col1 FROM tab2 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1
----

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 col2 * col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 WHERE NOT ( - col1 IS NOT NULL ) GROUP BY col0, col1
----

query I rowsort
SELECT ALL col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT AVG ( DISTINCT - col2 ) AS col0 FROM tab2 GROUP BY col2 HAVING NULL <> col2
----

query II rowsort
SELECT - col0, + col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + - col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col2 col0, + col0 col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
43
38
83
79
26

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

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 AS cor0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE + col2 IS NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL < ( NULL ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT - + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING NOT AVG ( col0 ) IS NOT NULL
----

query I rowsort
SELECT - col1 + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT + - col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col2 FROM tab1 cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 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 DISTINCT col1 col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT + col1 / + col1 AS col0 FROM tab0 GROUP BY col1 HAVING ( NOT ( NOT NULL BETWEEN NULL AND NULL ) )
----

query II rowsort
SELECT DISTINCT - col1 * + col1, + col1 * + - col1 FROM tab2 GROUP BY col1
----
-1681
-1681
-3481
-3481
-3721
-3721

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT + + col2 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT ( NULL ) <= - col1 GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query II rowsort
SELECT DISTINCT col0, col0 FROM tab0 GROUP BY col2, col0
----
26
26
43
43
83
83

query I rowsort
SELECT col2 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-7818
SELECT DISTINCT col1 DIV + + col2 + - + col2 + - - col2 * - col1 FROM tab2 GROUP BY col2, col1
----
-2436
-4740
-5394

skipif mysql # not compatible
query I rowsort label-7818
SELECT DISTINCT col1 / + + col2 + - + col2 + - - col2 * - col1 FROM tab2 GROUP BY col2, col1
----
-2436
-4740
-5394

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NOT NULL = NULL GROUP BY col1, col2
----

query I rowsort
SELECT - col2 FROM tab0 cor0 GROUP BY col2, col1 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT col0 AS col1 FROM tab2 WHERE ( NULL IS NOT NULL ) GROUP BY col0, col0
----

query I rowsort
SELECT DISTINCT + - col2 * col2 + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2070
-5112
-72

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT col0 AS col1, col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query II rowsort
SELECT col1 + - + col1, - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 * + + col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT - col1, - col1 AS col2 FROM tab0 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT - - col1 ) FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NULL <= ( NULL ) )
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1444
-576
-6241

query II rowsort
SELECT ALL col0 * + col0 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1849
43
676
26
6889
83

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col1 AS col2 FROM tab2 cor0 WHERE + col0 + + + col2 IS NULL GROUP BY col1
----

query II rowsort
SELECT ALL - + col1 AS col1, - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-41
-58
-59
-79
-61
-87

query I rowsort
SELECT + col0 * - col2 FROM tab1 GROUP BY col2, col0, col2, col0
----
-1260
-176
-5822

query I rowsort
SELECT DISTINCT col0 * + + col0 FROM tab1 GROUP BY col2, col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL + + col1 * col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) <> ( NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-7847
SELECT + col0 DIV - col0 + col0 FROM tab1 GROUP BY col0
----
21
27
81

skipif mysql # not compatible
query I rowsort label-7847
SELECT + col0 / - col0 + col0 FROM tab1 GROUP BY col0
----
21
27
81

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0, col0 col1 FROM tab2 GROUP BY col0, col2, col0
----
15
15
91
91
92
92

query II rowsort
SELECT ALL col2, - col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL <= NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79

query I rowsort
SELECT + col2 * col2 AS col1 FROM tab2 AS cor0 WHERE NOT + col1 IS NULL GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - col0 AS col1 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col0 - - col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - AVG ( - col2 ) IS NULL
----
0
81

query I rowsort
SELECT DISTINCT + col2 - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * + col1 FROM tab2 GROUP BY col1, col0
----
-3772
-5369
-915

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 + col1 + col2 AS col2 FROM tab1 GROUP BY col1, col2
----
102
115
14

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col2 HAVING NULL > ( + col2 )
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - - col1 * + + col1 + - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 - - col0, - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
166
-83
52
-26
86
-43

query I rowsort
SELECT ALL + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col1, col2 HAVING ( NOT NULL IS NOT NULL )
----
-45
-71
-8

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col0 col1 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 * + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT DISTINCT + col1 + + + col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

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 + col0 - col0 AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 + - + col2 FROM tab0 GROUP BY col1, col2 HAVING NULL IS NULL
----
-38
-79
57

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * - + col1 col0 FROM tab1 AS cor0 WHERE ( NOT - col0 < + - col2 ) GROUP BY col2, col1
----
3249

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-7881
SELECT ALL col0 DIV + - col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-7881
SELECT ALL col0 / + - col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, 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 col1 FROM tab1 GROUP BY col0
----
164
44
56

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col1 + col1 AS col2 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - col2 FROM tab1 WHERE NOT col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT + + col1 * - col1 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 + col0 col2 FROM tab0 GROUP BY col0
----
166
52
86

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 + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT - col1 + - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col0, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT col2 IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT col2 * - col2 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
-2025
-5041
-64

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 + + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
142
16
90

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col1, col0 HAVING NULL < ( AVG ( + col1 ) )
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 WHERE NULL >= col1 GROUP BY col1
----

query I rowsort
SELECT ALL + col0 * col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT - col1 * - col1 FROM tab2 GROUP BY col1, col1
----
1681
3481
3721

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col1 FROM tab2 GROUP BY col1 HAVING NOT + col1 IS NULL
----
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 - col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query II rowsort
SELECT + col2 AS col1, col1 AS col0 FROM tab1 GROUP BY col2, col1
----
45
57
71
44
8
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + + col1 FROM tab0 cor0 GROUP BY col1, col1, col2
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 + - col2 col2 FROM tab2 cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL - + col0 + - col0 FROM tab1 cor0 GROUP BY col0
----
-164
-44
-56

query I rowsort
SELECT - col1 AS col1 FROM tab2 cor0 WHERE NOT ( + col1 ) < + col2 GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT col0 + + + col0 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query II rowsort
SELECT ALL + col1 AS col1, + col1 FROM tab2 cor0 GROUP BY col1, col1 HAVING ( NULL ) >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 AS col0, + col0 col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + col2 - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL col2 FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT + col1 FROM tab0 GROUP BY col0, col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab1 GROUP BY col0, col2
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL + col2 * - + col2 + col2 + + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3248
-6083
-7395

query I rowsort
SELECT DISTINCT + + col2 + col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT col0 + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + col0 * + col1 FROM tab2 WHERE NULL IS NULL GROUP BY col1, col0 HAVING col1 BETWEEN NULL AND + col0
----

query I rowsort
SELECT ALL - + col2 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 FROM tab1 WHERE ( NULL ) IS NOT NULL GROUP BY col2, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 WHERE - col2 IS NULL GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col0, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col0 FROM tab0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - + col2 - + - col1 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
124
1551
3537

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab1 WHERE - col0 = NULL GROUP BY col2, col1
----

query I rowsort
SELECT DISTINCT - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

query II rowsort
SELECT col1, col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + col2 + + - col2 * + col2 FROM tab1 cor0 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT ALL - col0 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col2, col0, col2 HAVING NULL <= col2
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT - col0 FROM tab2 WHERE NOT ( NULL ) > + col2 GROUP BY col0
----

query I rowsort
SELECT + col0 + col0 AS col2 FROM tab1 GROUP BY col1, col1, col0
----
164
44
56

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-81
0

query I rowsort
SELECT - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT col0 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col1, col2 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 - - - col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - col2 + - col2 + col2 * - col2 AS col2 FROM tab1 GROUP BY col2
----
-2115
-5183
-80

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL > NULL
----

query II rowsort
SELECT DISTINCT col0 * + col0 AS col1, + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 WHERE NOT NULL NOT IN ( - col1, - col2 ) GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col0 * + col0 AS col1 FROM tab1 GROUP BY col0, col1, col0
----
-484
-6724
-784

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col1, 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, col1
----
0
81

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL >= + col0
----

query I rowsort
SELECT + + col1 + + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + col0 AS col0, + col0 AS col1 FROM tab0 WHERE - col0 < NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - col1 IS NULL
----

query I rowsort
SELECT ALL + - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0 HAVING + col0 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab1 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL - col0 * col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-484
-6724
-784

query I rowsort
SELECT + col0 + col0 + + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
246
66
84

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE NOT NULL = + col0 GROUP BY col0
----

query I rowsort
SELECT + col0 AS col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT col2 * - col2 * AVG ( col2 ) FROM tab0 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

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 + col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT ALL col0 * + col0 AS col2 FROM tab0 GROUP BY col0, col0
----
1849
676
6889

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT col0 + + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 GROUP BY col1, col2, col2
----
-24
-38
-79

query II rowsort
SELECT ALL col0 AS col0, + col0 FROM tab0 GROUP BY col2, col0 HAVING col0 IS NULL
----

query II rowsort
SELECT ALL col2 AS col0, - col0 + - - col2 FROM tab0 GROUP BY col2, col0, col0
----
24
-19
38
-45
79
53

query II rowsort
SELECT col0 AS col2, col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col2, col0 HAVING NOT ( NOT ( NULL ) IS NULL )
----
0
0
81

query I rowsort
SELECT ALL - AVG ( col2 ) FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 cor0 GROUP BY col0, col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query II rowsort
SELECT - col0 AS col1, col0 + + col0 - + - col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
66
-28
84
-82
246

query I rowsort
SELECT col1 + + col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT - + col2 + - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-105
-121
-67

query II rowsort
SELECT col1 * - - col1 AS col1, - col1 FROM tab2 GROUP BY col1
----
1681
-41
3481
-59
3721
-61

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NOT ( - + col1 ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + + col2 col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1 HAVING ( + col1 ) = NULL
----

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-8019
SELECT ALL col0 + col0 DIV 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-8019
SELECT ALL col0 + col0 / col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
27
44
84

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT ALL col2 AS col0, + col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL + + col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col2 FROM tab2 cor0 GROUP BY col2, col1
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-8024
SELECT ALL col0 * + + col0 DIV col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

skipif mysql # not compatible
query I rowsort label-8024
SELECT ALL col0 * + + col0 / col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT col1 AS col1 FROM tab0 cor0 GROUP BY col1, col2, col1
----
0
0
81

query I rowsort
SELECT - col1 + + col1 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

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 col2 col2 FROM tab1 GROUP BY col0, col2
----
45
71
8

query II rowsort
SELECT ALL - col1 * col1 AS col2, - col1 FROM tab2 GROUP BY col1, col2
----
-1681
-41
-3481
-59
-3721
-61

query I rowsort
SELECT + col1 FROM tab0 cor0 GROUP BY col1, col2, col2
----
0
0
81

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col2, col0, col1 HAVING NULL IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 * + col2 col0 FROM tab2 GROUP BY col2, col2, col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col1
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col1, col0 HAVING + col0 IS NOT NULL
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-8038
SELECT - + col2 DIV col2 * - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

skipif mysql # not compatible
query I rowsort label-8038
SELECT - + col2 / col2 * - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col1 * + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 * col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NOT NULL
----
1305
5336
7189

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 + + col0 col2 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL BETWEEN col2 AND + col0
----

query I rowsort
SELECT ALL col2 * - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT col1 * - col1 FROM tab2 cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col0 * + col0 AS col2 FROM tab2 GROUP BY col1, col0
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 + - col0 col2 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
-164
-44
-56

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 GROUP BY col1, col0, col2
----
-44
-57
-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 GROUP BY col0 HAVING col0 IS NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * + col2 col2 FROM tab1 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 WHERE NOT - col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + + col2 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
45
71
8

query I rowsort
SELECT col2 * col2 AS col1 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - + col2 - col1 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col2
----
-138
-148
-99

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT NULL < col2
----

query I rowsort
SELECT ALL - - col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
26
43
83

query II rowsort
SELECT col0 AS col0, - col1 FROM tab0 GROUP BY col0, col1
----
26
0
43
-81
83
0

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 GROUP BY col1 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 col0 * - col0 AS col0 FROM tab0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN + + col2 AND NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8071
SELECT col0 DIV - col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8071
SELECT col0 / - col0 FROM tab0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL + col1 - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT + col1 - - + col1 FROM tab2 GROUP BY col2, col1
----
118
122
82

query I rowsort
SELECT DISTINCT - col2 * - col2 * + col0 * + col0 AS col1 FROM tab1 GROUP BY col2, col0
----
1587600
30976
33895684

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 cor0 GROUP BY col2, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT col0 = - col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-8080
SELECT col0 DIV col0 FROM tab0 GROUP BY col1, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8080
SELECT col0 / col0 FROM tab0 GROUP BY col1, col0
----
1
1
1

query I rowsort
SELECT - col1 + + col1 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) <> NULL GROUP BY col1
----

query II rowsort
SELECT DISTINCT - col0 AS col2, col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query II rowsort
SELECT - col2, col2 * col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
3364
-79
6241
-87
7569

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col0, col0, col2 HAVING NOT ( NULL ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col2 * - + col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL col1 + col1 FROM tab0 GROUP BY col1, col0
----
0
0
162

query I rowsort
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

onlyif mysql # DIV for integer division: 
query I rowsort label-8092
SELECT - col2 DIV col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8092
SELECT - col2 / col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab2 WHERE - col1 IS NULL GROUP BY col1
----

query I rowsort
SELECT col0 * + col0 * col0 FROM tab2 GROUP BY col0
----
3375
753571
778688

query I rowsort
SELECT ALL + col1 + col1 FROM tab0 WHERE NOT + col0 - col2 <> NULL GROUP BY col1, col1
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT - - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-53
19
45

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2, col0, col1
----
-58
-79
-87

query I rowsort
SELECT ALL - col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT + + col1 AS col2 FROM tab0 cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0, col1
----
0
0
81

query I rowsort
SELECT ALL - col2 - + + col0 AS col2 FROM tab2 GROUP BY col0, col2
----
-102
-150
-170

query I rowsort
SELECT - col2 + col2 AS col1 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col1 + - col1 AS col0 FROM tab1 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NOT NULL < ( NULL ) )
----

query I rowsort
SELECT - + col1 * + + col1 * - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
531441

query I rowsort
SELECT ALL - col0 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col2, col0, col0
----
-22
-28
-82

query I rowsort
SELECT ALL + col2 * + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab2 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 * + col1 AS col0 FROM tab0 GROUP BY col1, col0
----
0
6561

query I rowsort
SELECT - col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

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 DISTINCT col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT - col0 * - col0 FROM tab0 GROUP BY col0
----
1849
676
6889

query I rowsort
SELECT + col0 * + col0 FROM tab0 cor0 WHERE col2 IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT col2 + - + col1 AS col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-57
38
79

query I rowsort
SELECT DISTINCT - - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL IS NOT NULL )
----
15
91
92

query I rowsort
SELECT + - col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-44
-57
-6

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT col0 + col0 * + + col0 IS NOT NULL
----

query II rowsort
SELECT col2, - col2 FROM tab1 GROUP BY col2
----
45
-45
71
-71
8
-8

onlyif mysql # DIV for integer division: 
query I rowsort label-8127
SELECT DISTINCT + col1 DIV col1 + + + col1 FROM tab2 AS cor0 GROUP BY col1
----
42
60
62

skipif mysql # not compatible
query I rowsort label-8127
SELECT DISTINCT + col1 / col1 + + + col1 FROM tab2 AS cor0 GROUP BY col1
----
42
60
62

query I rowsort
SELECT ALL - col2 FROM tab2 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col0 AS col1 FROM tab1 cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - col2 + - col2 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT ALL + + col2 / col1 FROM tab2 AS cor0 GROUP BY col2, col1, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT + col1 + + col0, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
133
92
150
91
76
15

query I rowsort
SELECT DISTINCT + col1 - - - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-81
0

query I rowsort
SELECT - + col1 FROM tab0 cor0 GROUP BY col1, col2, col2 HAVING NOT + col1 IS NULL
----
-81
0
0

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col0 FROM tab0 cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 cor0 WHERE ( NULL ) IS NULL GROUP BY col0
----
-22
-28
-82

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 ALL + - col0 * - - col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 + + col1 * + col1 AS col0 FROM tab0 GROUP BY col1
----
0
6642

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + AVG ( + col0 ) + + + col0 col1 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + col0 <> ( NULL )
----

query I rowsort
SELECT ALL col2 + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query I rowsort
SELECT + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT - col0 + - + col0 AS col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col1 FROM tab2 AS cor0 GROUP BY col1, col1, col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT + col1 * col1 AS col2 FROM tab0 GROUP BY col1
----
0
6561

onlyif mysql # DIV for integer division: 
query II rowsort label-8150
SELECT ALL col2 * - - col2 AS col2, - col2 DIV - col2 FROM tab0 GROUP BY col2
----
1444
1
576
1
6241
1

skipif mysql # not compatible
query II rowsort label-8150
SELECT ALL col2 * - - col2 AS col2, - col2 / - col2 FROM tab0 GROUP BY col2
----
1444
1
576
1
6241
1

query I rowsort
SELECT col1 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

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 ALL - col0 col0 FROM tab0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT + col2 + col2 FROM tab0 AS cor0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
79
87

query I rowsort
SELECT - col1 * + - col1 + + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
1722
3540
3782

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 * + - col2 * - + col1 AS col1 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col1
----

query II rowsort
SELECT + col1 AS col0, col1 + + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
88
57
114
6
12

query I rowsort
SELECT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 WHERE NULL = NULL GROUP BY col0, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 + + col1 col0 FROM tab0 GROUP BY col1 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 ALL + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
81

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

onlyif mysql # DIV for integer division: 
query I rowsort label-8169
SELECT - col0 DIV - + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

skipif mysql # not compatible
query I rowsort label-8169
SELECT - col0 / - + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0
----
23
29
83

query I rowsort
SELECT ALL - col0 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

onlyif mysql # DIV for integer division: 
query I rowsort label-8173
SELECT DISTINCT col2 DIV col2 AS col2 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-8173
SELECT DISTINCT col2 / col2 AS col2 FROM tab2 GROUP BY col2
----
1

query I rowsort
SELECT col2 AS col1 FROM tab1 GROUP BY col0, col2, col2
----
45
71
8

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 DISTINCT + col2 + + + col2 FROM tab0 cor0 GROUP BY col0, col2
----
158
48
76

query I rowsort
SELECT ALL - col1 - + col1 AS col2 FROM tab1 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT + col0 + AVG ( ALL + + col1 ) / col1 FROM tab0 WHERE - col2 < NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL - col2 + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

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 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 * + - col2 FROM tab2 GROUP BY col1, col2 HAVING + col1 IS NOT NULL
----
-2378
-4661
-5307

query I rowsort
SELECT col0 * + - col0 FROM tab0 cor0 GROUP BY col0, col2
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + col0 FROM tab0 GROUP BY col0, col2, col0 HAVING ( - col2 * + AVG ( col1 ) ) IS NOT NULL
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab1 cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL col1 AS col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT ALL - + col1 + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT - col1 IS NOT NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col0, col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col1, col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + - col1 + - col1 AS col0 FROM tab0 AS cor0 WHERE + col1 IS NULL GROUP BY col1
----

query II rowsort
SELECT - col0 AS col2, + col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT + + col0 AS col2 FROM tab0 WHERE NULL IS NULL GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
116
158
174

query I rowsort
SELECT ALL - col2 + + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
0
0
0

query I rowsort
SELECT ALL + col1 * - - col1 FROM tab0 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1
----

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT ALL col0 + + col0 + + - col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 + - + col2 FROM tab2 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT - + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-81
0
0

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT col2 FROM tab0 GROUP BY col2, col0, col1
----
24
38
79

query I rowsort
SELECT + col0 + - col0 AS col2 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0, col1
----
0
0
0

query I rowsort
SELECT + col1 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1, col1, col1
----
44
57
6

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NOT NULL IS NULL )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8213
SELECT - - col1 DIV - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8213
SELECT - - col1 / - col1 FROM tab1 AS cor0 GROUP BY col1
----
-1
-1
-1

query I rowsort
SELECT + col0 * + col0 AS col2 FROM tab1 GROUP BY col1, col0, col2
----
484
6724
784

query I rowsort
SELECT + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( NULL ) IS NULL
----
41
59
61

query I rowsort
SELECT col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2 HAVING col2 IS NOT NULL
----
58
79
87

query I rowsort
SELECT + - col2 FROM tab0 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT DISTINCT col0 AS col2 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 - col1 col1 FROM tab0 GROUP BY col1, col0
----
-81
0
0

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 + col0 col1 FROM tab2 GROUP BY col0, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 + - AVG ( ALL - - col2 ) FROM tab2 AS cor0 GROUP BY col2 HAVING + AVG ( + - col1 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + - col2 col1 FROM tab1 AS cor0 GROUP BY col0, col2, col0
----
-45
-71
-8

query I rowsort
SELECT + col1 + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
0

query I rowsort
SELECT ALL - - col2 FROM tab2 AS cor0 WHERE NULL NOT BETWEEN ( NULL ) AND NULL GROUP BY col2
----

query I rowsort
SELECT - col2 - - col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query II rowsort
SELECT - col2, col0 FROM tab0 GROUP BY col2, col0
----
-24
43
-38
83
-79
26

query I rowsort
SELECT - col0 AS col0 FROM tab1 GROUP BY col2, col0
----
-22
-28
-82

query II rowsort
SELECT col0 AS col2, col0 * col0 * - - col0 + col0 FROM tab0 GROUP BY col0, col0
----
26
17602
43
79550
83
571870

query I rowsort
SELECT - col1 FROM tab1 cor0 WHERE - col1 IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2, col1 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 GROUP BY col0, col2, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 AS col2, + col0 col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab1 GROUP BY col0, col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 * - col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= ( NULL )
----

query I rowsort
SELECT DISTINCT col2 * col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col2, col2 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2, col1, col2
----
-45
-71
-8

query II rowsort
SELECT + col2, col2 FROM tab1 cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE NOT ( - col2 ) IS NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col1 * col1 AS col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col0 + - col0 FROM tab2 cor0 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1 HAVING NOT - col1 IS NULL
----
44
57
6

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8252
SELECT DISTINCT - + col1 DIV - col1 FROM tab2 cor0 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-8252
SELECT DISTINCT - + col1 / - col1 FROM tab2 cor0 GROUP BY col1
----
1

query I rowsort
SELECT - - col2 + - col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT + + col1 FROM tab2 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) < ( - col2 )
----

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - col2 FROM tab2 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 FROM tab1 GROUP BY col0, col1 HAVING NOT + + col0 IS NULL
----
44
57
6

query I rowsort
SELECT ALL col1 + - col1 FROM tab1 GROUP BY col1, col2
----
0
0
0

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT + col0 + + col2 - + - col2 FROM tab1 GROUP BY col0, col2
----
118
224
38

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col0, col0 AS col0 FROM tab0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT ALL col1 * col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0 HAVING NOT - + col0 IS NOT NULL
----

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
0
0
81

query I rowsort
SELECT ALL - col1 + - col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
-1722
-3540
-3782

query I rowsort
SELECT DISTINCT + col2 - + col2 FROM tab0 GROUP BY col2, col2
----
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col2 FROM tab1 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 + - - col0 AS col2 FROM tab2 GROUP BY col1, col0, col0
----
133
150
76

query I rowsort
SELECT DISTINCT - col2 - - + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 WHERE NULL < ( NULL ) GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 AS cor0 WHERE NOT + col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + - col1 * col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL col2 + - - col2 AS col0 FROM tab0 GROUP BY col2
----
158
48
76

query II rowsort
SELECT DISTINCT + col2 * col2 AS col1, + col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
58
6241
79
7569
87

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0 HAVING - AVG ( - + col1 ) NOT BETWEEN NULL AND col0
----
15

query I rowsort
SELECT col0 * - col1 FROM tab2 GROUP BY col0, col1 HAVING ( NOT ( NULL ) IS NULL )
----

query I rowsort
SELECT DISTINCT + col2 + + - col2 FROM tab2 GROUP BY col2, col1
----
0

query I rowsort
SELECT - col0 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-15
-91
-92

query II rowsort
SELECT DISTINCT - col0 AS col1, col0 AS col2 FROM tab1 GROUP BY col0, col2, col1
----
-22
22
-28
28
-82
82

query I rowsort
SELECT DISTINCT col0 + + col0 - + col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT + col1 FROM tab0 cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col1 - - col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT col1 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT - col1 FROM tab0 GROUP BY col1, col1, col2
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT - col0 - + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-19
-45
53

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT - col1 FROM tab1 cor0 WHERE col1 + - col0 IS NOT NULL GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

onlyif mysql # DIV for integer division: 
query I rowsort label-8299
SELECT col0 DIV + col0 FROM tab0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8299
SELECT col0 / + col0 FROM tab0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT + col0 AS col2 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col2, col1
----
-81
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NULL >= ( - col0 )
----

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 WHERE NULL NOT IN ( + col2 ) GROUP BY col2
----

query I rowsort
SELECT - col2 + + col1 * - col2 FROM tab1 GROUP BY col1, col2
----
-2610
-3195
-56

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 cor0 GROUP BY col0, col2, col1
----
44
57
6

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NOT NULL
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col2 * - - col2 + col2 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
3422
6320
7656

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab1 GROUP BY col0, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

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 col2, col0
----
-26
-43
-83

query I rowsort
SELECT col0 - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col2 / - col2 FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-114
-12
-88

query I rowsort
SELECT - col0 * col0 AS col1 FROM tab1 GROUP BY col0, col0
----
-484
-6724
-784

query II rowsort
SELECT DISTINCT col2, col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL <= NULL )
----

query II rowsort
SELECT col0, col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL col1 AS 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 I rowsort
SELECT DISTINCT - col0 col1 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + col1 FROM tab0 WHERE NULL <= NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col0, col1, col2
----
44
57
6

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 + col0 AS col2 FROM tab1 GROUP BY col0, col1, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 + col1 * - col1 col1 FROM tab2 WHERE NULL <> + col2 GROUP BY col1
----

query II rowsort
SELECT ALL + col2, + col2 FROM tab1 AS cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col0, col2
----
-58
-79
-87

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1, col2
----
41
59
61

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query II rowsort
SELECT DISTINCT + col1 AS col2, + col1 AS col1 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT col2 * - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL BETWEEN + col2 AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * + - col0 * - col2 col2 FROM tab1 GROUP BY col2, col0
----
-1408
-413362
-56700

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + col1 col2 FROM tab1 cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT col1 - - - col1 FROM tab1 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col2 + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
22
28
82

query I rowsort
SELECT + + col2 AS col2 FROM tab1 cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT ALL + - col0 + + + col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0 HAVING NOT + col1 IS NULL
----
-32
-51
46

query I rowsort
SELECT DISTINCT + + col1 * col1 FROM tab2 AS cor0 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - col0 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col0 AS col2 FROM tab2 GROUP BY col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1, col2
----
26
43
83

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col1, col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 - - - col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT col2 AS col2 FROM tab0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab0 WHERE NULL <> NULL GROUP BY col0, col1
----

query II rowsort
SELECT ALL col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
15
91
91
92
92

query I rowsort
SELECT + col2 + col2 FROM tab1 AS cor0 WHERE NOT NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 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 ALL - col0 col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col2 + col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
153
30
73

query I rowsort
SELECT - + col0 - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0, col0
----
-166
-52
-86

query I rowsort
SELECT + - col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 * + + col2 FROM tab2 AS cor0 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL - - col1 AS col0 FROM tab2 cor0 WHERE + col0 IS NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1
----
24
38
79

query I rowsort
SELECT col1 + + col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col2 FROM tab0 GROUP BY col2, col0, col2
----
26
43
83

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING + col1 < NULL
----

query I rowsort
SELECT DISTINCT - col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT + col2 + + col2 AS col0 FROM tab2 GROUP BY col2
----
116
158
174

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 + + col1 FROM tab0 GROUP BY col1
----
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL < + col0
----

query II rowsort
SELECT + col2, + col2 AS col2 FROM tab1 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT + col2 + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0, col2 HAVING NOT - col2 IS NULL
----

query I rowsort
SELECT - col0 FROM tab1 cor0 WHERE - col1 IS NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

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 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT + col0 + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING + col0 >= NULL
----

query I rowsort
SELECT DISTINCT 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 tab1 AS cor0 WHERE NOT - col2 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - + col1 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 GROUP BY col1, col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col2 + - col2 AS col1 FROM tab1 cor0 GROUP BY col0, col2, col2
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-8397
SELECT - - col2 - + col2 DIV col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
57
78
86

skipif mysql # not compatible
query I rowsort label-8397
SELECT - - col2 - + col2 / col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
57
78
86

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT + col1 + + col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
162

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT + - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT - col1 + - col1 - col1 * col1 AS col2 FROM tab2 cor0 GROUP BY col1, col1
----
-1763
-3599
-3843

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab1 cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT ALL col2 + col2 FROM tab2 GROUP BY col2, col2, col2 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT col0 AS col1 FROM tab0 cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 + - + col1 FROM tab1 cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col0 * col0 * + col0 col2 FROM tab1 AS cor0 GROUP BY col0
----
10648
21952
551368

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col0, col2 HAVING - - col2 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 col1 * - col1 AS col2 FROM tab0 cor0 WHERE NOT NULL <= NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col0 * + col0 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
225
8281
8464

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 AS col1, + col1 - - col1 col0 FROM tab2 GROUP BY col1
----
41
82
59
118
61
122

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 NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT - col1 * col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col1, + col2 FROM tab2 GROUP BY col2, col1
----
58
58
79
79
87
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING ( NULL ) IS NULL
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 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 tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col0 + - - col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col0 * + + col0 FROM tab0 GROUP BY col0, col2
----
1849
676
6889

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab1 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 + - - col2 col0 FROM tab1 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col1 * + + AVG ( col1 ) * + + col1 FROM tab0 GROUP BY col1, col1 HAVING NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + col2 AS col2 FROM tab2 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col1 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - + col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT + col1 FROM tab0 WHERE NULL IS NULL GROUP BY col1, col1
----
0
81

query I rowsort
SELECT ALL + col0 * - col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
-41
-59
-61

query II rowsort
SELECT + col0 AS col2, col0 + - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + col2 + - col2 FROM tab2 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL - col2 + - + col2 AS col0 FROM tab2 GROUP BY col2, col0
----
-116
-158
-174

query I rowsort
SELECT col2 AS col0 FROM tab2 GROUP BY col0, col1, col2
----
58
79
87

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 WHERE col1 IS NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - col0 FROM tab0 GROUP BY col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( - col0 * - AVG ( DISTINCT - - col0 ) ) >= ( NULL )
----

query I rowsort
SELECT ALL + + col1 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT + col0 + + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT ALL - + col1 * - col1 AS 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 * col2 * - col2 col2 FROM tab0 GROUP BY col2
----
-13824
-493039
-54872

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 + col2 - - 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 DISTINCT - col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT - + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, 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 - col2 FROM tab1 cor0 GROUP BY col1, col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - - col2 AS col2, - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
79
87

query I rowsort
SELECT + col0 AS col1 FROM tab2 cor0 GROUP BY col0, col2 HAVING + + col0 IS NULL
----

query I rowsort
SELECT + + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

onlyif mysql # DIV for integer division: 
query I rowsort label-8464
SELECT DISTINCT col2 DIV - col2 AS col2 FROM tab0 GROUP BY col2
----
-1

skipif mysql # not compatible
query I rowsort label-8464
SELECT DISTINCT col2 / - col2 AS col2 FROM tab0 GROUP BY col2
----
-1

query I rowsort
SELECT ALL + AVG ( + col2 ) AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT ( NOT ( NULL ) < NULL )
----

query I rowsort
SELECT + col0 AS col0 FROM tab1 GROUP BY col2, col2, col0 HAVING + col0 NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab1 WHERE + col0 NOT IN ( + + col2 ) GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT ALL AVG ( col0 ) AS col2 FROM tab0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-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 col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 FROM tab0 WHERE NOT ( NULL ) = NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL >= col1
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col0, col2 HAVING NOT col2 <= NULL
----

query I rowsort
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col1, col2, col2 HAVING NOT ( NOT NULL IS NULL )
----
24
38
79

query I rowsort
SELECT + col2 * + col2 * - - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
195112
493039
658503

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab2 GROUP BY 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 HAVING NULL IS NULL
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col2 HAVING NOT - - col0 IS NULL
----
22
28
82

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1 HAVING ( NOT NULL BETWEEN NULL AND NULL )
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT DISTINCT + col2 * col2 AS col0 FROM tab1 GROUP BY col2
----
2025
5041
64

query II rowsort
SELECT DISTINCT - col1, col1 FROM tab0 GROUP BY col0, col1
----
-81
81
0
0

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL - col1 + col0 AS col1 FROM tab2 GROUP BY col1, col1, col0
----
-46
32
51

query I rowsort
SELECT col1 - + col1 AS col1 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( NULL ) AND NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 + - + col2 AS col2 FROM tab0 GROUP BY col1, col2
----
0

query I rowsort
SELECT - col0 FROM tab1 GROUP BY col0 HAVING NULL BETWEEN ( + col0 ) AND NULL
----

query I rowsort
SELECT col1 + + col1 * + col1 FROM tab0 GROUP BY col1
----
0
6642

query I rowsort
SELECT ALL + col1 * col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1, col1
----
-44
-57
-6

query I rowsort
SELECT col2 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT ALL + - col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING col2 IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT - col2 FROM tab2 WHERE NULL NOT BETWEEN + + col1 AND NULL GROUP BY col2
----

query I rowsort
SELECT ALL col1 + + - col1 AS col2 FROM tab0 GROUP BY col1
----
0
0

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 DISTINCT col0 AS col0 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL AVG ( DISTINCT + col0 ) col2 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT + col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + col2 * - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING - col2 IS NOT NULL
----
-3364
-6241
-7569

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING NOT NULL <> NULL
----

query II rowsort
SELECT col2, - col2 FROM tab2 cor0 GROUP BY col1, col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT - col0 * - col0 FROM tab2 GROUP BY col0
----
225
8281
8464

onlyif mysql # DIV for integer division: 
query II rowsort label-8518
SELECT + col1, + col1 DIV - - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
1
57
1
6
1

skipif mysql # not compatible
query II rowsort label-8518
SELECT + col1, + col1 / - - col1 AS col2 FROM tab1 GROUP BY col1, col1
----
44
1
57
1
6
1

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT DISTINCT col0 + - col0 AS col1 FROM tab1 GROUP BY col1, col0
----
0

query I rowsort
SELECT + - col2 AS col2 FROM tab2 WHERE NULL = NULL GROUP BY col2
----

query I rowsort
SELECT + col1 * + col1 FROM tab2 GROUP BY col2, col1
----
1681
3481
3721

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col0, col0 HAVING NOT ( NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT col0 + - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
0

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-26
-43
-83

query I rowsort
SELECT - - col1 AS col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col1 + + col1 + - col1 AS col1 FROM tab0 GROUP BY col1
----
0
81

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 + + - col2 FROM tab2 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * + col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
-484
-6724
-784

query I rowsort
SELECT col1 * + + col1 AS col1 FROM tab1 cor0 WHERE NULL >= ( NULL ) GROUP BY col1, col1 HAVING NULL IS NULL
----

query I rowsort
SELECT ALL + col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
0
81

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL NOT BETWEEN ( NULL ) AND col1
----

query I rowsort
SELECT + col0 FROM tab0 cor0 WHERE NOT col0 IS NOT NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * col2 col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
3364
6241
7569

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
-484
-6724
-784

query II rowsort
SELECT DISTINCT + col0 AS col0, - col0 AS col2 FROM tab1 GROUP BY col0, col1
----
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 * + col2 col1 FROM tab2 GROUP BY col2, col2
----
-3364
-6241
-7569

query I rowsort
SELECT - col2 * + col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT - - col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL + - col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT + col1 FROM tab1 AS cor0 WHERE + col0 IS NULL GROUP BY col2, col1, col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE + col1 IS NULL GROUP BY col0, col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col0 * + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT + col2 FROM tab0 cor0 GROUP BY col0, col0, col2
----
24
38
79

query I rowsort
SELECT - col2 FROM tab1 cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
-45
-71
-8

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 + col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col2 col2 FROM tab0 GROUP BY col2 HAVING NOT ( ( NOT NULL IS NOT NULL ) )
----

query I rowsort
SELECT col2 - + col1 FROM tab0 GROUP BY col2, col1
----
-57
38
79

query II rowsort
SELECT ALL + + col0, + col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT DISTINCT - + col1 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
-81
0

query I rowsort
SELECT + col0 + col2 FROM tab2 GROUP BY col0, col2
----
102
150
170

onlyif mysql # DIV for integer division: 
query I rowsort label-8558
SELECT col2 DIV + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
0
0
3

skipif mysql # not compatible
query I rowsort label-8558
SELECT col2 / + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
0
0
3

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + + col0 FROM tab1 cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 GROUP BY col1, col0 HAVING + col1 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 + - col1 col0 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT - AVG ( + col2 ) * - + col2 FROM tab0 GROUP BY col2 HAVING AVG ( ALL col2 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col2 col0, col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING - + col0 IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col2, col0, col0
----
15
91
92

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 ALL col2 AS col2 FROM tab0 GROUP BY col2, col2 HAVING + col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL + 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 DISTINCT + col2 col1 FROM tab0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT ALL col2 FROM tab2 WHERE + col2 IS NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col2, col2 col2 FROM tab2 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT - + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT - col0 * col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT - - col1 FROM tab0 AS cor0 WHERE col1 BETWEEN col2 AND + col2 GROUP BY col1
----

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 * col2 + col2 FROM tab1 GROUP BY col2
----
2070
5112
72

query I rowsort
SELECT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
79
87

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col0 HAVING NOT ( NULL IS NOT NULL )
----
26
43
83

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 + col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col0, col2, col1
----
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 = col1
----

query I rowsort
SELECT ALL + + col1 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT 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 col1 col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query II rowsort
SELECT DISTINCT col1, col1 AS col0 FROM tab0 GROUP BY col1
----
0
0
81
81

query I rowsort
SELECT ALL - col0 FROM tab2 cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-15
-91
-92

query II rowsort
SELECT ALL + col0, - col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query II rowsort
SELECT ALL + col2, col2 FROM tab1 cor0 WHERE NOT NULL < NULL GROUP BY col2
----

query II rowsort
SELECT DISTINCT col1 AS col2, col1 AS col0 FROM tab2 GROUP BY col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT + + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col2 HAVING NOT - - col0 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * col0 col0 FROM tab0 AS cor0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + - col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col2 + + col2 FROM tab0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col2, col0
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1, col0 HAVING NULL >= ( col0 )
----

query I rowsort
SELECT DISTINCT + - col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + AVG ( DISTINCT col1 ) FROM tab1 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1 HAVING NULL NOT IN ( col1 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col2 FROM tab1 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col0 * + col2 / + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 col1, col2 FROM tab0 GROUP BY col2, col2
----
24
24
38
38
79
79

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT ALL + AVG ( DISTINCT - col0 ) FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT + - col0 AS col1, col0 AS col1 FROM tab2 cor0 GROUP BY col0, col1
----
-15
15
-91
91
-92
92

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT ALL - col1 AS col1 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col1, col0 HAVING NOT col0 / - - col1 * + - col1 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + col2 AS col2, - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
58
-58
79
-79
87
-87

query I rowsort
SELECT DISTINCT col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col1 * - - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT + col1 IS NULL
----
-44
-57
-6

query I rowsort
SELECT + col2 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT ALL + + col1 AS col0, + col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
43
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 - + col0 FROM tab2 GROUP BY col0, col2
----
-12
-34
72

query I rowsort
SELECT ALL - col2 AS col1 FROM tab1 cor0 GROUP BY col2, col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE NOT + col1 / - + col2 > + col2 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT + col2 AS col1 FROM tab0 WHERE NOT col0 IS NOT NULL GROUP BY col1, col2
----

query I rowsort
SELECT col0 + + col0 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL AVG ( - col2 ) AS col1 FROM tab0 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT - + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col0, col2, col1
----
0
0
81

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE NULL BETWEEN col1 * - - col1 + col1 AND NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - - col2 FROM tab0 AS cor0 WHERE ( NOT NULL IS NOT NULL ) GROUP BY col2
----
24
38
79

query I rowsort
SELECT ALL col2 AS col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 GROUP BY col0, col2 HAVING NOT NULL <= 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 - col2 + + col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL col2 + + - col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT col2 * + + col2 AS col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col1, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - col2 IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col1 + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
114
12
88

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col2
----
44
57
6

query I rowsort
SELECT + col2 + - col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 + AVG ( DISTINCT - col0 ) FROM tab0 GROUP BY col0, col1 HAVING NULL < NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8658
SELECT DISTINCT col2 DIV col2 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
query I rowsort label-8658
SELECT DISTINCT col2 / col2 FROM tab2 GROUP BY col2
----
1

query I rowsort
SELECT DISTINCT col1 + col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col1, col0 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col1
----
15
91
92

query II rowsort
SELECT DISTINCT + col1, col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - col2 * - col2 + - col2 FROM tab1 GROUP BY col2, col2
----
1980
4970
56

query I rowsort
SELECT - + col0 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT ALL - col1 * col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 + - - col0 col0 FROM tab0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT DISTINCT - col0 * - - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col1
----
-484
-6724
-784

query I rowsort
SELECT + - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

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 tab0 cor0 GROUP BY col2, col2
----
-24
-38
-79

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col0 FROM tab0 cor0 GROUP BY col2, col1
----
-81
0

query I rowsort
SELECT + - col1 AS col2 FROM tab2 AS cor0 WHERE NULL > + col0 GROUP BY col0, col2, col1
----

query I rowsort
SELECT col0 + + + col0 * - col0 * - col0 FROM tab0 GROUP BY col0
----
17602
571870
79550

query I rowsort
SELECT DISTINCT - - col1 * col1 + + col1 AS col2 FROM tab0 cor0 GROUP BY col1
----
0
6642

query I rowsort
SELECT - col0 + - - col0 FROM tab0 cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col2 * - + col2 AS col2 FROM tab0 GROUP BY col2, col2
----
-1444
-576
-6241

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col0 HAVING col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT - + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 GROUP BY col2, col1 HAVING AVG ( DISTINCT col2 ) IS NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

onlyif mysql # DIV for integer division: 
query I rowsort label-8690
SELECT ALL + + col2 DIV + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8690
SELECT ALL + + col2 / + col2 FROM tab0 AS cor0 GROUP BY col2
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col0 FROM tab1 AS cor0 WHERE NULL BETWEEN + col0 AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col0 AS col1 FROM tab0 cor0 GROUP BY col0 HAVING NOT - col0 = NULL
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * col0 FROM tab2 GROUP BY col1, col0, col0, col0 HAVING ( + col1 ) IS NULL
----

query II rowsort
SELECT AVG ( DISTINCT - col2 ), col2 FROM tab1 GROUP BY col2 HAVING NOT NULL BETWEEN ( NULL ) AND NULL
----

query I rowsort
SELECT - col1 + col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT + col1 - - + col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
162

query I rowsort
SELECT DISTINCT - - 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 + - col0 col2 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 - col1 col0 FROM tab2 WHERE NOT NULL IS NOT NULL 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 ALL col0 col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - col0 + + - col0 AS col1 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND + AVG ( ALL + col1 ) + col0
----

query I rowsort
SELECT - col2 + + col2 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col1, col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT - col2 FROM tab1 cor0 GROUP BY col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 * + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
6561

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
-15
-91
-92

query I rowsort
SELECT col1 - + col1 AS col0 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT + col0 + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
166
52
86

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL NOT BETWEEN ( NULL ) AND AVG ( col2 ) + + col1
----

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 I rowsort
SELECT DISTINCT - col2 FROM tab2 WHERE NOT - col0 IS NULL GROUP BY col2, col0
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 * col0 AS col0 FROM tab2 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT col2 + col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 * - col1 + + + col1 + + col1 + col1 * + col1 AS col2 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab2 GROUP BY col1
----
-41
-59
-61

query II rowsort
SELECT DISTINCT col1 AS col0, - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
-38
0
-79
81
-24

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col2 * col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

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 AS col1 FROM tab2 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT - col1 * + col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col0, col1
----
26
43
83

query I rowsort
SELECT ALL col0 + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8733
SELECT ALL + col1 DIV + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING + col1 IS NOT NULL
----
0
0
1

skipif mysql # not compatible
query I rowsort label-8733
SELECT ALL + col1 / + col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING + col1 IS NOT NULL
----
0
0
1

query I rowsort
SELECT + col0 * - col0 AS col0 FROM tab0 cor0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - col2 AS col1 FROM tab0 GROUP BY col0, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col0 < NULL
----

query II 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 tab2 AS cor0 GROUP BY col1, col1
----
1681
3481
3721

query I rowsort
SELECT DISTINCT + col0 FROM tab2 cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col0 HAVING NOT - col0 < + + col0
----

query I rowsort
SELECT col1 + + col1 AS col1 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT col2, col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
45
71
71
8
8

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col1
----
-41
-59
-61

query II rowsort
SELECT - col0, - col0 FROM tab2 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 tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT ALL - col2 AS col1 FROM tab0 GROUP BY col0, col2, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 col0, col2 FROM tab2 cor0 GROUP BY col2 HAVING NOT AVG ( ALL + col2 ) IS NULL
----
-58
58
-79
79
-87
87

query I rowsort
SELECT DISTINCT col1 * + - col0 AS col1 FROM tab0 GROUP BY col1, col1, col0
----
-3483
0

query I rowsort
SELECT ALL + col2 FROM tab2 GROUP BY col2, col0 HAVING NOT ( NOT NULL IS NULL )
----
58
79
87

query I rowsort
SELECT - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 IS NULL
----

query I rowsort
SELECT ALL - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT ALL col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab0 GROUP BY col0, col2
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col2, col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
92
59
91
61
15

query I rowsort
SELECT col1 + - col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col2 FROM tab0 AS cor0 GROUP BY col2 HAVING + col2 IS NOT NULL
----
24
38
79

query I rowsort
SELECT DISTINCT - - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col2 / + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col1 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NOT - col2 IS NULL
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab2 cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
-15
-91
-92

query I rowsort
SELECT - col1 + - - col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-46
32
51

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 * + col2 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 - + col0 col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT - col0 + col0 AS col1 FROM tab1 GROUP BY col0, col1 HAVING ( NULL IS NULL )
----
0
0
0

query I rowsort
SELECT + col1 AS col2 FROM tab0 WHERE col1 IS NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( + col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT + + col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL col1 + col1 AS col2 FROM tab2 GROUP BY col1, col1 HAVING NULL IS NULL
----
118
122
82

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0 HAVING - AVG ( DISTINCT col0 ) IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col0 FROM tab2 GROUP BY col0 HAVING NOT - + col0 IS NOT NULL
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 GROUP BY col1 HAVING ( 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 DISTINCT col2 AS col0 FROM tab2 AS cor0 WHERE NOT NULL <> col1 GROUP BY col2
----

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-8788
SELECT + col1 DIV col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8788
SELECT + col1 / col1 FROM tab1 AS cor0 GROUP BY col1, col0, col0
----
1
1
1

query I rowsort
SELECT + - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col0 * col0 AS col2 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query II rowsort
SELECT col1, col1 FROM tab0 AS cor0 WHERE NOT + col0 * col1 - col0 IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col1 AS col2 FROM tab1 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING - col2 / - - col2 IS NOT NULL
----
15
91
92

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 + col1 FROM tab1 cor0 GROUP BY col1, col1, col2
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + - col2 AS col1 FROM tab2 cor0 GROUP BY col0, col2
----
-58
-79
-87

query II rowsort
SELECT col0 * - col0 AS col2, col0 + + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL < ( NULL )
----

query I rowsort
SELECT - AVG ( DISTINCT - - col1 ) AS col0 FROM tab2 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col2 col1, - col2 AS col0 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 col1 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT + col1 + - col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
0
0

query I rowsort
SELECT ALL + col2 + + + col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0, col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * col2 col1 FROM tab0 WHERE NOT ( NULL ) <> NULL GROUP BY col2
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING + + col2 <> NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col2 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
138
148
99

query I rowsort
SELECT DISTINCT col2 AS col2 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 + + + col0 col0 FROM tab2 GROUP BY col2, col0
----
102
150
170

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
-41
-59
-61

query I rowsort
SELECT + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col2, col2
----
-45
-71
-8

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 >= - + col1
----

query I rowsort
SELECT DISTINCT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
41
59
61

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NULL
----
45
71
8

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 col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1
----
0
6561

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 AS col1, + col2 * - col2 col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
58
-3364
79
-6241
87
-7569

query I rowsort
SELECT + AVG ( + col0 ) + col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col2 * + + col2 AS col0 FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 AS col1 FROM tab2 GROUP BY col0, col2
----
15
91
92

query II rowsort
SELECT + col1, col1 AS col2 FROM tab2 GROUP BY col2, col1, col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col1 + - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT + + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL col0 AS col1, + col0 AS col1 FROM tab2 GROUP BY col0, col0, col0
----
15
15
91
91
92
92

query I rowsort
SELECT ALL col1 FROM tab2 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT ALL - col0 + - col0 AS col0 FROM tab1 GROUP BY col2, col0
----
-164
-44
-56

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 * - col2 + + + col2 col1 FROM tab1 GROUP BY col2
----
-1980
-4970
-56

query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT - col0, col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 AS cor0 WHERE col1 IS NOT NULL GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT + + col0 * - col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NOT ( col1 + + + col2 ) IS NULL GROUP BY col1
----
44
57
6

query II rowsort
SELECT DISTINCT - col0 AS col0, + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
22
-28
28
-82
82

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT - - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col1, col1, col0
----
44
57
6

query I rowsort
SELECT col1 + + col1 AS col0 FROM tab1 GROUP BY col1, col1
----
114
12
88

query I rowsort
SELECT DISTINCT - col1 * + + col1 AS col1 FROM tab0 GROUP BY col1, col0
----
-6561
0

query I rowsort
SELECT DISTINCT - AVG ( + col0 ) AS col1 FROM tab2 WHERE ( NOT NULL >= + col0 ) GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 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 FROM tab0 cor0 GROUP BY col0, col2
----
26
43
83

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL BETWEEN ( NULL ) AND col2
----

query I rowsort
SELECT - col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

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 ALL + col2 + + col2 + + col2 * - col0 + col0 col0 FROM tab1 GROUP BY col2, col0, col1
----
-1142
-138
-5598

query I rowsort
SELECT - + col0 AS col1 FROM tab1 WHERE NOT NULL <= col0 GROUP BY col0
----

query I rowsort
SELECT + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + - col2 col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT + AVG ( DISTINCT + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NULL ) > ( NULL )
----

query I rowsort
SELECT ALL + + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT ALL + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

onlyif mysql # DIV for integer division: 
query I rowsort label-8871
SELECT - col2 DIV - col2 FROM tab0 GROUP BY col2
----
1
1
1

skipif mysql # not compatible
query I rowsort label-8871
SELECT - col2 / - col2 FROM tab0 GROUP BY col2
----
1
1
1

query I rowsort
SELECT col2 + - + col2 FROM tab1 GROUP BY col2
----
0
0
0

query I rowsort
SELECT DISTINCT - col0 AS col0 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

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 * - col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
-132
-1596
-3608

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 AS cor0 WHERE NULL <> NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 GROUP BY col1, col2, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab1 WHERE - col1 IS NOT NULL GROUP BY col0
----
484
6724
784

query I rowsort
SELECT DISTINCT - + col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8881
SELECT ALL + col2 DIV - + col2 AS col1 FROM tab0 GROUP BY col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8881
SELECT ALL + col2 / - + col2 AS col1 FROM tab0 GROUP BY col2
----
-1
-1
-1

query I rowsort
SELECT ALL - AVG ( ALL + col0 ) AS col1 FROM tab0 GROUP BY col0 HAVING + AVG ( DISTINCT - col2 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 AS cor0 WHERE NOT col2 IS NOT NULL GROUP BY col2, col2
----

query I rowsort
SELECT ALL - col2 * - + col2 FROM tab0 GROUP BY col2, col2
----
1444
576
6241

query I rowsort
SELECT col0 + + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col0
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-8886
SELECT ALL col2 DIV - col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-8886
SELECT ALL col2 / - col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-1
-1
-1

query I rowsort
SELECT - col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT - col2 + + + col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 AS col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT ALL + col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL - col1 * + col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT + + col2 * + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
1444
576
6241

query I rowsort
SELECT + col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
45
71
8

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT + AVG ( + + col2 ) FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col0 * + + col0 FROM tab0 cor0 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NULL < NULL
----

query I rowsort
SELECT DISTINCT + col0 AS col2 FROM tab2 cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab0 GROUP BY col2 HAVING + col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 + + col2 * col2 FROM tab2 GROUP BY col2, col2
----
3422
6320
7656

query I rowsort
SELECT - col2 FROM tab2 AS cor0 WHERE NOT - col1 * + col0 IS NULL GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT ALL + + col1 * col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col2 FROM tab0 WHERE + col0 IS NULL GROUP BY col1, col0, col2
----

query I rowsort
SELECT ALL col0 * + col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - - col2 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - - col0 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT DISTINCT col0 - col0 AS col2 FROM tab0 GROUP BY col0
----
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT ( + - col2 ) <= ( NULL )
----

query I rowsort
SELECT col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT ( NOT ( NOT - col0 IS NULL ) )
----
0
0
81

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col0 HAVING - col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 * + col1 col1, col1 FROM tab0 GROUP BY col1
----
-6561
81
0
0

query I rowsort
SELECT ALL col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT col2 + + col2 FROM tab1 AS cor0 GROUP BY col2
----
142
16
90

query I rowsort
SELECT + col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
22
28
82

query II rowsort
SELECT DISTINCT - col2, col2 FROM tab0 GROUP BY col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT ALL + + col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
0
0
81

query I rowsort
SELECT ALL + AVG ( col2 ) FROM tab2 GROUP BY col2 HAVING NULL = NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + - col1 AS col0 FROM tab2 cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT ALL - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT + col2 + - col0 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col2 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 * - col0 col2 FROM tab2 AS cor0 GROUP BY col0
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT - col0 + - col2 FROM tab0 GROUP BY col0, col2
----
-105
-121
-67

query II rowsort
SELECT col2 AS col1, - col2 FROM tab1 GROUP BY col2
----
45
-45
71
-71
8
-8

query I rowsort
SELECT DISTINCT + + col1 AS col0 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 col0 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT + + col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 AS col0 FROM tab2 GROUP BY col1, col2, col1 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT col1 AS col0 FROM tab0 GROUP BY col2, col2, col1
----
0
0
81

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + + col0 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

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 - col2 + - col2 col0 FROM tab0 GROUP BY col2
----
-158
-48
-76

query I rowsort
SELECT + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + col0 IS NOT NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT + + col2 * - col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col2
----
-1444
-576
-6241

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 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
15
91
92

query I rowsort
SELECT DISTINCT + - col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT - col2 * + + col0 + - col2 AS col1 FROM tab2 GROUP BY col2, col0
----
-1392
-5394
-7268

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 GROUP BY col1, col2, col2
----
58
79
87

query I rowsort
SELECT + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col2 + - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT + col1 * - col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col1 * - col1 + + col1 * col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT - - col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col0 * - col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col2 col1 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT ALL - col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col2, - col2 AS col1 FROM tab2 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT ALL - col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 cor0 GROUP BY col0, col1, col1
----
-81
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - + col2 col0, col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( - + col2 >= NULL )
----

query I rowsort
SELECT + - col2 + + - col2 FROM tab2 cor0 GROUP BY col2, col0
----
-116
-158
-174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 * col2 col0 FROM tab0 GROUP BY col0, col2 HAVING NOT - - col2 NOT BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + + col2 * col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT ALL - + col2 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT col2 * + col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT DISTINCT - + col0 FROM tab2 cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL - col2 FROM tab0 GROUP BY col2, col1
----
-24
-38
-79

query I rowsort
SELECT ALL - col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2
----
-45
-71
-8

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NOT NULL IS NOT NULL
----
44
57
6

query I rowsort
SELECT - col0 + - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 * + col0 * col0 col2 FROM tab2 GROUP BY col1, col0
----
3375
753571
778688

query I rowsort
SELECT - col2 FROM tab0 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 col1 FROM tab1 AS cor0 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT ALL col0 FROM tab1 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL + col0 * col2 FROM tab0 GROUP BY col0, col2
----
1032
2054
3154

query I rowsort
SELECT col0 * + col1 FROM tab0 GROUP BY col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col2 + col2 FROM tab2 GROUP BY col2, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1, - col1 col0 FROM tab1 GROUP BY col1
----
44
-44
57
-57
6
-6

query II rowsort
SELECT + col2 AS col0, col2 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-1444
-576
-6241

query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab1 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT + col2 AS col1 FROM tab0 GROUP BY col2, col2, col1
----
24
38
79

query I rowsort
SELECT ALL - + col0 * - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col0
----
-1849
-676
-6889

query I rowsort
SELECT ALL + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT + col0 AS col2 FROM tab1 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT ALL col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col1 = NULL
----

query I rowsort
SELECT DISTINCT + col2 + - - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col1
----
116
158
174

query I rowsort
SELECT + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query II rowsort
SELECT DISTINCT + col2, col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col2 * + + col2 * - col2 AS col1 FROM tab1 GROUP BY col2
----
-357911
-512
-91125

query I rowsort
SELECT col2 FROM tab2 WHERE NOT - col0 - - col2 * col0 IS NOT NULL GROUP BY col2
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1, col0, col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 GROUP BY col2, col2, col0
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + + col2 col2 FROM tab2 GROUP BY col2
----
116
158
174

query II rowsort
SELECT ALL + AVG ( col1 ), - col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + AVG ( - col1 ) / + col1 + col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT AVG ( DISTINCT + col1 ) FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 GROUP BY col2, col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT - + AVG ( ALL - col0 ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col1, col0, col0 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT - col0 * - - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab0 cor0 WHERE NULL <> col0 GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
15
91
92

query I rowsort
SELECT + - col0 FROM tab0 cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT col1 + - col0 - col1 FROM tab2 GROUP BY col0, col1
----
-15
-91
-92

query I rowsort
SELECT ALL + col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT ALL - + col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

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 ALL - col0 col2 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <> - col2
----

query I rowsort
SELECT - col1 * - col1 AS col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + + col0 * + col0 col1 FROM tab1 GROUP BY col0
----
506
6806
812

query I rowsort
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col0 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
-58
-79
-87

query I rowsort
SELECT ALL + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col0 AS col2, col1 col1 FROM tab2 AS cor0 GROUP BY col0, col0, col1
----
-15
61
-91
59
-92
41

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 cor0 GROUP BY col2, col1
----
0
81

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
-26
-43
-83

query I rowsort
SELECT ALL + col1 * col1 FROM tab0 AS cor0 GROUP BY col1
----
0
6561

query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 cor0 GROUP BY col2, col0
----
58
79
87

query I rowsort
SELECT col0 * - col0 FROM tab0 AS cor0 WHERE NULL IS NULL AND ( NULL ) IN ( + col0 ) GROUP BY col0
----

query I rowsort
SELECT col0 FROM tab1 cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT col0 - - col0 FROM tab2 GROUP BY col0
----
182
184
30

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING ( NULL ) = col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT col2 * + col2 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
2025
5041
64

query I rowsort
SELECT DISTINCT - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NOT ( NOT NULL IS NULL )
----
45
71
8

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 AS col1 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
58
79
87

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 ALL + col0 * + col0 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col0 FROM tab2 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + col1 AS col0 FROM tab1 GROUP BY col1, col1 HAVING NULL IS NULL
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col1, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col0 FROM tab2 GROUP BY col1, col2, col0
----
58
79
87

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT + - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT - col2 * + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
-2025
-5041
-64

query I rowsort
SELECT DISTINCT + col0 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
15
91
92

query I rowsort
SELECT ALL - col2 * col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT ALL + col0 AS col0 FROM tab0 GROUP BY col1, col0, col0, col0
----
26
43
83

query I rowsort
SELECT DISTINCT col1 FROM tab2 cor0 GROUP BY col0, col1, col0 HAVING ( NOT - col1 > NULL )
----

query I rowsort
SELECT col1 + col1 FROM tab1 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col1 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + - col1 + - col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NULL GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT - col1 - col1 AS col0 FROM tab0 GROUP BY col1, col1, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - AVG ( ALL - col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT + col2 * + col2 + + - col2 AS col2 FROM tab2 GROUP BY col2
----
3306
6162
7482

query I rowsort
SELECT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
-45
-71
-8

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 DISTINCT col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col0 * col1 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col0 + - col0 FROM tab1 GROUP BY col0
----
0

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2 HAVING - col2 > NULL
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab1 cor0 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col0, col1 HAVING ( - col0 ) = NULL
----

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col2, col0, col0
----
-58
-79
-87

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT - + col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1, col0
----
-26
-43
-83

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col0 + - col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - col2 * + + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT col1 AS col2 FROM tab1 cor0 GROUP BY col1, col2
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col2 FROM tab2 cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT - + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col0
----
-24
-38
-79

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT DISTINCT + + col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - + col0 + + col0 + - AVG ( DISTINCT col0 ) * col0 + + + col0 FROM tab1 AS cor0 WHERE NOT col1 * col2 IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT DISTINCT + col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col1, col0
----
41
59
61

query I rowsort
SELECT col2 * + col1 AS col2 FROM tab2 GROUP BY col1, col2
----
2378
4661
5307

query I rowsort
SELECT col0 + + col0 * - col0 AS col1 FROM tab1 GROUP BY col0
----
-462
-6642
-756

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col2 FROM tab2 GROUP BY col2, col0
----
15
91
92

query II rowsort
SELECT DISTINCT + col2 AS col0, - col2 + col2 * col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
3306
79
6162
87
7482

query I rowsort
SELECT DISTINCT col0 * + col0 AS col2 FROM tab0 GROUP BY col0
----
1849
676
6889

onlyif mysql # DIV for integer division: 
query I rowsort label-9104
SELECT DISTINCT - col1 DIV col1 FROM tab2 AS cor0 WHERE NOT + col2 IS NULL GROUP BY col1
----
-1

skipif mysql # not compatible
query I rowsort label-9104
SELECT DISTINCT - col1 / col1 FROM tab2 AS cor0 WHERE NOT + col2 IS NULL GROUP BY col1
----
-1

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT ALL - AVG ( + col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT + + col0 IS NOT NULL
----

query II rowsort
SELECT DISTINCT + col1, - col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
44
-44
57
-57
6
-6

query I rowsort
SELECT ALL + col0 * + col0 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col1 col1 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT + col1 * - col1 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT ALL + col1 * + + col1 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col1, col1, col1
----
0
6561

query I rowsort
SELECT - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col0 - col0 FROM tab0 GROUP BY col0, col0
----
0

query I rowsort
SELECT - col0 + + col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 + - - col1 AS col0 FROM tab1 cor0 GROUP BY col2, col1
----
0

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-81
0

query I rowsort
SELECT - col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NOT NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab2 GROUP BY col1, col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT ALL + - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 WHERE col1 IS NOT NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT col0 FROM tab2 GROUP BY col1, col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col2, col0 HAVING + col2 <> col0
----

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
41
59
61

query I rowsort
SELECT col2 * col1 FROM tab1 GROUP BY col2, col1
----
2565
3124
48

query II rowsort
SELECT ALL col1, col1 * col1 FROM tab1 GROUP BY col1, col2
----
44
1936
57
3249
6
36

onlyif mysql # DIV for integer division: 
query I rowsort label-9127
SELECT col2 DIV - col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-1
0
0

skipif mysql # not compatible
query I rowsort label-9127
SELECT col2 / - col0 AS col0 FROM tab1 GROUP BY col0, col2
----
-1
0
0

query I rowsort
SELECT ALL AVG ( - - col1 ) FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col1 FROM tab0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
26
43
83

query I rowsort
SELECT - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NOT NULL IS NOT NULL ) )
----
-24
-38
-79

query I rowsort
SELECT + col2 * - col2 FROM tab1 GROUP BY col1, col2, col2
----
-2025
-5041
-64

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NULL NOT IN ( + + col0 )
----

query I rowsort
SELECT DISTINCT + col2 * + - col2 FROM tab2 GROUP BY col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col2 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col0, col1
----
-22
-28
-82

query I rowsort
SELECT - + col2 FROM tab2 AS cor0 GROUP BY col2, col1, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col1 + + col1 col2 FROM tab0 GROUP BY col1
----
0
162

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col1, col0, col1 HAVING - col1 IS NOT NULL
----
-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 DISTINCT + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

query I rowsort
SELECT ALL - + col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT ALL - - col2 * + col2 FROM tab2 AS cor0 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + col1 + - col1 + + - col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2
----
-12
-34
72

query II rowsort
SELECT DISTINCT col0, - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab0 AS cor0 GROUP BY col0, 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 - col1 + AVG ( ALL + col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
59
61

query I rowsort
SELECT - col0 * col0 FROM tab0 cor0 GROUP BY col0
----
-1849
-676
-6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 * - + col1 - + col1 * + col1 col0 FROM tab1 AS cor0 GROUP BY col1, col0 HAVING NOT col0 IS NOT NULL
----

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL NOT BETWEEN - col2 * + col1 AND NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT - - col0 AS col1 FROM tab0 cor0 GROUP BY col0, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT DISTINCT - - col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING col1 IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 AS col0 FROM tab1 WHERE NOT NULL <= ( - + col0 ) GROUP BY col1 HAVING NULL > ( col1 * + col0 )
----

query II rowsort
SELECT col2 AS col1, col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - + col0 col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-26
-43
-83

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( NULL ) IS NULL
----
15
91
92

query I rowsort
SELECT ALL col1 AS col2 FROM tab0 GROUP BY col1, col0
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col1 col2 FROM tab1 GROUP BY col1
----
44
57
6

query I rowsort
SELECT - col2 AS col2 FROM tab1 WHERE + col0 IS NOT NULL GROUP BY col2
----
-45
-71
-8

query II rowsort
SELECT ALL col2, - col2 FROM tab2 GROUP BY col2
----
58
-58
79
-79
87
-87

query I rowsort
SELECT - col2 - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 FROM tab0 cor0 GROUP BY col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
-24
-38
-79

query II rowsort
SELECT ALL - col2 + - col2, col2 FROM tab1 AS cor0 GROUP BY col2
----
-142
71
-16
8
-90
45

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col1, col2
----
0
81

query I rowsort
SELECT + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING - col1 IS NOT NULL
----
15
91
92

query I rowsort
SELECT col2 + + col2 FROM tab2 GROUP BY col2, col2 HAVING col2 IS NULL
----

query I rowsort
SELECT + - col0 AS col0 FROM tab0 AS cor0 WHERE NOT NULL > col0 GROUP BY col0
----

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NULL BETWEEN NULL AND - - col2
----

query I rowsort
SELECT + - col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT + col1 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL - - col2 AS col1 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + - col0 AS col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1 HAVING NULL IS NULL
----
0
81

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 AVG ( DISTINCT - col0 ) FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col2, col0 HAVING NULL IS NULL
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col1 FROM tab2 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL <= col0
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 WHERE ( col1 ) IS NOT NULL GROUP BY col0
----
26
43
83

query I rowsort
SELECT - col0 AS col2 FROM tab0 cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT - col0 AS col1 FROM tab1 GROUP BY col0, col2 HAVING col2 IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
0
0
81

query I rowsort
SELECT ALL + col0 + - col0 FROM tab2 cor0 GROUP BY col0, col0
----
0
0
0

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col0, col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT + col2 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT DISTINCT col1 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 WHERE NOT ( col1 ) NOT BETWEEN NULL AND col1 + col0 GROUP BY col0, col1
----

query I rowsort
SELECT col0 AS col2 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 WHERE ( NULL ) <= NULL GROUP BY col2, col0
----

query I rowsort
SELECT ALL + col1 AS col2 FROM tab1 GROUP BY col2, col1, col2
----
44
57
6

query I rowsort
SELECT - col1 + + col1 FROM tab1 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab2 cor0 WHERE NOT col1 IS NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL col1 FROM tab1 GROUP BY col2, col1 HAVING - col2 IS NOT NULL
----
44
57
6

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT col0 - - col0 AS col1 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab0 WHERE ( NULL ) IS NOT NULL GROUP BY col0 HAVING NULL IS NULL
----

query I rowsort
SELECT col0 + col0 FROM tab0 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0, col2
----

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col1, col1 AS col1 FROM tab1 GROUP BY col1, col0
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 GROUP BY col1 HAVING NULL < NULL
----

query I rowsort
SELECT col2 + - col2 AS col2 FROM tab1 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT - + col1 FROM tab0 cor0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col2
----
24
38
79

query I rowsort
SELECT + col2 * - col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1305
-5336
-7189

query I rowsort
SELECT ALL + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT + col0 FROM tab2 GROUP BY col2, col0 HAVING NOT + col2 <= NULL
----

query I rowsort
SELECT ALL col1 * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col0, col2
----
15
91
92

query I rowsort
SELECT ALL - col1 FROM tab2 AS cor0 GROUP BY col2, col2, col1 HAVING ( NULL IS NULL )
----
-41
-59
-61

query I rowsort
SELECT ALL col2 AS 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 DISTINCT col2 col2 FROM tab2 GROUP BY col2, col1
----
58
79
87

query I rowsort
SELECT ALL + col2 FROM tab2 cor0 GROUP BY col2, col0 HAVING NOT col0 < - + col2
----
58
79
87

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 ALL + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL IS NOT NULL
----
24
38
79

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
116
158
174

query II rowsort
SELECT - col0 AS col0, col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col1 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col2 HAVING AVG ( DISTINCT col2 ) IS NULL
----

query I rowsort
SELECT ALL - col0 - + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL > NULL
----

query I rowsort
SELECT - 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 GROUP BY col2, col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2
----

query I rowsort
SELECT - col0 AS col1 FROM tab0 cor0 GROUP BY col2, col0, col0
----
-26
-43
-83

query I rowsort
SELECT ALL - col0 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT ( ( NULL IS NOT NULL ) )
----
-26
-43
-83

query I rowsort
SELECT - - col1 - - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT + + col0 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
22
28
82

query I rowsort
SELECT ALL col2 FROM tab0 cor0 GROUP BY col2, col2, col0
----
24
38
79

query I rowsort
SELECT ALL + col0 + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL >= NULL )
----

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col1, col2 HAVING ( NOT ( col2 ) IS NOT NULL )
----

query I rowsort
SELECT ALL - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT + col2 * + - col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + - col0 + - col0 AS col2 FROM tab2 WHERE NOT NULL BETWEEN NULL AND NULL GROUP BY col0
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT DISTINCT col0 / col0 FROM tab2 GROUP BY col0, col0 HAVING ( + col0 ) IS NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT ( col2 ) = NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT + + col1 FROM tab1 WHERE NOT + + col1 IS NULL GROUP BY col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL + - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + - col1 col0 FROM tab1 GROUP BY col1, col0, col1
----
-114
-12
-88

query I rowsort
SELECT + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col2, - col2 col1 FROM tab2 AS cor0 GROUP BY col2
----
-58
-58
-79
-79
-87
-87

query I rowsort
SELECT col2 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NULL
----
45
71
8

query I rowsort
SELECT ALL col2 + + + AVG ( DISTINCT - col2 ) AS col1 FROM tab1 AS cor0 WHERE NULL <= NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

query I rowsort
SELECT col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + - col1 FROM tab0 AS cor0 GROUP BY col2, col1
----
-81
0
0

query I rowsort
SELECT ALL + col0 * + col2 FROM tab2 GROUP BY col0, col2
----
1305
5336
7189

query I rowsort
SELECT ALL - col2 * + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL + col1 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT DISTINCT + col1 + - col1 AS col2 FROM tab1 GROUP BY col1, col0
----
0

query I rowsort
SELECT ALL - col2 + + col2 FROM tab0 AS cor0 GROUP BY col2
----
0
0
0

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
0
81

query I rowsort
SELECT ALL + col2 * col2 AS col1 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col0, col1, col1 HAVING NOT - col1 >= NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL NOT BETWEEN NULL AND NULL
----

query II rowsort
SELECT + - col0, col0 FROM tab1 cor0 GROUP BY col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT - + col0 FROM tab0 AS cor0 GROUP BY col1, col0
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab2 GROUP BY col1, 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 col2, col2
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 * col2 col1 FROM tab2 AS cor0 GROUP BY col2, col0
----
1305
5336
7189

query I rowsort
SELECT - col1 + col1 AS col2 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT col2 FROM tab0 GROUP BY col1, col2, col1
----
24
38
79

query I rowsort
SELECT + - col2 AS col0 FROM tab0 cor0 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 + col1 col1 FROM tab0 AS cor0 GROUP BY col1, col0
----
0
0
81

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
58
79
87

query I rowsort
SELECT - col1 + - col1 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-162
0

query I rowsort
SELECT + col0 FROM tab2 WHERE NOT + col2 IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT DISTINCT - - col2 - col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
0

query I rowsort
SELECT DISTINCT - col0 FROM tab2 AS cor0 WHERE col1 IS NOT NULL GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT ALL + - col1 FROM tab0 cor0 GROUP BY col1
----
-81
0

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-15
-91
-92

query I rowsort
SELECT + col1 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
0
0
0

query I rowsort
SELECT + - col1 AS col0 FROM tab2 cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT ALL col1 + + + col1 FROM tab1 GROUP BY col1
----
114
12
88

query I rowsort
SELECT col1 - col0 AS col0 FROM tab1 GROUP BY col1, col0
----
-16
-38
29

query I rowsort
SELECT + col1 AS col1 FROM tab1 WHERE - - col2 = NULL GROUP BY col2, col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
58
79
87

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col1 HAVING NOT NULL <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 + col1 col1 FROM tab0 GROUP BY col2, col2, col1
----
105
38
79

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col1, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-118
-122
-82

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab1 cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col0 FROM tab2 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - - col1 FROM tab1 cor0 GROUP BY col1, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - AVG ( + col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NOT NULL
----

query I rowsort
SELECT - col2 + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
0
0
0

onlyif mysql # DIV for integer division: 
query I rowsort label-9308
SELECT ALL col1 DIV + col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9308
SELECT ALL col1 / + col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

query I rowsort
SELECT + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING AVG ( ALL col2 ) IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL + col1 FROM tab2 AS cor0 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT col0 + - col0 FROM tab0 AS cor0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1, col2, col1
----
44
57
6

query I rowsort
SELECT - col1 * + col1 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + + col0 IS NOT NULL
----
-24
-38
-79

query I rowsort
SELECT - + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
-58
-79
-87

query II rowsort
SELECT col1 AS col0, + col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
44
57
57
6
6

query I rowsort
SELECT + col0 * - col0 FROM tab0 GROUP BY col0, col1
----
-1849
-676
-6889

query I rowsort
SELECT ALL + + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT ALL - + col0 AS col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2, col2 HAVING ( NOT NULL IS NOT NULL )
----
-41
-59
-61

query I rowsort
SELECT ALL col2 FROM tab2 GROUP BY col2, col1, col2
----
58
79
87

query I rowsort
SELECT + - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT + + col0 + - col0 FROM tab0 cor0 GROUP BY col0
----
0
0
0

query II rowsort
SELECT col0 + - - col0, col2 * + col2 * + col2 FROM tab1 AS cor0 WHERE ( NULL ) NOT IN ( - col1 ) GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT + AVG ( DISTINCT + col0 ) FROM tab2 GROUP BY col0 HAVING NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT - col1 AS col1 FROM tab0 GROUP BY col1, col1
----
-81
0

query I rowsort
SELECT ALL + col1 * + - col2 AS col0 FROM tab2 GROUP BY col1, col2
----
-2378
-4661
-5307

query I rowsort
SELECT DISTINCT col0 + - + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-38
26
83

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col2, col2, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT - col0 - col0 AS col0 FROM tab2 GROUP BY col0
----
-182
-184
-30

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 cor0 GROUP BY col2, col0 HAVING NOT - col0 IS NULL
----
-22
-28
-82

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 + col1 col0 FROM tab1 GROUP BY col2, col1
----
102
115
14

query I rowsort
SELECT DISTINCT + + col0 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 WHERE + col1 >= - - col2 AND NULL IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT ALL col2 AS 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 ALL - col2 col1 FROM tab0 cor0 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 col2, col2, col0 HAVING ( ( NULL ) NOT IN ( - AVG ( + col0 ) ) )
----

query I rowsort
SELECT - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab2 AS cor0 GROUP BY col0, 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 col2 * - - col2 AS col0 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT + col1 * col1 - col1 FROM tab1 AS cor0 GROUP BY col1
----
1892
30
3192

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 col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL <= NULL
----

query I rowsort
SELECT - col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT + col2 FROM tab1 AS cor0 WHERE ( NULL ) >= NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab1 GROUP BY col2, col1, col1
----
44
57
6

query I rowsort
SELECT ALL + col0 * col1 - - col1 FROM tab2 GROUP BY col2, col1, col0
----
3813
5428
976

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 FROM tab1 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col2 * - col2 * col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT + col2 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col1 FROM tab2 GROUP BY col2, col2, col0
----
-58
-79
-87

query I rowsort
SELECT - + col2 * - col1 AS col0 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

query I rowsort
SELECT - col0 FROM tab1 cor0 GROUP BY col2, col0 HAVING NULL NOT BETWEEN NULL AND ( + col0 )
----

query I rowsort
SELECT DISTINCT col2 + + col2 AS col2 FROM tab0 GROUP BY col2
----
158
48
76

query I rowsort
SELECT + + col2 AS col2 FROM tab0 cor0 GROUP BY col2, col1, col1
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-9361
SELECT DISTINCT col0 DIV + col0 AS col0 FROM tab0 GROUP BY col1, col0
----
1

skipif mysql # not compatible
query I rowsort label-9361
SELECT DISTINCT col0 / + col0 AS col0 FROM tab0 GROUP BY col1, col0
----
1

query I rowsort
SELECT + col2 * col0 AS col2 FROM tab0 GROUP BY col2, col0
----
1032
2054
3154

query I rowsort
SELECT DISTINCT + col2 FROM tab1 WHERE NULL IS NULL GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT DISTINCT AVG ( col1 ) FROM tab0 WHERE NULL IS NOT NULL GROUP BY col1, col1, col2
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col2 FROM tab2 GROUP BY col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT - - col0 AS col1 FROM tab0 WHERE - - col2 >= + + col0 GROUP BY col0
----
26

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 tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0, col2
----
-58
-79
-87

query I rowsort
SELECT ALL + col2 + - col2 FROM tab2 AS cor0 GROUP BY col2 HAVING + col2 IS NULL
----

query II rowsort
SELECT ALL + col0 AS col1, - col0 AS col1 FROM tab0 GROUP BY col0
----
26
-26
43
-43
83
-83

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) <> NULL
----

query II rowsort
SELECT ALL - col2, + col2 / col2 / - col2 FROM tab2 WHERE NOT ( NULL ) > NULL GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 FROM tab1 GROUP BY col1, col1 HAVING NULL < NULL
----

query I rowsort
SELECT - col1 + + - col1 AS col2 FROM tab2 cor0 GROUP BY col1
----
-118
-122
-82

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 I rowsort
SELECT ALL + col2 * + col2 col1 FROM tab0 cor0 GROUP BY col2
----
1444
576
6241

query II rowsort
SELECT DISTINCT + col0, - col0 + col0 FROM tab2 GROUP BY col0
----
15
0
91
0
92
0

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT + col0 AS col1 FROM tab1 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 WHERE NOT col2 IS NULL GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9387
SELECT ALL - + col2 DIV col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9387
SELECT ALL - + col2 / col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0
----
-1
-1
-1

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col0, col2, col0
----
-45
-71
-8

query I rowsort
SELECT col1 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1, col2
----
44
57
6

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 + + col2 AS col1 FROM tab0 GROUP BY col2, col2
----
158
48
76

query I rowsort
SELECT col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT + col2 AS col0 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT ALL - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 col0 FROM tab1 AS cor0 WHERE NOT NULL <> col1 GROUP BY col1
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT - - col2 FROM tab0 cor0 GROUP BY col1, col0, col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 AS col0, col1 col0 FROM tab0 GROUP BY col1
----
-81
81
0
0

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col1 * + col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT DISTINCT + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col1, col2 HAVING AVG ( + col0 ) IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 * - col2, + col0 col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
-1032
43
-2054
26
-3154
83

query I rowsort
SELECT ALL - - col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9408
SELECT - col1 DIV - col1 FROM tab1 GROUP BY col1 HAVING NOT ( + - col1 ) IS NULL
----
1
1
1

skipif mysql # not compatible
query I rowsort label-9408
SELECT - col1 / - col1 FROM tab1 GROUP BY col1 HAVING NOT ( + - col1 ) IS NULL
----
1
1
1

query II rowsort
SELECT - col0 AS col1, + col0 AS col2 FROM tab0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT - col2 AS col2 FROM tab1 GROUP BY col2, col1 HAVING NULL IS NULL
----
-45
-71
-8

query I rowsort
SELECT - col1 - + col1 AS col2 FROM tab2 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT + AVG ( DISTINCT - col1 ) FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING col0 IS NULL
----

query I rowsort
SELECT - - col2 * - col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT - col2 AS col2 FROM tab2 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col2, col1
----
44
57
6

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 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 col1 + + + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
118
122
82

query I rowsort
SELECT col1 + + col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT - + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT col1 * col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT - col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
-24
-38
-79

query II rowsort
SELECT 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 - col1 col0 FROM tab2 AS cor0 GROUP BY col1, col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col0 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-484
-6724
-784

query I rowsort
SELECT DISTINCT + - col1 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
-41
-59
-61

query I rowsort
SELECT ALL col0 AS col2 FROM tab2 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-118
-122
-82

query I rowsort
SELECT col0 * - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-225
-8281
-8464

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 + col2 AS col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT ALL - - col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82

query I rowsort
SELECT ALL + col1 - - col1 FROM tab0 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 tab1 AS cor0 GROUP BY col1
----
-44
-57
-6

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col0 col1 FROM tab1 GROUP BY col0, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - + col2 col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query I rowsort
SELECT DISTINCT + - col2 + + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col2
----
0

query I rowsort
SELECT - - AVG ( DISTINCT col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab2 cor0 GROUP BY col1, col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1, col2, col1
----
0
81

query I rowsort
SELECT DISTINCT - col0 - - col0 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL < NULL
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0 HAVING NOT - col0 IS NOT NULL
----

query I rowsort
SELECT col1 FROM tab2 GROUP BY col1, col0 HAVING NOT + col1 IS NOT NULL
----

query I rowsort
SELECT col0 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

query I rowsort
SELECT ALL - col0 + col0 * col0 + - col0 FROM tab2 GROUP BY col0
----
195
8099
8280

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
0
0
81

query I rowsort
SELECT col2 AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT + + col0 AS col1 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - AVG ( - col2 ) AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NOT ( NULL ) = NULL )
----

query I rowsort
SELECT ALL + col2 + + col2 AS col1 FROM tab2 GROUP BY col2 HAVING NULL <> NULL
----

query I rowsort
SELECT col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT BETWEEN NULL AND + AVG ( col2 )
----

query I rowsort
SELECT col0 * col0 AS col1 FROM tab2 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT + AVG ( DISTINCT - col0 ) FROM tab2 GROUP BY col0, col2 HAVING ( NULL ) NOT BETWEEN - col0 AND ( NULL )
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0, col2, col0 HAVING NULL <> ( NULL )
----

query I rowsort
SELECT col1 FROM tab2 WHERE NOT ( + col1 ) NOT BETWEEN col1 AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
-26
-43
-83

query II rowsort
SELECT + col2, col2 FROM tab2 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT + - col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL >= ( NULL )
----

query I rowsort
SELECT + + col0 + + + col0 AS col1 FROM tab2 WHERE NULL IS NULL GROUP BY col0
----
182
184
30

onlyif mysql # DIV for integer division: 
query I rowsort label-9470
SELECT - col0 DIV col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9470
SELECT - col0 / col0 FROM tab1 AS cor0 GROUP BY col0
----
-1
-1
-1

query I rowsort
SELECT ALL col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col1, col0
----
-81
0
0

query I rowsort
SELECT col2 * - - col2 AS col2 FROM tab2 GROUP BY col2, col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT 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 I rowsort
SELECT col1 col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NULL
----
44
57
6

query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1 HAVING NOT NULL > col1
----

query I rowsort
SELECT ALL - - AVG ( DISTINCT + + col2 ) FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col1, col2, col2
----
-44
-57
-6

query I rowsort
SELECT - col2 + - + col2 AS col2 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col2 col2 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9482
SELECT ALL + col1 + + + col1 DIV - col0 FROM tab0 GROUP BY col0, col1
----
0
0
80

skipif mysql # not compatible
query I rowsort label-9482
SELECT ALL + col1 + + + col1 / - col0 FROM tab0 GROUP BY col0, col1
----
0
0
80

query I rowsort
SELECT - col0 AS col1 FROM tab1 WHERE NULL IS NULL GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT col1 BETWEEN NULL AND - col2
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col2 FROM tab0 GROUP BY col0, col2 HAVING NULL <> NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2, col1 HAVING NULL >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col1 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1, col0
----
0
81

query I rowsort
SELECT - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT - col0 - + col0 FROM tab1 cor0 GROUP BY col0, col0
----
-164
-44
-56

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0, col0 HAVING ( NULL ) > NULL
----

query I rowsort
SELECT col0 FROM tab0 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 AS col0 FROM tab1 WHERE NULL = ( + col0 ) GROUP BY col1 HAVING NOT NULL < NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT NULL <> NULL
----

query I rowsort
SELECT + col1 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query III rowsort
SELECT DISTINCT - col2 AS col1, - col2 AS col0, - col0 FROM tab1 GROUP BY col0, col2, col2 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NOT NULL
----
-15
-91
-92

query II rowsort
SELECT ALL col0, col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
22
28
28
82
82

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0, col2, col2
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col0 col0 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( NOT NULL BETWEEN NULL AND + col1 )
----

query II rowsort
SELECT col0, col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
15
15
91
91
92
92

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
22
28
82

query I rowsort
SELECT col2 * - - col2 FROM tab0 AS cor0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col2, col1, col0
----
-24
-38
-79

query I rowsort
SELECT + col0 * - col0 FROM tab2 cor0 WHERE col0 IS NULL GROUP BY col0
----

query I rowsort
SELECT - col0 FROM tab2 cor0 WHERE NULL < NULL GROUP BY col0
----

query I rowsort
SELECT - + col1 AS col1 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 col2 * col2 col2 FROM tab2 GROUP BY col2
----
3364
6241
7569

query I rowsort
SELECT DISTINCT col1 - + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1, col0, col2 HAVING NOT - + col1 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab1 GROUP BY col0, col1, col2
----
45
71
8

query I rowsort
SELECT DISTINCT - - col1 AS 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 col2 col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col1 FROM tab1 WHERE NOT NULL NOT BETWEEN ( NULL ) AND NULL GROUP BY col1
----

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 WHERE - col2 * + col1 IS NOT NULL GROUP BY col0 HAVING NOT ( NULL ) < NULL
----

query I rowsort
SELECT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
57
6

query II rowsort
SELECT col1, col1 + col1 + - col2 FROM tab0 GROUP BY col1, col2
----
0
-38
0
-79
81
138

query I rowsort
SELECT ALL - col2 + - col0 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT NULL IS NOT NULL
----
-105
-121
-67

query I rowsort
SELECT ALL + col2 FROM tab2 WHERE NOT ( ( NOT NULL IS NOT NULL ) ) GROUP BY col2 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - + col1 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL = NULL
----

query I rowsort
SELECT + col0 AS col1 FROM tab2 AS cor0 GROUP BY col2, col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col2 FROM tab2 AS cor0 GROUP BY col1, col0, col1
----
15
91
92

query II rowsort
SELECT col1 AS col1, col1 FROM tab2 GROUP BY col1, col2, col1
----
41
41
59
59
61
61

query I rowsort
SELECT ALL + col2 * - - col2 AS col1 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING ( NULL ) IS NULL
----
58
79
87

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col0 HAVING NULL > ( NULL )
----

query I rowsort
SELECT ALL + col0 AS col0 FROM tab2 GROUP BY col1, col0 HAVING NULL IS NULL
----
15
91
92

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

query II rowsort
SELECT ALL col2 AS col0, col2 * + - col2 AS col1 FROM tab1 cor0 GROUP BY col2, col2
----
45
-2025
71
-5041
8
-64

query I rowsort
SELECT - - col1 + - col1 FROM tab1 WHERE NOT NULL NOT BETWEEN NULL AND + col0 + - col1 GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT - + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT col0 * + col0 FROM tab0 GROUP BY col2, col0 HAVING NULL IS NULL
----
1849
676
6889

query I rowsort
SELECT - - col1 AS col0 FROM tab1 AS cor0 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL = NULL
----

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
22
28
82

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col1, col2, col0
----
-45
-71
-8

query I rowsort
SELECT ALL col0 - - col0 AS col1 FROM tab2 GROUP BY col0, col0, col1
----
182
184
30

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT col0 AS col2 FROM tab2 GROUP BY col1, col0
----
15
91
92

query I rowsort
SELECT + col0 * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col0 FROM tab2 GROUP BY col0, col2
----
58
79
87

query I rowsort
SELECT + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col1, col2
----
26
43
83

query I rowsort
SELECT ALL - + col1 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
-81
0
0

query I rowsort
SELECT - col0 AS col0 FROM tab0 AS cor0 GROUP BY col0, col1
----
-26
-43
-83

query I rowsort
SELECT + col2 * - col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-2565
-3124
-48

query I rowsort
SELECT col1 * - col0 FROM tab1 GROUP BY col1, col0
----
-132
-1596
-3608

query I rowsort
SELECT + col2 FROM tab2 cor0 GROUP BY col0, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + col2 col1 FROM tab1 GROUP BY col2, col0, col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col1 * + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
1722
3540
3782

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0 HAVING NOT NULL > ( NULL )
----

query I rowsort
SELECT + col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 col0 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT ALL + col1 FROM tab0 cor0 GROUP BY col0, col1, col2
----
0
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NOT NULL
----
22
28
82

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col0, col1, col1 HAVING + col1 <= NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9563
SELECT col0 DIV + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-9563
SELECT col0 / + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1 HAVING NOT + col1 IS NULL
----
0
81

query I rowsort
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query II rowsort
SELECT - col0 AS col2, col0 AS col2 FROM tab0 GROUP BY col0, col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT ( NOT NULL IS NULL )
----
45
71
8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT + - col1 + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
0
0
0

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + + col0 IS NULL
----

query I rowsort
SELECT DISTINCT + + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col2 col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( NOT ( NOT NULL IS NOT NULL ) )
----
45
71
8

query I rowsort
SELECT + col2 FROM tab1 AS cor0 GROUP BY col2, col2, col2
----
45
71
8

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING col2 + col2 IS NULL
----

query I rowsort
SELECT ALL col0 FROM tab1 WHERE NOT ( NOT NULL IS NOT NULL ) GROUP BY col2, col0
----

query I rowsort
SELECT DISTINCT - col2 AS col2 FROM tab0 GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col0, col2
----
-58
-79
-87

query I rowsort
SELECT + col0 * col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
484
6724
784

query I rowsort
SELECT ALL + + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING + + col0 IS NOT NULL
----
22
28
82

query II rowsort
SELECT - col2, - col2 FROM tab1 GROUP BY col2
----
-45
-45
-71
-71
-8
-8

query I rowsort
SELECT DISTINCT + - col0 FROM tab1 cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 + - col1 FROM tab0 AS cor0 GROUP BY col1
----
-162
0

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col1, col1, col0
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 FROM tab2 AS 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
----
58
79
87

query I rowsort
SELECT ALL col2 * - + col2 FROM tab0 GROUP BY col2
----
-1444
-576
-6241

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col1, col0
----
-15
-91
-92

query I rowsort
SELECT + col2 AS col2 FROM tab0 cor0 WHERE NULL NOT BETWEEN NULL AND NULL GROUP BY col2
----

query I rowsort
SELECT - col1 - col1 AS col1 FROM tab1 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 col0 FROM tab1 GROUP BY col0, col2
----
22
28
82

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col1, col1, col0
----
22
28
82

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL >= - col0
----

onlyif mysql # DIV for integer division: 
query II rowsort label-9596
SELECT ALL - - col0, col0 DIV - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
1
43
1
83
1

skipif mysql # not compatible
query II rowsort label-9596
SELECT ALL - - col0, col0 / - - col0 AS col2 FROM tab0 AS cor0 GROUP BY col0
----
26
1
43
1
83
1

query I rowsort
SELECT + - col2 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
0
81

query I rowsort
SELECT ALL - - col1 FROM tab1 cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT DISTINCT - col2 + - col2 AS col2 FROM tab0 GROUP BY col1, col2
----
-158
-48
-76

query I rowsort
SELECT DISTINCT - col1 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1, col1, col1
----
-41
-59
-61

query II rowsort
SELECT col2, + col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
79
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 col1 FROM tab1 cor0 GROUP BY col1, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col1 FROM tab0 AS cor0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
41
59
61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col1 col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - + col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - col2 IS NULL
----

query I rowsort
SELECT ALL + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL ) IS NULL
----
44
57
6

query I rowsort
SELECT - col1 FROM tab1 GROUP BY col2, col1, col1 HAVING NOT + col1 IS NULL
----
-44
-57
-6

query II rowsort
SELECT ALL col0 AS col0, col0 FROM tab1 GROUP BY col0, col0
----
22
22
28
28
82
82

query I rowsort
SELECT + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT DISTINCT col0 FROM tab0 GROUP BY col2, col0, col2
----
26
43
83

query I rowsort
SELECT DISTINCT + - col2 AS col1 FROM tab2 cor0 GROUP BY col0, col1, col2
----
-58
-79
-87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col1 * col1 col1 FROM tab2 GROUP BY col0, col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 GROUP BY col1, col2 HAVING NULL IS NULL
----
41
59
61

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col2 HAVING NULL IS NULL
----
24
38
79

query I rowsort
SELECT DISTINCT + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING col2 IS NOT NULL
----
-15
-91
-92

query I rowsort
SELECT ALL + col0 + - col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
0
0
0

query I rowsort
SELECT col0 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT ALL + col2 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col0, col2
----

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col0, col1, col1
----
41
59
61

query I rowsort
SELECT ALL - + col2 AS col1 FROM tab2 cor0 GROUP BY col2, col2
----
-58
-79
-87

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
58
79
87

query II rowsort
SELECT + col2 / col2, + col2 FROM tab2 WHERE col0 * - - col2 + + - col1 + - col0 IS NULL GROUP BY col2
----

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2, col2
----
24
38
79

query II rowsort
SELECT ALL - - col2 AS col1, + col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT ALL col2 FROM tab0 GROUP BY col1, col2, col1
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL + col0 col0 FROM tab1 AS cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT + col1 AS col1 FROM tab1 GROUP BY col2, col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT ALL + col1 * - col1 AS col0 FROM tab2 GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT col1 * + col1 AS col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL - - col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) = ( NULL )
----

query I rowsort
SELECT DISTINCT - col0 * - col1 AS col1 FROM tab0 GROUP BY col1, col2, col0
----
0
3483

query II rowsort
SELECT ALL col0 AS col2, + col0 FROM tab1 GROUP BY col0
----
22
22
28
28
82
82

query I rowsort
SELECT col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 WHERE NULL > - col2 + - col1 GROUP BY col2, col0, col1 HAVING - + col2 IS NULL
----

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 - - col1 FROM tab1 AS cor0 GROUP BY col1, col1 HAVING NULL = NULL
----

query I rowsort
SELECT ALL - - col0 AS col2 FROM tab1 WHERE NOT col0 IS NOT NULL GROUP BY col0 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

query I rowsort
SELECT ALL - col1 FROM tab0 AS cor0 GROUP BY col1, col1, col1
----
-81
0

query I rowsort
SELECT DISTINCT - - col2 + - col2 FROM tab1 AS cor0 GROUP BY col2 HAVING col2 >= NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING - - col2 < NULL
----

query I rowsort
SELECT ALL - col1 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

query I rowsort
SELECT DISTINCT + col2 / col2 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9650
SELECT ALL col0 DIV col0 FROM tab1 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-9650
SELECT ALL col0 / col0 FROM tab1 GROUP BY col0
----
1
1
1

query I rowsort
SELECT col0 * - col0 AS col1 FROM tab0 GROUP BY col0
----
-1849
-676
-6889

query I rowsort
SELECT DISTINCT - col2 - + col2 FROM tab2 AS cor0 GROUP BY col2
----
-116
-158
-174

query I rowsort
SELECT - col0 FROM tab1 AS cor0 GROUP BY col2, col1, col0
----
-22
-28
-82

query I rowsort
SELECT + col0 FROM tab1 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT ALL + + col2 AS col1, col2 FROM tab2 cor0 GROUP BY col2 HAVING NULL >= NULL
----

query I rowsort
SELECT + + col2 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
38
79

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 - col2 * - + col2 AS col2 FROM tab1 GROUP BY col2
----
2025
5041
64

query II rowsort
SELECT DISTINCT col2 AS col2, - col2 AS col0 FROM tab0 AS cor0 WHERE NULL IS NULL GROUP BY col2, col2
----
24
-24
38
-38
79
-79

query I rowsort
SELECT col0 - + - col0 + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
273
276
45

query I rowsort
SELECT DISTINCT col2 + - col2 AS col2 FROM tab2 AS cor0 GROUP BY col2
----
0

query I rowsort
SELECT ALL + + col2 + + + col2 + + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
135
213
24

query I rowsort
SELECT + col0 FROM tab1 cor0 GROUP BY col0 HAVING NULL IS NULL
----
22
28
82

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 cor0 GROUP BY col1, col2
----
41
59
61

query I rowsort
SELECT - col2 AS col1 FROM tab0 WHERE NOT col1 + + col2 * col1 IS NULL GROUP BY col1, col2
----
-24
-38
-79

query I rowsort
SELECT DISTINCT - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
-45
-71
-8

query I rowsort
SELECT col2 AS col0 FROM tab0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT - col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT col1 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NULL
----
0
0
81

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - + col2 / + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2 HAVING ( + col1 ) = ( NULL )
----

query I rowsort
SELECT ALL - col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NULL IS NULL
----
-24
-38
-79

query I rowsort
SELECT DISTINCT + + col0 FROM tab1 cor0 GROUP BY col0, col0, col1
----
22
28
82

query I rowsort
SELECT - 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 ALL - col1 col2 FROM tab2 AS cor0 GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT DISTINCT + col0 AS col0 FROM tab0 GROUP BY col1, col2, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL - col2 * col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL <= NULL
----

query I rowsort
SELECT col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NULL OR NOT NULL IS NOT NULL
----
0
81

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1, col2
----
0
0
81

query I rowsort
SELECT ALL col0 AS col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col0 FROM tab2 AS cor0 WHERE NOT NULL IN ( + col2 ) GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab2 AS cor0 WHERE NOT ( col0 * + col1 ) IS NULL GROUP BY col1
----
41
59
61

onlyif mysql # DIV for integer division: 
query I rowsort label-9682
SELECT + col1 DIV - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9682
SELECT + col1 / - col1 FROM tab2 AS cor0 GROUP BY col1, col1
----
-1
-1
-1

query I rowsort
SELECT DISTINCT col0 AS col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

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 DISTINCT - col0 AS col1 FROM tab2 cor0 GROUP BY col0, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col2 + - col0 FROM tab0 GROUP BY col0, col0, col2
----
-19
-45
53

query I rowsort
SELECT DISTINCT - + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9688
SELECT DISTINCT + col0 DIV - col0 AS col1 FROM tab0 GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-9688
SELECT DISTINCT + col0 / - col0 AS col1 FROM tab0 GROUP BY col0
----
-1

query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1, col1 HAVING NULL <= NULL
----

query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT - - col2 IS NULL
----
45
71
8

query I rowsort
SELECT ALL + col2 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
45
71
8

query I rowsort
SELECT col1 AS col0 FROM tab2 GROUP BY col1, col1, col0
----
41
59
61

query I rowsort
SELECT DISTINCT col1 * + col2 / - col1 * - col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2, col0 HAVING ( NOT ( NOT + col2 NOT BETWEEN NULL AND - + AVG ( + col2 ) ) )
----
24
38
79

query I rowsort
SELECT ALL col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT col2 <= + col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col2 col2 FROM tab0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col2, col1
----
0
81

query I rowsort
SELECT + 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 DISTINCT col0 * col1 col0 FROM tab2 GROUP BY col1, col0 HAVING NOT ( NULL ) IS NULL
----

query II rowsort
SELECT col0 AS col2, - col0 FROM tab2 GROUP BY col0
----
15
-15
91
-91
92
-92

query I rowsort
SELECT - col1 * - + col1 FROM tab1 GROUP BY col1
----
1936
3249
36

query I rowsort
SELECT + col0 AS col2 FROM tab1 GROUP BY col0, col1
----
22
28
82

query I rowsort
SELECT ALL - col1 FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + - 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 + col1 col0 FROM tab1 cor0 GROUP BY col1
----
44
57
6

query I rowsort
SELECT ALL - col2 FROM tab1 GROUP BY col2, col2 HAVING ( NOT NULL IS NULL )
----

query I rowsort
SELECT + col2 AS col1 FROM tab0 cor0 GROUP BY col2
----
24
38
79

query I rowsort
SELECT + col0 AS col2 FROM tab2 GROUP BY col1, col0
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT + col1 + - col1 col0, col1, col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT - col1 + - col1 IS NOT NULL
----

query I rowsort
SELECT - + col1 AS col2 FROM tab1 AS cor0 WHERE NULL BETWEEN NULL AND col1 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT col2 * col2 AS col2 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

query I rowsort
SELECT ALL + col0 FROM tab2 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT - + col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT + col1 AS col0 FROM tab0 cor0 GROUP BY col1, col1
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab2 AS 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 col0, col0
----
22
28
82

onlyif mysql # DIV for integer division: 
query II rowsort label-9718
SELECT + col1 AS col1, + col1 + + + col1 DIV - col1 FROM tab1 GROUP BY col1
----
44
43
57
56
6
5

skipif mysql # not compatible
query II rowsort label-9718
SELECT + col1 AS col1, + col1 + + + col1 / - col1 FROM tab1 GROUP BY col1
----
44
43
57
56
6
5

query I rowsort
SELECT ALL - col2 + - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + + + col1 col2 FROM tab0 GROUP BY col1
----
0
0

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 cor0 WHERE + col1 IS NOT NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT DISTINCT + - col1 FROM tab0 cor0 GROUP BY col1
----
-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

query I rowsort
SELECT ALL + col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING ( NULL ) < NULL
----

query I rowsort
SELECT DISTINCT - AVG ( DISTINCT - col1 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 + col2 FROM tab0 GROUP BY col2, col2
----
-1406
-552
-6162

query II rowsort
SELECT - col0 AS col1, col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-22
22
-28
28
-82
82

query I rowsort
SELECT + + col2 * col0 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2, col1, col0
----
1260
176
5822

query I rowsort
SELECT DISTINCT - col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT - col0 * - + AVG ( + col0 ) FROM tab1 AS cor0 WHERE NULL IS NOT NULL GROUP BY col0
----

query I rowsort
SELECT - col2 AS col1 FROM tab1 GROUP BY col0, col0, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + col2 col0 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
-44
-57
-6

query I rowsort
SELECT - col0 FROM tab0 GROUP BY col0, col0, col0
----
-26
-43
-83

query I rowsort
SELECT col2 * + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
2025
5041
64

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0, + col0 col1 FROM tab0 AS cor0 GROUP BY col0
----
-26
26
-43
43
-83
83

query I rowsort
SELECT ALL + col1 - - col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

query I rowsort
SELECT + + col0 AS col1 FROM tab2 AS cor0 WHERE ( NOT NULL IS NOT NULL ) GROUP BY col0
----
15
91
92

query I rowsort
SELECT ALL + col2 AS col0 FROM tab0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT ALL + + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col1
----
44
57
6

query I rowsort
SELECT - col2 AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NOT col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING + + AVG ( ALL col2 ) BETWEEN NULL AND col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 AS col0 FROM tab0 GROUP BY col1, col0
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - - col0 col2 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT ALL col0 AS col1 FROM tab2 GROUP BY col1, col0
----
15
91
92

query II rowsort
SELECT DISTINCT col0, col0 AS col2 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

onlyif mysql # DIV for integer division: 
query I rowsort label-9750
SELECT - col1 DIV + + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9750
SELECT - col1 / + + col1 FROM tab1 WHERE NULL IS NULL GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col2 + col2 col1 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
0
0
0

query I rowsort
SELECT + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING ( col1 ) IS NULL
----

query I rowsort
SELECT + col2 FROM tab1 GROUP BY col0, col0, col2
----
45
71
8

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 - col1 + - col0 FROM tab2 AS cor0 WHERE - col1 IS NOT NULL GROUP BY col0, col1 HAVING col0 IS NULL
----

query II rowsort
SELECT + + col1, - col1 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
-81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col2 col1, col1 FROM tab2 AS cor0 GROUP BY col1, col2, col1
----
58
41
79
59
87
61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col2 AS col1 FROM tab1 GROUP BY col2 HAVING + col1 + - col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - - col0 AS col0 FROM tab0 AS cor0 GROUP BY col2, col0
----
26
43
83

query I rowsort
SELECT ALL - col1 + + - col1 * - col1 AS col0 FROM tab2 AS cor0 GROUP BY col1
----
1640
3422
3660

query I rowsort
SELECT AVG ( - col0 ) 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 col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT + col1 FROM tab0 GROUP BY col1 HAVING col1 IS NULL
----

query I rowsort
SELECT col1 FROM tab0 cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - col0 AS col0, - col0 * + col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
-22
-484
-28
-784
-82
-6724

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 WHERE NOT + col2 NOT BETWEEN NULL AND NULL GROUP BY col0, col1
----

query I rowsort
SELECT ALL - col2 * + col2 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col2, col0
----
-2025
-5041
-64

query I rowsort
SELECT col2 AS col2 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
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
----
-58
-79
-87

query I rowsort
SELECT - - col0 + + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
133
150
76

onlyif mysql # DIV for integer division: 
query I rowsort label-9771
SELECT ALL + - col2 DIV - + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
0
0
3

skipif mysql # not compatible
query I rowsort label-9771
SELECT ALL + - col2 / - + col0 FROM tab0 AS cor0 GROUP BY col0, col2
----
0
0
3

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL NOT IN ( - col2 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab1 AS cor0 GROUP BY col0, col1
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-9775
SELECT ALL + col0 DIV - col0 FROM tab1 GROUP BY col0, col0
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9775
SELECT ALL + col0 / - col0 FROM tab1 GROUP BY col0, col0
----
-1
-1
-1

query I rowsort
SELECT ALL col2 * - col2 + - + col2 AS col0 FROM tab2 GROUP BY col2, col2
----
-3422
-6320
-7656

query I rowsort
SELECT + col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col2 FROM tab0 AS cor0 GROUP BY col1, col1, col0
----
-81
0
0

query I rowsort
SELECT ALL + col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL IN ( + col0 )
----

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT + col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - - col1 * - + col1 col2 FROM tab2 WHERE NOT col1 IS NULL GROUP BY col1
----
-1681
-3481
-3721

query I rowsort
SELECT DISTINCT + col1 FROM tab2 AS cor0 WHERE NOT NULL IS NOT NULL 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 tab1 AS cor0 GROUP BY col1, col1
----
-44
-57
-6

query I rowsort
SELECT col0 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL < NULL
----

query II rowsort
SELECT col0, + col0 FROM tab0 GROUP BY col0
----
26
26
43
43
83
83

query I rowsort
SELECT col2 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
45
71
8

query I rowsort
SELECT + - col2 + + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
0
0
0

query I rowsort
SELECT - col0 * AVG ( - col0 ) FROM tab0 GROUP BY col0 HAVING NOT NULL > NULL
----

query I rowsort
SELECT ALL + col0 FROM tab0 GROUP BY col0 HAVING AVG ( col0 ) IS NOT NULL
----
26
43
83

query I rowsort
SELECT ALL - col0 + + col0 FROM tab0 GROUP BY col0
----
0
0
0

query I rowsort
SELECT - col1 AS col2 FROM tab2 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NOT NULL
----
-41
-59
-61

query I rowsort
SELECT DISTINCT - col0 FROM tab1 AS cor0 GROUP BY col0, col2, col1
----
-22
-28
-82

query I rowsort
SELECT ALL - - col2 FROM tab1 cor0 GROUP BY col2, col1, col1
----
45
71
8

query II rowsort
SELECT DISTINCT - col2, col2 FROM tab0 GROUP BY col2, col2
----
-24
24
-38
38
-79
79

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col2, col1
----

query I rowsort
SELECT ALL - + col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
-22
-28
-82

query I rowsort
SELECT ALL - col1 AS col2 FROM tab2 GROUP BY col0, col0, col1
----
-41
-59
-61

query I rowsort
SELECT ALL + col1 FROM tab0 GROUP BY col1 HAVING ( NOT ( NULL ) IS NULL )
----

query II rowsort
SELECT ALL - col2 AS col1, col2 * + col2 FROM tab1 GROUP BY col2
----
-45
2025
-71
5041
-8
64

query II rowsort
SELECT ALL col1 AS col0, col1 AS col2 FROM tab2 AS cor0 WHERE NULL IS NULL GROUP BY col1
----
41
41
59
59
61
61

query I rowsort
SELECT DISTINCT + + col2 * - + col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-3364
-6241
-7569

query I rowsort
SELECT DISTINCT + col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query II rowsort
SELECT - col2 / - col2 AS col2, col1 AS col2 FROM tab0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col0, col2, col1
----
24
38
79

query I rowsort
SELECT + col1 + col1 FROM tab2 AS cor0 GROUP BY col1
----
118
122
82

query I rowsort
SELECT col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT + + col1 + + col1 FROM tab1 cor0 GROUP BY col1 HAVING NULL > NULL
----

query I rowsort
SELECT DISTINCT - AVG ( ALL col0 ) FROM tab2 cor0 WHERE NOT NULL IS NULL OR - col1 * col2 IS NULL GROUP BY col0, col0
----

query I rowsort
SELECT ALL col2 AS col2 FROM tab0 GROUP BY col1, col2, col2
----
24
38
79

query I rowsort
SELECT - col0 AS col2 FROM tab0 GROUP BY col2, col1, col0
----
-26
-43
-83

query I rowsort
SELECT DISTINCT - col1 + + col1 FROM tab0 AS cor0 GROUP BY col1
----
0

query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT DISTINCT col1 * + col2 FROM tab2 GROUP BY col0, col2, col1
----
2378
4661
5307

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 + + col1 col0 FROM tab1 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col0 + + col0 AS col1 FROM tab0 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT ALL col1 * - col1 FROM tab1 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT + col2 + - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col1, col2
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col1, col2 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
58
79
79
87
87

query I rowsort
SELECT DISTINCT col2 AS col1 FROM tab0 GROUP BY col0, col2, col0
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT - - col2 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
38
79

query I rowsort
SELECT ALL - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-9826
SELECT DISTINCT - + col0 DIV + col0 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-1

skipif mysql # not compatible
query I rowsort label-9826
SELECT DISTINCT - + col0 / + col0 AS col1 FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-1

query I rowsort
SELECT ALL + col0 AS col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9828
SELECT ALL + - col0 DIV - col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

skipif mysql # not compatible
query I rowsort label-9828
SELECT ALL + - col0 / - col0 FROM tab0 AS cor0 GROUP BY col0
----
1
1
1

query I rowsort
SELECT ALL col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT DISTINCT + col2 + - col1 AS col2 FROM tab2 AS cor0 WHERE NOT - col1 IS NULL GROUP BY col1, col2
----
17
20
26

query I rowsort
SELECT DISTINCT + col0 FROM tab1 AS cor0 GROUP BY col0 HAVING ( NULL IS NOT NULL )
----

query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab2 GROUP BY col2, col1 HAVING + col2 IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col2 FROM tab0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
-24
-38
-79

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE - col2 IS NULL GROUP BY col1
----

query I rowsort
SELECT col2 FROM tab1 GROUP BY col2, col0 HAVING col0 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 GROUP BY col1, col2, col2
----
41
59
61

query I rowsort
SELECT ALL + - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
-22
-28
-82

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
-41
-59
-61

query I rowsort
SELECT col1 FROM tab1 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL - col2 AS col0, + col2 AS col2 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col0, col1
----
44
57
6

query I rowsort
SELECT ALL + - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 AS col0 FROM tab1 GROUP BY col0, col2
----
45
71
8

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 cor0 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
142
16
90

query I rowsort
SELECT ALL col2 AS 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 ALL - col2 col2 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
-58
-79
-87

query I rowsort
SELECT + col2 * col2 AS col2 FROM tab0 GROUP BY col2
----
1444
576
6241

query I rowsort
SELECT + + col0 AS col0 FROM tab2 cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT col2 AS col2 FROM tab2 cor0 GROUP BY col2
----
58
79
87

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 + col0 + col1 + col0 AS col2 FROM tab2 GROUP BY col0, col1, col1
----
225
241
91

query I rowsort
SELECT ALL + + col1 + - col1 FROM tab1 cor0 GROUP BY col1, col0, col1
----
0
0
0

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col2 * - col2 col1 FROM tab1 AS cor0 GROUP BY col2
----
2025
5041
64

query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
57
6

query I rowsort
SELECT DISTINCT + col2 + - - col2 FROM tab2 GROUP BY col2, col1 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT DISTINCT col2 * - col2 FROM tab2 GROUP BY col2, col2 HAVING NOT NULL IS NOT NULL
----
-3364
-6241
-7569

query I rowsort
SELECT + col2 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL col2 FROM tab1 cor0 GROUP BY col2, col2
----
45
71
8

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2, col1, col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT + col2 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT - col2 FROM tab1 GROUP BY col1, col2 HAVING NOT ( NULL ) IS NULL
----

query I rowsort
SELECT DISTINCT + col0 + - col0 FROM tab2 GROUP BY col0
----
0

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab2 GROUP BY col0, col1
----
41
59
61

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT + col2 AS col2 FROM tab1 GROUP BY col2, col0
----
45
71
8

query I rowsort
SELECT ALL - col0 FROM tab0 cor0 GROUP BY col0, col2 HAVING - col2 IS NOT NULL
----
-26
-43
-83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, + col1 FROM tab0 cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col1, col1
----

query I rowsort
SELECT col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + col1 * col1 - - col1 FROM tab1 AS cor0 GROUP BY col1
----
1980
3306
42

query I rowsort
SELECT ALL col2 * - col2 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64

query I rowsort
SELECT ALL col2 FROM tab1 cor0 GROUP BY col1, col2, col0 HAVING NULL IS NULL
----
45
71
8

query II rowsort
SELECT col1 AS col0, col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
0
0
81
81

query II rowsort
SELECT + col2 AS col1, + col2 AS 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, col1
----
-44
-57
-6

query I rowsort
SELECT + col1 FROM tab0 AS cor0 GROUP BY col1, col2, col0
----
0
0
81

query II rowsort
SELECT DISTINCT + col2 AS col2, col2 AS col2 FROM tab1 AS cor0 GROUP BY col2
----
45
45
71
71
8
8

query I rowsort
SELECT ALL + + col1 FROM tab2 AS cor0 GROUP BY col1, col2
----
41
59
61

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 ALL - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col1
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col0
----
-45
-71
-8

query I rowsort
SELECT DISTINCT col2 FROM tab0 GROUP BY col2 HAVING NOT - AVG ( DISTINCT - col2 ) IS NULL
----
24
38
79

onlyif mysql # DIV for integer division: 
query I rowsort label-9884
SELECT DISTINCT col1 DIV + + col1 AS col0 FROM tab1 GROUP BY col1
----
1

skipif mysql # not compatible
query I rowsort label-9884
SELECT DISTINCT col1 / + + col1 AS col0 FROM tab1 GROUP BY col1
----
1

query I rowsort
SELECT ALL col0 AS col1 FROM tab1 cor0 GROUP BY col2, col0
----
22
28
82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col2 FROM tab0 GROUP BY col1, col0, col0
----
0
81

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 WHERE NOT ( + col2 ) IS NULL GROUP BY col2
----
45
71
8

query I rowsort
SELECT col1 + col1 FROM tab0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - col0 FROM tab2 GROUP BY col0, col2, col0
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 + + col0 AS col1 FROM tab1 GROUP BY col0, col0 HAVING NULL IS NULL
----
164
44
56

query II rowsort
SELECT - + col1 AS col0, col1 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
-1681
-59
-3481
-61
-3721

query II rowsort
SELECT ALL col0 AS col0, - col0 AS col2 FROM tab1 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0
----
15
91
92

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) NOT BETWEEN NULL AND - col2 GROUP BY col0, col1
----

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE + col2 = NULL GROUP BY col1
----

query I rowsort
SELECT ALL - + col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col1 + - + col1 FROM tab0 WHERE NOT ( col1 IS NOT NULL ) GROUP BY col1
----

query I rowsort
SELECT - col1 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 col2 FROM tab0 AS cor0 GROUP BY col0, col0, col2 HAVING ( NULL ) IS NOT NULL AND NOT NULL IS NOT NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * + - col1 col2 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NULL IS NULL
----
0
81

query I rowsort
SELECT + col2 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NOT col1 IS NOT NULL
----

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 AS col0 FROM tab2 cor0 GROUP BY col2
----
58
79
87

query I rowsort
SELECT col1 + + - col1 FROM tab2 GROUP BY col1
----
0
0
0

query I rowsort
SELECT - col0 FROM tab2 AS cor0 WHERE NULL > ( NULL ) GROUP BY col0 HAVING ( 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, col0
----
26
43
83

query I rowsort
SELECT ALL - col2 AS col0 FROM tab1 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT - col2 FROM tab1 GROUP BY col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
15
91
92

query I rowsort
SELECT ALL col2 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col2
----
102
150
170

query I rowsort
SELECT + + col2 FROM tab0 cor0 GROUP BY col2, col0
----
24
38
79

query I rowsort
SELECT - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-22
-28
-82

query I rowsort
SELECT DISTINCT col2 - + col2 FROM tab1 GROUP BY col2
----
0

query II rowsort
SELECT DISTINCT + col0, col1 FROM tab1 GROUP BY col0, col1 HAVING col1 IS NOT NULL
----
22
6
28
57
82
44

query I rowsort
SELECT + col1 * - col1 AS col2 FROM tab0 GROUP BY col1
----
-6561
0

query I rowsort
SELECT - col2 FROM tab2 GROUP BY col2 HAVING NOT NULL >= NULL
----

query I rowsort
SELECT col1 FROM tab2 AS cor0 WHERE NOT NULL <> NULL GROUP BY col1, col1
----

query I rowsort
SELECT + - col0 FROM tab2 AS cor0 GROUP BY col0, col2
----
-15
-91
-92

query I rowsort
SELECT DISTINCT col0 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT ALL - col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT col0 + - col0 AS col0 FROM tab1 GROUP BY col0, col2
----
0
0
0

query I rowsort
SELECT + AVG ( ALL + - col0 ) AS col2 FROM tab0 GROUP BY col0, col1 HAVING NOT col0 * + col0 IS NOT NULL
----

query I rowsort
SELECT col0 AS col1 FROM tab2 GROUP BY col0, col1
----
15
91
92

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT AVG ( - col0 ) col2 FROM tab1 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
45
71
8

query I rowsort
SELECT ALL - + col0 * col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
-225
-8281
-8464

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 WHERE col1 * col1 IS NULL GROUP BY col1, col2
----

query I rowsort
SELECT + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2, col2
----
24
38
79

query I rowsort
SELECT DISTINCT - col0 * col2 AS col1 FROM tab0 GROUP BY col0, col2
----
-1032
-2054
-3154

query I rowsort
SELECT - + col0 AS col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT - col2 IS NULL
----
24
38
79

query I rowsort
SELECT ALL - col1 * col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL col1 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL AND NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col2 FROM tab2 WHERE NULL NOT IN ( + col1 + - + col2 ) GROUP BY col2
----

query I rowsort
SELECT DISTINCT + col0 FROM tab0 AS cor0 GROUP BY col2, col0, col0
----
26
43
83

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0, col2
----
22
28
82

query I rowsort
SELECT DISTINCT - - col2 AS col2 FROM tab1 cor0 GROUP BY col2
----
45
71
8

query I rowsort
SELECT DISTINCT - col0 * + col0 FROM tab2 GROUP BY col0 HAVING NULL NOT BETWEEN NULL AND + + col0
----

query I rowsort
SELECT + col2 FROM tab1 cor0 GROUP BY col2, col1
----
45
71
8

query I rowsort
SELECT - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0
----
-41
-59
-61

query I rowsort
SELECT col1 * - - col1 FROM tab2 GROUP BY col1
----
1681
3481
3721

query I rowsort
SELECT ALL - + AVG ( DISTINCT - col1 ) FROM tab1 WHERE + + col0 IS NOT NULL GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT DISTINCT col0 * - col2 AS col2 FROM tab2 GROUP BY col0, col0, col2
----
-1305
-5336
-7189

query I rowsort
SELECT DISTINCT + col1 FROM tab0 WHERE NOT NULL IS NULL GROUP BY col1, col0
----

query I rowsort
SELECT - col2 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2, col0 HAVING NOT + col2 IS NULL
----
-45
-71
-8

query I rowsort
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL <> col0
----

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 - - col1 FROM tab1 GROUP BY col1
----
0
0
0

query I rowsort
SELECT col1 FROM tab0 WHERE NOT NULL NOT IN ( - col1 ) GROUP BY col2, col1
----

query I rowsort
SELECT + col2 * col2 * + col2 - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
13800
492960
54834

query I rowsort
SELECT + col0 * - - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
225
8281
8464

query I rowsort
SELECT - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
-58
-79
-87

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab0 GROUP BY col1, col2 HAVING NOT - col1 BETWEEN ( NULL ) AND ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col0 + col0 col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NOT NULL
----
182
184
30

query I rowsort
SELECT ALL - col1 * + col1 AS col1 FROM tab0 AS cor0 GROUP BY col1, col1
----
-6561
0

query I rowsort
SELECT ALL col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
182
184
30

query I rowsort
SELECT col1 + col1 + + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
132
171
18

query I rowsort
SELECT ALL col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING NULL IS NOT NULL
----

query II rowsort
SELECT - - col1 AS col0, col1 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
44
44
57
57
6
6

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col1, col0
----
26
43
83

query I rowsort
SELECT DISTINCT - + col1 FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
-41
-59
-61

query I rowsort
SELECT ALL - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
-58
-79
-87

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 GROUP BY col2, col1, col1
----
-44
-57
-6

query I rowsort
SELECT + col0 AS col1 FROM tab0 GROUP BY col0, col0
----
26
43
83

query I rowsort
SELECT ALL + - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
-22
-28
-82

query I rowsort
SELECT + + col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
24
38
79

query I rowsort
SELECT DISTINCT col1 AS col1 FROM tab1 WHERE ( NULL ) IS NULL GROUP BY col1
----
44
57
6

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0, col1, col0
----
26
43
83

query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col1, col0, col1
----
26
43
83

query I rowsort
SELECT ALL + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT - col1 - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
-114
-12
-88

query I rowsort
SELECT DISTINCT - col0 FROM tab1 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query II rowsort
SELECT ALL col1, col1 FROM tab0 GROUP BY col0, col1, col0
----
0
0
0
0
81
81

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT col0 col1 FROM tab0 GROUP BY col0, col2
----
26
43
83

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 + - col2 AS col0 FROM tab0 cor0 GROUP BY col2
----
-24
-38
-79

query I rowsort
SELECT col1 AS col0 FROM tab1 GROUP BY col0, col1 HAVING NOT NULL BETWEEN NULL AND + + AVG ( DISTINCT + + col1 )
----

query I rowsort
SELECT DISTINCT - col1 * col1 FROM tab1 AS cor0 GROUP BY col1
----
-1936
-3249
-36

query I rowsort
SELECT + col0 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( NOT NULL >= NULL )
----

query I rowsort
SELECT DISTINCT col1 AS col2 FROM tab2 GROUP BY col0, col1 HAVING col0 IS 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 DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING - col0 IS NOT NULL
----
44
57
6

query I rowsort
SELECT ALL col0 + - col0 AS col2 FROM tab2 WHERE + col0 > + col2 GROUP BY col0 HAVING NULL IS NULL
----
0
0

query I rowsort
SELECT - - col0 AS col0 FROM tab2 cor0 GROUP BY col0, col1
----
15
91
92

query I rowsort
SELECT DISTINCT - - col0 FROM tab1 cor0 GROUP BY col0
----
22
28
82

query I rowsort
SELECT DISTINCT + col1 FROM tab1 WHERE - col0 IS NOT NULL GROUP BY col1, col1
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col1 col0 FROM tab2 GROUP BY col1 HAVING NULL >= NULL
----

query I rowsort
SELECT - - col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col2 FROM tab1 GROUP BY col2, col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT ALL + col0 AS col2 FROM tab2 GROUP BY col2, col0
----
15
91
92

onlyif mysql # DIV for integer division: 
query I rowsort label-9993
SELECT col0 DIV - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

skipif mysql # not compatible
query I rowsort label-9993
SELECT col0 / - col0 AS col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
-1
-1
-1

query I rowsort
SELECT DISTINCT - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1, col2
----
-44
-57
-6

onlyif mysql # DIV for integer division: 
query I rowsort label-9995
SELECT DISTINCT col2 DIV col2 col1 FROM tab2 GROUP BY col2
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-9995
SELECT DISTINCT col2 / col2 col1 FROM tab2 GROUP BY col2
----
1

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 + col2 FROM tab2 AS cor0 GROUP BY col1, col1, col2
----
58
79
87

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - + col2 col1 FROM tab1 cor0 GROUP BY col2
----
-45
-71
-8

query I rowsort
SELECT DISTINCT - col1 FROM tab0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
0

